Example #1
0
File: l35.py Project: xuduo117/brut
def main():

    data = json.load(open('../models/l035_scores.json'))

    stamps = np.array(data['stamps'])
    scores = np.array(data['scores'])

    unmerged = stamps[scores > .2]
    merged = merge(unmerged, scores[scores > 0.2])


    unambig = [1, 3, 4, 6, 7, 11, 12, 13, 15, 16, 17, 18, 19]
    ambig = [2, 9]
    new = [14]
    fp = [0, 5]
    neb = [8, 10]
    groups = [unambig, ambig, new, fp, neb]


    ims = [ex(merged[i]) for g in groups for i in g]

    plt.figure(dpi=400, tight_layout=True)
    collage(ims, 5, 4)
    trace_groups(groups, 'rgbcm', 5, 4)

    hide_axes()
    plt.savefig('l35.eps')
Example #2
0
def chunked_merge(stamps, scores):
    stamps[stamps[:, 1] > 180, 1] -= 360
    lon = stamps[:, 1]

    ostamps, oscores = [], []
    for lcen in np.arange(lon.min(), lon.max() + 1, 1):
        good = np.abs(lon - lcen) < 1
        if good.sum() == 0:
            continue
        st, sc = merge(stamps[good], scores[good])
        good = np.abs(st[:, 1] - lcen) < .5
        if good.sum() == 0:
            continue
        ostamps.append(st[good])
        oscores.append(sc[good])
        print lcen, good.sum()

    result = merge(np.vstack(ostamps), np.hstack(oscores))
    result[0][result[0][:, 1] < 0, 1] += 360
    return result
Example #3
0
def chunked_merge(stamps, scores):
    stamps[stamps[:, 1] > 180, 1] -= 360
    lon = stamps[:, 1]

    ostamps, oscores = [], []
    for lcen in np.arange(lon.min(), lon.max() + 1, 1):
        good = np.abs(lon - lcen) < 1
        if good.sum() == 0:
            continue
        st, sc = merge(stamps[good], scores[good])
        good = np.abs(st[:, 1] - lcen) < .5
        if good.sum() == 0:
            continue
        ostamps.append(st[good])
        oscores.append(sc[good])
        print lcen, good.sum()

    result = merge(np.vstack(ostamps), np.hstack(oscores))
    result[0][result[0][:, 1] < 0, 1] += 360
    return result
Example #4
0
def main():
    np.random.seed(42)

    data = json.load(open('../models/l035_scores.json'))

    stamps = np.array(data['stamps'])
    scores = np.array(data['scores'])

    l = stamps[:, 1]
    b = stamps[:, 2]

    good = (scores > .1) & (l < 34.8) & (l > 34.6) & (b > -.4) & (b < -0.2)
    assert good.sum() > 0

    stamps = stamps[good]
    scores = scores[good]

    merged, ms = merge(stamps, scores)

    f = get_field(35)
    g = scale(f.i4, limits=[70, 99])
    r = scale(f.mips, limits=[70, 99])
    b = r * 0

    im = np.dstack((r, g, b))

    plt.figure(dpi=200, tight_layout=True)
    plt.imshow(im, extent=[36, 34, -1, 1], interpolation="bicubic")

    plot_stamps(stamps, linewidth=1, edgecolor='white', label='Raw',
                alpha=1)
    plot_stamps(merged, edgecolor='red', alpha=1, linewidth=2,
                label='Merged')

    plt.xlim(34.795, 34.695)
    plt.ylim(-.365, -.265)


    plt.xlabel("$\ell$ ($^\circ$)")
    plt.ylabel("b ($^\circ$)")
    leg = plt.legend(loc='upper left', frameon=False)
    for text in leg.get_texts():
        text.set_color('white')

    plt.savefig('cluster.eps')
Example #5
0
def main():

    data = json.load(open('../models/l035_scores.json'))

    stamps = np.array(data['stamps'])
    scores = np.array(data['scores'])

    l = stamps[:, 1]
    b = stamps[:, 2]

    good = (scores > .1) & (l < 35.17) & (l > 34.9) & (b > -.9) & (b < -0.6)

    stamps = stamps[good]
    scores = scores[good]

    merged = merge(stamps, scores)
    mwp = np.array(bubble_params())
    mwp  = mwp[(mwp[:, 1] < 35.3) & (mwp[:, 1] > 35)]

    f = get_field(35)
    bad = f.mips == 0
    g = scale(f.i4, limits=[30, 99.8])
    r = scale(f.mips, limits=[30, 99.7])
    r[bad] = 255
    b = r * 0

    im = np.dstack((r, g, b))

    plt.figure(dpi=200, tight_layout=True)
    plt.imshow(im, extent=[36, 34, -1, 1], interpolation="bicubic")

    plot_stamps(merged, edgecolor='#7570b3', linewidth=2, label='Brut')
    plot_stamps(mwp, edgecolor='#e7298a', linewidth=2, label='MWP')

    plt.xlim(35.2, 35)
    plt.ylim(-.825, -.625)
    plt.legend(loc='upper right')

    plt.xlabel("$\ell$ ($^\circ$)")
    plt.ylabel("b ($^\circ$)")

    plt.savefig('cluster_confusion.eps')
Example #6
0
def main():
    np.random.seed(42)

    data = json.load(open('../models/l035_scores.json'))

    stamps = np.array(data['stamps'])
    scores = np.array(data['scores'])

    l = stamps[:, 1]
    b = stamps[:, 2]

    good = (scores > .1) & (l < 34.8) & (l > 34.6) & (b > -.4) & (b < -0.2)
    assert good.sum() > 0

    stamps = stamps[good]
    scores = scores[good]

    merged, ms = merge(stamps, scores)

    f = get_field(35)
    g = scale(f.i4, limits=[70, 99])
    r = scale(f.mips, limits=[70, 99])
    b = r * 0

    im = np.dstack((r, g, b))

    plt.figure(dpi=200, tight_layout=True)
    plt.imshow(im, extent=[36, 34, -1, 1], interpolation="bicubic")

    plot_stamps(stamps, linewidth=1, edgecolor='white', label='Raw', alpha=1)
    plot_stamps(merged, edgecolor='red', alpha=1, linewidth=2, label='Merged')

    plt.xlim(34.795, 34.695)
    plt.ylim(-.365, -.265)

    plt.xlabel("$\ell$ ($^\circ$)")
    plt.ylabel("b ($^\circ$)")
    leg = plt.legend(loc='upper left', frameon=False)
    for text in leg.get_texts():
        text.set_color('white')

    plt.savefig('cluster.eps')
Example #7
0
def main():

    data = json.load(open('../models/l035_scores.json'))

    stamps = np.array(data['stamps'])
    scores = np.array(data['scores'])

    l = stamps[:, 1]
    b = stamps[:, 2]

    good = (scores > .1) & (l < 35.17) & (l > 34.9) & (b > -.9) & (b < -0.6)

    stamps = stamps[good]
    scores = scores[good]

    merged = merge(stamps, scores)
    mwp = np.array(bubble_params())
    mwp = mwp[(mwp[:, 1] < 35.3) & (mwp[:, 1] > 35)]

    f = get_field(35)
    bad = f.mips == 0
    g = scale(f.i4, limits=[30, 99.8])
    r = scale(f.mips, limits=[30, 99.7])
    r[bad] = 255
    b = r * 0

    im = np.dstack((r, g, b))

    plt.figure(dpi=200, tight_layout=True)
    plt.imshow(im, extent=[36, 34, -1, 1], interpolation="bicubic")

    plot_stamps(merged, edgecolor='#7570b3', linewidth=2, label='Brut')
    plot_stamps(mwp, edgecolor='#e7298a', linewidth=2, label='MWP')

    plt.xlim(35.2, 35)
    plt.ylim(-.825, -.625)
    plt.legend(loc='upper right')

    plt.xlabel("$\ell$ ($^\circ$)")
    plt.ylabel("b ($^\circ$)")

    plt.savefig('cluster_confusion.eps')