예제 #1
0
def run_derive_calib(metadata, prev_suffix, curr_suffix, method = 'poly',**args):
    std_obs_list = get_primary_std_obs_list(metadata, type='flux')
    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 sensitivity function'
    best_calib = pywifes.derive_wifes_calibration(
        std_cube_list,
        calib_fn,
        extract_in_list=extract_list,method=method,
        **args)
    return
예제 #2
0
def run_derive_calib(metadata, prev_suffix, curr_suffix, method = 'poly',**args):
    std_obs_list = get_primary_std_obs_list(metadata, type='flux')
    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 sensitivity function')
    best_calib = pywifes.derive_wifes_calibration(
        std_cube_list,
        calib_fn,
        extract_in_list=extract_list,method=method,
        **args)
    return
예제 #3
0
                                      save_fn=out_fn,
                                      save_mode='ascii',
                                      **args)
    return

# Sensitivity Function fit
def run_derive_calib(metadata, prev_suffix, curr_suffix, method = 'poly',**args):
    std_obs_list = get_primary_std_obs_list(metadata, type='flux')
    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 sensitivity function')
    best_calib = pywifes.derive_wifes_calibration(
        std_cube_list,
        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(