def run_derive_telluric(metadata, prev_suffix, curr_suffix, **args): std_obs_list = get_primary_std_obs_list(metadata, 'telluric') std_cube_list = ['%s%s.p%s.fits' % (out_dir, fn, prev_suffix) for fn in std_obs_list] extract_list = ['%s%s.x%s.dat' % (out_dir, fn, prev_suffix) for fn in std_obs_list] print 'Deriving telluric correction' pywifes.derive_wifes_telluric(std_cube_list, tellcorr_fn, extract_in_list=extract_list, **args) return
def run_derive_telluric(metadata, prev_suffix, curr_suffix, **args): std_obs_list = get_primary_std_obs_list(metadata, 'telluric') std_cube_list = [os.path.join(out_dir, '%s.p%s.fits' % (fn, prev_suffix)) for fn in std_obs_list] extract_list = [os.path.join(out_dir, '%s.x%s.dat' % (fn, prev_suffix)) for fn in std_obs_list] print('Deriving telluric correction') pywifes.derive_wifes_telluric(std_cube_list, tellcorr_fn, extract_in_list=extract_list, **args) return
print('Flux-calibrating cube %s' % in_fn.split('/')[-1]) pywifes.calibrate_wifes_cube( in_fn, out_fn, calib_fn, mode) return #------------------------------------------------------ # Telluric - derive def run_derive_telluric(metadata, prev_suffix, curr_suffix, **args): std_obs_list = get_primary_std_obs_list(metadata, 'telluric') std_cube_list = [os.path.join(out_dir, '%s.p%s.fits' % (fn, prev_suffix)) for fn in std_obs_list] extract_list = [os.path.join(out_dir, '%s.x%s.dat' % (fn, prev_suffix)) for fn in std_obs_list] print('Deriving telluric correction') pywifes.derive_wifes_telluric(std_cube_list, tellcorr_fn, extract_in_list=extract_list, **args) return # Telluric - apply def run_telluric_corr(metadata, prev_suffix, curr_suffix, **args): # calibrate all sci and std obs sci_obs_list = get_primary_sci_obs_list(metadata) std_obs_list = get_primary_std_obs_list(metadata) for fn in sci_obs_list+std_obs_list: in_fn = os.path.join(out_dir, '%s.p%s.fits' % (fn, prev_suffix)) out_fn = os.path.join(out_dir, '%s.p%s.fits' % (fn, curr_suffix)) print('Correcting telluric in %s' % in_fn.split('/')[-1]) pywifes.apply_wifes_telluric( in_fn, out_fn, tellcorr_fn) return