示例#1
0
def plot_known_tnos_singly(ax, extent, date):
    rate_cut = 'a > 15'
    print "PLOTTING LOCATIONS OF KNOWN KBOs (using {})".format(parameters.MPCORB_FILE)
    kbos = mpcread.getKBOs(parameters.MPCORB_FILE)
    print('Known KBOs: {}'.format(len(kbos)))
    retkbos = []
    for kbo in kbos:
        kbo.compute(date)
        # # keep only the ones that'd make it onto this plot
        if not ((extent[0] <= math.degrees(kbo.ra) <= extent[1])
                and (extent[2] <= math.degrees(kbo.dec) <= extent[3])):
            continue
        pos = (math.degrees(kbo.ra), math.degrees(kbo.dec))
        ax.scatter(pos[0],
                   pos[1],
                   marker='x',
                   facecolor='r')
        if len(kbo.name) >= 10:  # sorted out for Sofia Pro Light
            ra_shift = -0.45
        else:
            ra_shift = -0.22
        ax.annotate(kbo.name, (pos[0] + ra_shift, pos[1] + 0.06), size=7, color='r')
        retkbos.append(kbo)
    print('Retained KBOs: {}'.format(len(retkbos)))
    return ax, retkbos
示例#2
0
def plot_known_tnos_batch(handles, labels, date):
    rate_cut = 'a > 15'
    if os.access(MPCORB, os.F_OK):
        kbos = mpcread.getKBOs(MPCORB, cond=rate_cut)
        kbo_ra = []
        kbo_dec = []
        for kbo in kbos:
            kbo.compute(ephem.date(date))
            kbo_ra.append(math.degrees(kbo.ra))
            kbo_dec.append(math.degrees(kbo.dec))
            ax.scatter(kbo_ra, kbo_dec,
                       marker='+', facecolor='none', edgecolor='g')

    return ax