Beispiel #1
0
def run_flux_calib(metadata, prev_suffix, curr_suffix, mode='pywifes', **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 = '%s%s.p%s.fits' % (out_dir, fn, prev_suffix)
        out_fn = '%s%s.p%s.fits' % (out_dir, fn, curr_suffix)
        print 'Flux-calibrating cube %s' % in_fn.split('/')[-1]
        pywifes.calibrate_wifes_cube(in_fn, out_fn, calib_fn, mode)
    return
Beispiel #2
0
def run_flux_calib(metadata, prev_suffix, curr_suffix,
                   mode='pywifes', **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  = '%s%s.p%s.fits' % (out_dir, fn, prev_suffix)
        out_fn = '%s%s.p%s.fits' % (out_dir, fn, curr_suffix)
        print 'Flux-calibrating cube %s' % in_fn.split('/')[-1]
        pywifes.calibrate_wifes_cube(
            in_fn, out_fn, calib_fn, mode)
    return
Beispiel #3
0
        calib_fn,
        extract_in_list=extract_list,method=method,
        **args)
    return

# Applying Calibration
def run_flux_calib(metadata, prev_suffix, curr_suffix,
                   mode='pywifes', **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('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)