Exemplo n.º 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
Exemplo n.º 2
0
def plot_known_tnos(ax, ra_cen, dec_cen, width, height, date=newMoons['Oct13']):
    MPCORB = 'MPCORB.DAT'  # TNOs file only: http://www.minorplanetcenter.net/iau/MPCORB/Distant.txt
    rate_cut = 'a > 15'
    if os.access(MPCORB,os.F_OK):
       kbos = mpcread.getKBOs(MPCORB, cond=rate_cut)
       for kbo in kbos:
          kbo.compute(ephem.date(date))
          ax.scatter(math.degrees(kbo.ra),
                 math.degrees(kbo.dec),
                 marker='+',
                 facecolor='none',
                 edgecolor='g')

    return ax
Exemplo n.º 3
0
def plot_known_tnos_singly(ax, date):
    MPCORB = 'MPCORB.DAT'  # TNOs file only: http://www.minorplanetcenter.net/iau/MPCORB/Distant.txt
    rate_cut = 'a > 15'
    if os.access(MPCORB,os.F_OK):
        kbos = mpcread.getKBOs(MPCORB, cond=rate_cut)
        for kbo in kbos:
            kbo.compute(ephem.date(date))
            pos = (math.degrees(kbo.ra), math.degrees(kbo.dec))
            ax.scatter(pos[0],
                pos[1],
                marker='x',
                facecolor='r')
            ax.annotate(kbo.name, (pos[0]+.4, pos[1]+0.1), size='xx-small', color='r')

    return ax
Exemplo n.º 4
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
Exemplo n.º 5
0
def plot_known_tnos_batch(handles, labels, date):
    MPCORB = 'MPCORB.DAT'  # TNOs file only: http://www.minorplanetcenter.net/iau/MPCORB/Distant.txt
    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))
        handles.append(plt.scatter(kbo_ra,
            kbo_dec,
            marker='+',
            facecolor='none',
            edgecolor='g'))
        labels.append('known TNOs')

    return handles, labels
Exemplo n.º 6
0
            dec = t.array['DEJ2000']

            rects = [Rectangle(xy=(ra[idx] - camera_width_36 / 2.0, dec[idx] - camera_width_36 / 2.0),
                               height=camera_height,
                               width=camera_width_36,
                               edgecolor='m',
                               alpha=0.1,
                               lw=0.1, zorder=-100,
                               fill=False) for idx in xrange(ra.size)]
            for r in rects:
                ax.add_artist(r)
                

if PLOT_MPCORB:
    print "PLOTTING LOCATIONS OF KNOWN KBOs (using {})".format(MPCORB_FILE)
    kbos = mpcread.getKBOs(MPCORB_FILE)
    for kbo in kbos:
        kbo.compute(plot_date)
        if field_polygon.isInside(math.degrees(float(kbo.ra)), math.degrees(float(kbo.dec))):
            ax.scatter(math.degrees(kbo.ra),
                       math.degrees(kbo.dec),
                       marker='x',
                       s=4,
                       facecolor='r',
                       edgecolor='r', alpha=0.3)

if PLOT_REAL_KBOS:
    reader = mpc.MPCReader()
    print "PLOTTING LOCATIONS OF OSSOS KBOs (using directory {})".format(REAL_KBO_AST_DIR)
    for ast in os.listdir(REAL_KBO_AST_DIR):
        if not ast.startswith('u'):
Exemplo n.º 7
0
                   width=camera_dimen,
                   edgecolor='k',
                   alpha=0.1,
                   lw=0.1, zorder=-100,
                   fill=False) for idx in xrange(ra.size)]
for r in rects:
   ax.add_artist(r)

ra_cen = math.radians(ra_cen)
dec_cen = math.radians(dec_cen)
width = math.radians(width)
height = math.radians(height)

MPCORB = os.path.join(os.getenv('HOME','/Users/jjk'), 'MPCORB.DAT')
if os.access(MPCORB,os.F_OK):
   kbos = mpcread.getKBOs(MPCORB)
   for kbo in kbos:
      kbo.compute(ephem.date(newMoons['Oct13']))
      if not ( kbo.ra < ra_cen + width/2.0 and kbo.ra > ra_cen - width/2.0 and kbo.dec < dec_cen + height/2.0 and kbo.dec > dec_cen - height/2.0 ) :
         continue
      ax.scatter(math.degrees(kbo.ra),
             math.degrees(kbo.dec),
             marker='h',
             s=10,
             facecolor='none',
             edgecolor='g')

   

savefig('layout.pdf')
Exemplo n.º 8
0
            rects = [
                Rectangle(xy=(ra[idx] - dimen / 2.0, dec[idx] - dimen / 2.0),
                          height=camera_dimen,
                          width=camera_dimen,
                          edgecolor='m',
                          alpha=0.1,
                          lw=0.1,
                          zorder=-100,
                          fill=False) for idx in xrange(ra.size)
            ]
            for r in rects:
                ax.add_artist(r)

if PLOT_MPCORB:
    print "PLOTTING LOCATIONS OF KNOWN KBOs (using {})".format(MPCORB_FILE)
    kbos = mpcread.getKBOs(MPCORB_FILE)
    for kbo in kbos:
        kbo.compute(plot_date)
        if not ((ra_cen + width / 2.0 > kbo.ra > ra_cen - width / 2.0) and
                (dec_cen + height / 2.0 > kbo.dec > dec_cen - height / 2.0)):
            continue
        ax.scatter(math.degrees(kbo.ra),
                   math.degrees(kbo.dec),
                   marker='h',
                   s=1,
                   facecolor='g',
                   edgecolor='g',
                   alpha=0.3)

if PLOT_REAL_KBOS:
    print "PLOTTING LOCATIONS OF OSSOS KBOs (using directory {})".format(