Esempio n. 1
0
import matplotlib.pyplot as plt

#archive_path = ('/gscratch/stf/bmmorris/friedrich/chains{0:03d}.hdf5'
#                .format(int(sys.argv[1])))
# archive_path = ('/media/PASSPORT/friedrich/chains{0:03d}.hdf5'
#                 .format(int(sys.argv[1])))
#
# m = MCMCResults(archive_path)
# # m.plot_corner()
# # m.plot_lnprob()
# # m.plot_max_lnp_lc(hat11_params_morris())
# # m.plot_lat_lon()
# # m.plot_star()
# m.plot_star_projected()
# plt.savefig('tmp/{0:03d}.png'.format(int(sys.argv[1])))
# #plt.show()

archive_paths = sorted(glob('/local/tmp/friedrich/k17/chains???.hdf5'))
#archive_paths = ['chains017.hdf5']
for archive_path in archive_paths:
    m = MCMCResults(archive_path, k17_params_morris())
    m.plot_star_projected()
    #m.plot_corner()
    #m.plot_lnprob()
    # m.plot_max_lnp_lc()
    transit_number = m.index.split('chains')[1]
    plt.savefig('tmp/{0:03d}.png'.format(int(transit_number)))
    # plt.show()
    plt.close()
#plt.show()
Esempio n. 2
0
    # on laptop:
    light_curve_paths = glob('/Users/bmmorris/data/kepler17/*slc.fits')
    output_dir = os.path.abspath('/Users/bmmorris/data')
elif os.path.exists('/usr/lusers/bmmorris/data/kepler17/'):
    # on Hyak
    light_curve_paths = glob('/usr/lusers/bmmorris/data/kepler17/*slc.fits')
    output_dir = os.path.abspath('/gscratch/stf/bmmorris/friedrich/k17')
elif os.path.exists('/local/tmp/kepler17'):
    # on mist
    light_curve_paths = glob('/local/tmp/kepler17/*slc.fits')
    output_dir = os.path.abspath('./')

else:
    raise ValueError('No input files found.')

transit_params = k17_params_morris()
depth = transit_params.rp**2

# Construct light curve object from the raw data
whole_lc = LightCurve.from_raw_fits(light_curve_paths, name='K17')
transits = LightCurve(**whole_lc.mask_out_of_transit(transit_params,
                                                     oot_duration_fraction=0.5)
                      ).get_transit_light_curves(transit_params)
transits = [transit for transit in transits if len(transit.fluxes) > 225]
# Compute maxes for each quarter
available_quarters = whole_lc.get_available_quarters()
quarters = [whole_lc.get_quarter(q) for q in whole_lc.get_available_quarters()]

quarterly_maxes = {}
set_upper_limit = 3e4 
for i, quarter_number, lc in zip(range(len(available_quarters)),