Exemplo n.º 1
0
def run_flat_response(metadata, prev_suffix, curr_suffix, mode='all'):
    # now fit the desired style of response function
    print 'Generating flatfield response function'
    if mode == 'all':
        pywifes.wifes_2dim_response(super_dflat_mef,
                                    super_tflat_mef,
                                    flat_resp_fn,
                                    wsol_fn=wsol_out_fn)
    elif mode == 'dome':
        pywifes.wifes_response_poly(super_dflat_mef,
                                    flat_resp_fn,
                                    wsol_fn=wsol_out_fn)
    else:
        raise ValueError, 'Requested response mode not recognized'
    return
Exemplo n.º 2
0
def run_flat_response(metadata, prev_suffix, curr_suffix,
                      mode='all'):
    # now fit the desired style of response function
    print 'Generating flatfield response function'
    if mode == 'all':
        pywifes.wifes_2dim_response(super_dflat_mef,
                                    super_tflat_mef,
                                    flat_resp_fn,
                                    wsol_fn=wsol_out_fn)
    elif mode == 'dome':
        pywifes.wifes_response_poly(super_dflat_mef,
                                    flat_resp_fn,
                                    wsol_fn=wsol_out_fn)
    else:
        raise ValueError, 'Requested response mode not recognized'
    return
Exemplo n.º 3
0
    return

#------------------------------------------------------
# Flatfield Response
def run_flat_response(metadata, prev_suffix, curr_suffix,
                      mode='all'):
    # now fit the desired style of response function
    print('Generating flatfield response function')
    if mode == 'all':
        pywifes.wifes_2dim_response(super_dflat_mef,
                                    super_tflat_mef,
                                    flat_resp_fn,
                                    wsol_fn=wsol_out_fn)
    elif mode == 'dome':
        pywifes.wifes_response_poly(super_dflat_mef,
                                    flat_resp_fn,
                                    wsol_fn=wsol_out_fn)
    else:
        raise ValueError('Requested response mode not recognized')
    return

#------------------------------------------------------
# Flatfield Division
def run_flatfield(metadata, prev_suffix, curr_suffix):
    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))
        if skip_done and os.path.isfile(out_fn):
            continue