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 = '%s%s.p%s.fits' % (out_dir, fn, prev_suffix) out_fn = '%s%s.p%s.fits' % (out_dir, fn, curr_suffix) print 'Flat-fielding image %s' % in_fn.split('/')[-1] pywifes.imarith_mef(in_fn, '/', flat_resp_fn, out_fn) return
def run_flatfield(metadata, prev_suffix, curr_suffix): sci_obs_list = get_primary_sci_obs_list(metadata) #~ sci_obs_list = get_sci_obs_list(metadata) # MZ: TESTING. Something still wrong here. Use this line if coadd=False 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('Flat-fielding image %s' % in_fn.split('/')[-1]) pywifes.imarith_mef(in_fn, '/', flat_resp_fn, out_fn) return
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 = '%s%s.p%s.fits' % (out_dir, fn, prev_suffix) out_fn = '%s%s.p%s.fits' % (out_dir, fn, curr_suffix) print 'Flat-fielding image %s' % in_fn.split('/')[-1] pywifes.imarith_mef(in_fn, '/', flat_resp_fn, out_fn) return
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 print('Flat-fielding image %s' % in_fn.split('/')[-1]) pywifes.imarith_mef(in_fn, '/', flat_resp_fn, out_fn) return
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 print('Flat-fielding image %s' % in_fn.split('/')[-1]) pywifes.imarith_mef(in_fn, '/', flat_resp_fn, out_fn) return #------------------------------------------------------ # Data Cube Generation def run_cube_gen(metadata, prev_suffix, curr_suffix, **args): # now generate cubes 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 print('Generating Data Cube for %s' % in_fn.split('/')[-1])