def run_overscan_sub(metadata, prev_suffix, curr_suffix): full_obs_list = get_full_obs_list(metadata) # this is the only time I hard code that this step should happen first for fn in full_obs_list: in_fn = '%s%s.fits' % (data_dir, fn) out_fn = '%s%s.p%s.fits' % (out_dir, fn, curr_suffix) if skip_done and os.path.isfile(out_fn): continue print 'Subtracting Overscan for %s' % in_fn.split('/')[-1] pywifes.subtract_overscan(in_fn, out_fn, data_hdu=my_data_hdu) return
def run_overscan_sub(metadata, prev_suffix, curr_suffix): full_obs_list = get_full_obs_list(metadata) # this is the only time I hard code that this step should happen first for fn in full_obs_list: in_fn = '%s%s.fits' % (data_dir, fn) out_fn = '%s%s.p%s.fits' % (out_dir, fn, curr_suffix) if skip_done and os.path.isfile(out_fn): continue print 'Subtracting Overscan for %s' % in_fn.split('/')[-1] pywifes.subtract_overscan(in_fn, out_fn, data_hdu=my_data_hdu) return
def run_overscan_sub(metadata, prev_suffix, curr_suffix): full_obs_list = get_full_obs_list(metadata) # this is the only time I hard code that this step should happen first for fn in full_obs_list: # Check if we have the right folder (calibrations might be somewhere else) change_dir = check_if_obsdates_of_data_dir_and_filename_are_the_same(data_dir, fn) if change_dir: in_fn = os.path.join(change_dir, '%s.fits' %fn) else: in_fn = os.path.join(data_dir, '%s.fits' %fn) 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('Subtracting Overscan for %s' % in_fn.split('/')[-1]) pywifes.subtract_overscan(in_fn, out_fn, data_hdu=my_data_hdu) return
#------------------------------------------------------------------------ #------------------------------------------------------------------------ # DEFINE THE PROCESSING STEPS #------------------------------------------------------ # Subtract overscan def run_overscan_sub(metadata, prev_suffix, curr_suffix): full_obs_list = get_full_obs_list(metadata) # this is the only time I hard code that this step should happen first for fn in full_obs_list: in_fn = os.path.join(data_dir, '%s.fits'%fn) 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('Subtracting Overscan for %s' % in_fn.split('/')[-1]) pywifes.subtract_overscan(in_fn, out_fn, data_hdu=my_data_hdu) return #------------------------------------------------------ # repair bad pixels! def run_bpm_repair(metadata, prev_suffix, curr_suffix): full_obs_list = get_full_obs_list(metadata) for fn in full_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('Repairing blue bad pixels for %s' % in_fn.split('/')[-1]) pywifes.repair_blue_bad_pix(in_fn, out_fn, data_hdu=my_data_hdu) return