from __future__ import (absolute_import, division, print_function, unicode_literals) # Import dev version of friedrich: import sys sys.path.insert(0, '../') from friedrich.analysis import MCMCResults from friedrich.lightcurve import hat11_params_morris from glob import glob import matplotlib.pyplot as plt import numpy as np archive_paths = sorted(glob('/local/tmp/friedrich/hat11/chains???.hdf5')) #archive_paths = ['/local/tmp/friedrich/hat11/chains043.hdf5'] n_significant_spots = [] indices = [] for archive_path in archive_paths: m = MCMCResults(archive_path, hat11_params_morris()) delta_bics = m.get_spots_delta_chi2(plots=False) indices.append(m.index) n_significant_spots.append(np.count_nonzero(delta_bics > 10)) #plt.savefig('spots/{0}.png'.format(m.index)) #plt.close() indices = [int(i[6:]) for i in indices] np.savetxt('nspots.txt', np.vstack([indices, n_significant_spots]).T) plt.show()
elif any(map(lambda x: 'hyak' in x, os.uname())): mt_wilson_paths = glob('/gscratch/stf/bmmorris/Mt_Wilson_Tilt/*/sspot??.dat') archive_paths = sorted(glob('/gscratch/stf/bmmorris/hat11_flip_lambda/chains???.hdf5')) else: mt_wilson_paths = glob('/astro/store/scratch/tmp/bmmorris/friedrich/Mt_Wilson_Tilt/*/sspot??.dat') archive_paths = sorted(glob('/astro/store/scratch/tmp/bmmorris/friedrich/hat11_flip_lambda/chains???.hdf5')) dropbox_path = '/astro/users/bmmorris/Dropbox/Apps/ShareLaTeX/STSP_HAT-P-11/figures/' transit_params = hat11_params_morris_experiment() labels = "a1, mean_latitude, lnv1, lnv2, new_i_s".split(', ') transits = [] all_times = [] for archive_path in archive_paths: m = MCMCResults(archive_path, transit_params) all_times.extend(m.lc.times.jd) spots = m.get_spots() transits.append(Transit(spots)) from friedrich.orientation import times_to_occulted_lat_lon from friedrich.lightcurve import hat11_params_morris_flip_lambda all_lats = [] all_lons = [] all_amps = [] all_lats_errors = [] all_spot_times = [] all_BICs = [] for transit in transits: for spot in transit.spots:
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()
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/hat11/chains???.hdf5')) #archive_paths = ['/astro/users/bmmorris/Desktop/chains000.hdf5'] for archive_path in archive_paths: m = MCMCResults(archive_path, hat11_params_morris()) #m.max_lnp_theta_phi() m.plot_lnprob() m.plot_corner() #m.plot_star_projected() transit_number = m.index.split('chains')[1] #plt.savefig('tmp/{0:03d}.png'.format(int(transit_number))) plt.show() #plt.close() #plt.show()