Пример #1
0
    def load_objects(self, directory_name=None):
        """Load the targets from a file.

        """
        # for name in Neptune:
        #     self.kbos[name] = Neptune[name]

        if directory_name is not None:
            # defaults to looking at .ast files only
            if directory_name == parameters.REAL_KBO_AST_DIR:
                kbos = parsers.ossos_discoveries(all_objects=True, data_release=None)
            else:
                kbos = parsers.ossos_discoveries(directory_name, all_objects=False, data_release=None)

            for kbo in kbos:
                # if kbo.orbit.arc_length > 30.:  # cull the short ones for now
                self.kbos[kbo.name] = kbo.orbit
                self.kbos[kbo.name].mag = kbo.mag
                # else:
                #     print("Arc very short, large uncertainty. Skipping {} for now.\n".format(kbo.name))

        self.doplot()
Пример #2
0
def argperi_a(directory):
    # dir = '/Users/bannisterm/Dropbox/OSSOS/measure3/test_argperi_align/'
    # directory = '/Users/bannisterm/Dropbox/OSSOS/measure3/2014B-H/track/'
    tnos = parsers.ossos_discoveries(directory=directory, all_objects=True)

    fig, ax = plt.subplots(
        3, 1, sharex=True,
        figsize=(7, 8))  # a4 is 1 x sqrt(2), so use those proportions
    fig.subplots_adjust(hspace=0.25)

    for obj in tnos:
        if obj.orbit.arc_length < 60. * units.day:
            print('Skipping', obj.name, obj.orbit.arc_length)
            continue

        alpha = 0.4

        obj_r = obj.orbit.distance.value
        obj_dr = obj.orbit.distance_uncertainty.value
        obj_a = obj.orbit.a.value
        obj_da = obj.orbit.da.value
        obj_i = obj.orbit.inc.value
        obj_di = obj.orbit.dinc.value
        obj_e = obj.orbit.e.value
        obj_de = obj.orbit.de.value

        obj_peri = obj_a * (1. - obj_e)
        obj_dperi = (obj_da / obj_a) + (obj_de / obj_e)
        obj_argP = obj.orbit.om.value
        if obj_argP > 180.:
            obj_argP = obj_argP - 360.
        obj_dargP = obj.orbit.dom.value

        ax[0].errorbar(obj_r,
                       obj_i,
                       xerr=obj_dr,
                       yerr=obj_di,
                       fmt='.',
                       ms=10,
                       color='b',
                       alpha=alpha)
        ax[1].errorbar(obj_a,
                       obj_i,
                       xerr=obj_da,
                       yerr=obj_di,
                       fmt='.',
                       ms=10,
                       color='b',
                       alpha=alpha)
        ax[2].errorbar(obj_a,
                       obj_e,
                       xerr=obj_da,
                       yerr=obj_de,
                       fmt='.',
                       ms=10,
                       color='b',
                       alpha=alpha)
        # ax[3].errorbar(obj_a, obj_argP,
        #                xerr=obj_dargP,
        #                yerr=obj_da,
        #                fmt='.', ms=10, color='b', alpha=alpha
        #                )

    ymin = -0.001
    imax = 50
    emax = .85
    xinner = 20
    xouter = 80
    xticker = 5
    grid_alpha = 0.2

    resonances(ax, imax, emax)

    ax[0].set_ylim([ymin, imax])
    ax[1].set_ylim([ymin, imax])
    ax[2].set_ylim([ymin, emax])
    # ax[3].set_ylim([-180, 180])
    plt.xlim([xinner, xouter])

    ax[0].set_xticks(list(range(xinner, xouter, xticker)))
    ax[1].set_xticks(list(range(xinner, xouter, xticker)))
    ax[2].set_xticks(list(range(xinner, xouter, xticker)))

    plot_fanciness.remove_border(ax[0])
    plot_fanciness.remove_border(ax[1])
    plot_fanciness.remove_border(ax[2])
    # plot_fanciness.remove_border(ax[3])

    ax[0].set_ylabel('inclination (degrees)')
    ax[0].grid(True, alpha=grid_alpha)
    ax[0].set_xlabel('heliocentric distance (AU)')
    ax[1].set_ylabel('inclination (degrees)')
    ax[1].grid(True, alpha=grid_alpha)
    ax[2].set_ylabel('eccentricity')
    ax[2].grid(True, alpha=grid_alpha)
    # ax[2].set_xlabel('semimajor axis (AU)')
    plt.xlabel('semimajor axis (AU)')
    # ax[3].grid(True, alpha=grid_alpha)
    # ax[3].set_xlabel('perihelion (AU)')
    # ax[3].set_ylabel('arg. peri. (degrees)')

    plt.draw()
    # ofile = 'OSSOS+CFEPS+NGVS_aei_argperi.pdf'
    outfile = 'OSSOS_aei_{}.pdf'.format(parameters.RELEASE_VERSION)
    plt.savefig(outfile, transparent=True, bbox_inches='tight')
Пример #3
0
def argperi_a(directory):
    # dir = '/Users/bannisterm/Dropbox/OSSOS/measure3/test_argperi_align/'
    # directory = '/Users/bannisterm/Dropbox/OSSOS/measure3/2014B-H/track/'
    tnos = parsers.ossos_discoveries(directory=directory, all_objects=True)

    fig, ax = plt.subplots(3, 1, sharex=True, figsize=(7, 8))  # a4 is 1 x sqrt(2), so use those proportions
    fig.subplots_adjust(hspace=0.25)

    for obj in tnos:
        if obj.orbit.arc_length < 60.*units.day:
            print 'Skipping', obj.name, obj.orbit.arc_length
            continue

        alpha = 0.4

        obj_r = obj.orbit.distance.value
        obj_dr = obj.orbit.distance_uncertainty.value
        obj_a = obj.orbit.a.value
        obj_da = obj.orbit.da.value
        obj_i = obj.orbit.inc.value
        obj_di = obj.orbit.dinc.value
        obj_e = obj.orbit.e.value
        obj_de = obj.orbit.de.value

        obj_peri = obj_a * (1. - obj_e)
        obj_dperi = (obj_da/obj_a) + (obj_de/obj_e)
        obj_argP = obj.orbit.om.value
        if obj_argP > 180.:
            obj_argP = obj_argP - 360.
        obj_dargP = obj.orbit.dom.value

        ax[0].errorbar(obj_r, obj_i,
                       xerr=obj_dr,
                       yerr=obj_di,
                       fmt='.', ms=10, color='b', alpha=alpha
                       )
        ax[1].errorbar(obj_a, obj_i,
                       xerr=obj_da,
                       yerr=obj_di,
                       fmt='.', ms=10, color='b', alpha=alpha
                       )
        ax[2].errorbar(obj_a, obj_e,
                       xerr=obj_da,
                       yerr=obj_de,
                       fmt='.', ms=10, color='b', alpha=alpha
                       )
        # ax[3].errorbar(obj_a, obj_argP,
        #                xerr=obj_dargP,
        #                yerr=obj_da,
        #                fmt='.', ms=10, color='b', alpha=alpha
        #                )

    ymin = -0.001
    imax = 50
    emax = .85
    xinner = 20
    xouter = 80
    xticker = 5
    grid_alpha = 0.2

    resonances(ax, imax, emax)

    ax[0].set_ylim([ymin, imax])
    ax[1].set_ylim([ymin, imax])
    ax[2].set_ylim([ymin, emax])
    # ax[3].set_ylim([-180, 180])
    plt.xlim([xinner, xouter])


    ax[0].set_xticks(range(xinner, xouter, xticker))
    ax[1].set_xticks(range(xinner, xouter, xticker))
    ax[2].set_xticks(range(xinner, xouter, xticker))

    plot_fanciness.remove_border(ax[0])
    plot_fanciness.remove_border(ax[1])
    plot_fanciness.remove_border(ax[2])
    # plot_fanciness.remove_border(ax[3])

    ax[0].set_ylabel('inclination (degrees)')
    ax[0].grid(True, alpha=grid_alpha)
    ax[0].set_xlabel('heliocentric distance (AU)')
    ax[1].set_ylabel('inclination (degrees)')
    ax[1].grid(True, alpha=grid_alpha)
    ax[2].set_ylabel('eccentricity')
    ax[2].grid(True, alpha=grid_alpha)
    # ax[2].set_xlabel('semimajor axis (AU)')
    plt.xlabel('semimajor axis (AU)')
    # ax[3].grid(True, alpha=grid_alpha)
    # ax[3].set_xlabel('perihelion (AU)')
    # ax[3].set_ylabel('arg. peri. (degrees)')

    plt.draw()
    # ofile = 'OSSOS+CFEPS+NGVS_aei_argperi.pdf'
    outfile = 'OSSOS_aei_{}.pdf'.format(parameters.RELEASE_VERSION)
    plt.savefig(outfile, transparent=True, bbox_inches='tight')