Skip to content

Commit

Permalink
fixing some keyword names
Browse files Browse the repository at this point in the history
  • Loading branch information
megbedell committed Jan 18, 2019
1 parent b960d21 commit 1082c38
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
16 changes: 13 additions & 3 deletions scripts/make_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ def write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, air

if __name__ == "__main__":

if True: #51 Peg
if False: #51 Peg
ccf_filelist = glob.glob('/Users/mbedell/python/wobble/data/51peg/HARPS*ccf_G2_A.fits')
data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts = read_data_from_fits(ccf_filelist)
hdffile = '../data/51peg_e2ds.hdf5'
write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts, ccf_filelist, hdffile)

if True: #Barnard's Star
if False: #Barnard's Star
ccf_filelist = glob.glob('/Users/mbedell/python/wobble/data/barnards/HARPS*ccf_M2_A.fits')

if False: # check for missing wavelength files
Expand All @@ -140,7 +140,7 @@ def write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, air
hdffile = '../data/barnards_e2ds.hdf5'
write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts, ccf_filelist, hdffile)

if True: # HD189733
if False: # HD189733
ccf_filelist = glob.glob('/Users/mbedell/python/wobble/data/HD189733/HARPS*ccf_*_A.fits')
if False: # check for missing wavelength files
missing_files = missing_wavelength_files(ccf_filelist)
Expand All @@ -159,3 +159,13 @@ def write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, air
data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts = read_data_from_fits(e2ds_filelist, e2ds=True)
hdffile = '../data/telluric_e2ds.hdf5'
write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts, e2ds_filelist, hdffile)

if True: # beta hyi
ccf_filelist = glob.glob('/mnt/ceph/users/mbedell/wobble/betahyi/HARPS*ccf_*_A.fits')
if True: # check for missing wavelength files
missing_files = missing_wavelength_files(ccf_filelist)
np.savetxt('missing_files.txt', missing_files, fmt='%s')
print('{0} missing wavelength files'.format(len(missing_files)))
data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts = read_data_from_fits(ccf_filelist)
hdffile = '/mnt/ceph/users/mbedell/wobble/betahyi_e2ds.hdf5'
write_data(data, ivars, xs, pipeline_rvs, pipeline_sigmas, dates, bervs, airms, drifts, ccf_filelist, hdffile)
4 changes: 2 additions & 2 deletions scripts/regularization.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def improve_order_regularization(r, o, star_filename, tellurics_filename,
else:
training_model.add_telluric('tellurics', rvs_fixed=True, variable_bases=K_t)
training_model.setup()
training_model.optimize(niter=0, verbose=verbose, uncertainties=False)
training_model.optimize(niter=0, verbose=verbose, rv_uncertainties=False)

if plot:
n = 0 # epoch to plot
Expand Down Expand Up @@ -206,7 +206,7 @@ def test_regularization_value(par, val, training_model, validation_model, regula
session = wobble.utils.get_session()
session.run(tf.global_variables_initializer()) # reset both models

training_model.optimize(niter=training_niter, feed_dict=regularization_dict, verbose=verbose, uncertainties=False)
training_model.optimize(niter=training_niter, feed_dict=regularization_dict, verbose=verbose, rv_uncertainties=False)
validation_dict = {**regularization_dict}
for c in validation_model.components:
validation_dict[getattr(c, 'template_xs')] = getattr(training_model.results,
Expand Down
2 changes: 1 addition & 1 deletion scripts/script_51peg.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
if plots:
wobble.optimize_order(model, niter=niter, save_history=True,
basename=plot_dir+'history', movies=movies,
rv_uncertainties=True)
epochs_to_plot=epochs, rv_uncertainties=True)
fig, ax = plt.subplots(1, 1, figsize=(8,5))
ax.plot(data.dates, results.star_rvs[r] + data.bervs - np.mean(results.star_rvs[r] + data.bervs),
'k.', alpha=0.8)
Expand Down
2 changes: 1 addition & 1 deletion scripts/script_HD189733.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
print("--- ORDER {0} ---".format(o))
if plots:
wobble.optimize_order(model, niter=niter, save_history=True,
basename=plot_dir+'history', movies=movies)
basename=plot_dir+'history', epochs_to_plot=epochs, movies=movies)
fig, ax = plt.subplots(1, 1, figsize=(8,5))
ax.plot(data.dates, results.star_rvs[r] + data.bervs - np.mean(results.star_rvs[r] + data.bervs),
'k.', alpha=0.8)
Expand Down
2 changes: 1 addition & 1 deletion scripts/script_barnards.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
print("--- ORDER {0} ---".format(o))
if plots:
wobble.optimize_order(model, niter=niter, save_history=True,
basename=plot_dir+'history', movies=movies)
basename=plot_dir+'history', movies=movies, epochs_to_plot=epochs)
fig, ax = plt.subplots(1, 1, figsize=(8,5))
ax.plot(data.dates, results.star_rvs[r] + data.bervs - np.mean(results.star_rvs[r] + data.bervs),
'k.', alpha=0.8)
Expand Down
2 changes: 1 addition & 1 deletion wobble/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def plot_synth(self, e, nframes=None, ylims=None, ylims2=None, **kwargs):
return ani


def save_plots(self, basename, epochs=[0,50], movies=True):
def save_plots(self, basename, epochs_to_plot=[0,50], movies=True):
plt.scatter(np.arange(len(self.nll_history)), self.nll_history)
ax = plt.gca()
ax.set_yscale('log')
Expand Down

0 comments on commit 1082c38

Please sign in to comment.