t3refroot = 'ff260' t3refcat = '%s.cat' % t3refroot t3ccdbfile = 'ccmap_%s_as_ref.txt' % t3refroot """ Do the nonlinearity correction and Create the sky file as the first pass """ if redpass == 'make_sky': niri.calib_1(sci_frames, rawroot, outroot, bpmfile, rawdir) """ Do the final calibration and make the SExtractor catalogs """ if redpass == 'final_calib': print "" skyfile = '%s_sky.fits' % outroot niri.reduce_sci(sci_frames, outroot, skyfile, flatfile) ##niri.niri_coadd(outroot) # Don't use this any more if skybpm is not None: niri.niri_bpm_from_sky(sci_frames, skybpm) """ Make the SExtractor catalogs """ if redpass == 'make_cats': ff_files = [] for i in sci_frames: ff_files.append('ff%d.fits' % i) niri.niri_sextractor(ff_files, tilebpm, fixpix=True, catformat='ascii') """ Do the tile-based pass of the astrometry. """ if redpass == 'astrom_tile': if tile == "Tiles2and3": swarplist = '%s_swarp.in' % t2root #niri.ccmap_tile(t2_frames,t2refcat,t2ccdbfile,tilebpm,swarplist) swarpfile = '@%s' % swarplist
""" Do the nonlinearity correction and create the sky file as the first pass """ if redpass=='calib_1': niri.calib_1(sci_frames,rawroot,outroot,bpmfile,rawdir) """ Calibrate the science frames """ if redpass=='calib_2': print "" skyfile = '%s_sky.fits' % outroot niri.reduce_sci(sci_frames,outroot,skyfile,flatfile) """ Make the bad pixel mask from the calibrated science frames """ if redpass=='calib_3': if skybpm is not None: niri.niri_bpm_from_sky(sci_frames,skybpm,outsky='sky_from_ff.fits') else: print "" print "*** No bad pixel mask requested for this set of input files ***" print "" """ Prepare the files for running SExtractor The input files will be called ff*fits The output files will be called fp*fits """ if redpass=='calib_4': niri.split_and_fix_ff(sci_frames,badpixfile=tilebpm,fixpix=True) """ For these Ks-band images, there needs to be a second sky flat correction
for i in sci_frames: fullnames.append('%s_%d' % (obsdate,i)) """ Do the nonlinearity correction and Create the sky file as the first pass """ if redpass=='make_sky': niri.calib_1(sci_frames,rawroot,outroot,bpmfile,rawdir,obsdate) """ Do the final calibration and make the SExtractor catalogs """ if redpass=='final_calib': print "" skyfile = '%s_sky.fits' % outroot niri.reduce_sci(fullnames,outroot,skyfile,flatfile) if skybpm is not None: niri.niri_bpm_from_sky(fullnames,skybpm) """ Make the SExtractor catalogs """ if redpass=='make_cats': ff_files = [] for i in fullnames: ff_files.append('ff%s.fits' % i) niri.niri_sextractor(ff_files,tilebpm,fixpix=True,catformat='ascii') """ Redo the astrometry of all the individual input files onto the full grid now that we have created it, and then do the final coadd. """ if redpass == 'final_coadd': """ Set up """