def calibrate_raw_science(): # Create the list of raw science frames: n_first = 407201 n_last = 407475 framen = range(n_first, n_last + 1) nframes = len(framen) ddir_science = os.path.join(ddir, 'object') raw_science_frames = [] for i in range(nframes): raw_science_frames += [ '0000{0:.0f}-20130728-OSIRIS-OsirisLongSlitSpectroscopy.fits'. format(framen[i]) ] raw_science_list_filename = 'raw_science.lst' raw_science_list_filepath = os.path.join(adir, raw_science_list_filename) np.savetxt(raw_science_list_filepath, np.array(raw_science_frames, dtype=str), fmt='%s') # Call the calibration routine: bias_dir = os.path.join(ddir, 'bias') mbias_filepath = os.path.join(bias_dir, 'mbias.fits') mflat_filepath = None reduction.calibrate_raw_science( n_exts=N_EXTS, raw_ddir=ddir_science, cal_ddir=ddir_science, \ mbias_filepath=mbias_filepath, mflat_filepath=None, \ raw_science_list_filepath=raw_science_list_filepath ) return None
def calibrate_raw_science( night='' ): adir_full = os.path.join( ADIR, night ) raw_ddir_full = os.path.join( RAW_DDIR, '{0}/raw'.format( night ) ) cal_ddir_full = os.path.join( CAL_DDIR, night ) ddir_dark = os.path.join( cal_ddir_full, 'dark' ) # Create the list of raw science frames: if night=='20130517': framen = range( 1906913, 1907342+1 ) elif night=='20130216': pdb.set_trace() #todo elif night=='20130701': pdb.set_trace() #todo nframes = len( framen ) raw_science_frames = [] for i in range( nframes ): raw_science_frames += [ 'r{0:.0f}.fit'.format( framen[i] ) ] raw_science_list_filename = 'raw_science.lst' raw_science_list_filepath = os.path.join( adir_full, raw_science_list_filename ) np.savetxt( raw_science_list_filepath, np.array( raw_science_frames, dtype=str ), fmt='%s' ) # Call the calibration routine: mdark_filepath = os.path.join( ddir_dark, 'mdark.fit' ) mflat_filepath = None reduction.calibrate_raw_science( n_exts=N_EXTS, raw_ddir=raw_ddir_full, cal_ddir=cal_ddir_full, \ mbias_filepath=mdark_filepath, mflat_filepath=mflat_filepath, \ raw_science_list_filepath=raw_science_list_filepath ) return None
def calibrate_raw_science(night=''): adir_full = os.path.join(ADIR, night) raw_ddir_full = os.path.join(RAW_DDIR, '{0}/raw'.format(night)) cal_ddir_full = os.path.join(CAL_DDIR, night) ddir_dark = os.path.join(cal_ddir_full, 'dark') # Create the list of raw science frames: if night == '20130517': framen = range(1906913, 1907342 + 1) elif night == '20130216': pdb.set_trace() #todo elif night == '20130701': pdb.set_trace() #todo nframes = len(framen) raw_science_frames = [] for i in range(nframes): raw_science_frames += ['r{0:.0f}.fit'.format(framen[i])] raw_science_list_filename = 'raw_science.lst' raw_science_list_filepath = os.path.join(adir_full, raw_science_list_filename) np.savetxt(raw_science_list_filepath, np.array(raw_science_frames, dtype=str), fmt='%s') # Call the calibration routine: mdark_filepath = os.path.join(ddir_dark, 'mdark.fit') mflat_filepath = None reduction.calibrate_raw_science( n_exts=N_EXTS, raw_ddir=raw_ddir_full, cal_ddir=cal_ddir_full, \ mbias_filepath=mdark_filepath, mflat_filepath=mflat_filepath, \ raw_science_list_filepath=raw_science_list_filepath ) return None
def calibrate_raw_science(): # Create the list of raw science frames: n_first = 332896 n_last = 333614 framen = range( n_first, n_last+1 ) nframes = len( framen ) ddir_science = os.path.join( ddir, 'object' ) raw_science_frames = [] for i in range( nframes ): raw_science_frames += [ '0000{0:.0f}-20130520-OSIRIS-OsirisLongSlitSpectroscopy.fits'.format( framen[i] ) ] raw_science_list_filename = 'raw_science.lst' raw_science_list_filepath = os.path.join( adir, raw_science_list_filename ) np.savetxt( raw_science_list_filepath, np.array( raw_science_frames, dtype=str ), fmt='%s' ) # Call the calibration routine: bias_dir = os.path.join( ddir, 'bias' ) mbias_filepath = os.path.join( bias_dir, 'mbias.fits' ) mflat_filepath = None reduction.calibrate_raw_science( n_exts=N_EXTS, raw_ddir=ddir_science, cal_ddir=ddir_science, \ mbias_filepath=mbias_filepath, mflat_filepath=None, \ raw_science_list_filepath=raw_science_list_filepath ) return None