# Copyright(c) 2002-2009 Association of Universities for Research in Astronomy, Inc. # # GMOS example reductions script: Typical reduction of MOS data # # This data processing was done to aid the data quality assessment performed # by the Gemini staff. The data processing is not designed to give the best # possible result. Better signal-to-noise and better cleaning for cosmic-ray # hits and bad pixels will most likely be possible. The user of these data # is encouraged to use the provided co-added images only as guide lines and # to re-reduce the data to obtain the best possible reduction. # # Gemini GMOS data reduction script # Observation UT date: 2001dec22 # Data processor: Inger Jorgensen # Data reduction date: 2002feb25 # # Brief data description: MOS observations from the queue program GN-2001B-Q-10 # # Update: Illustrate the use of the automatic slit edge finding feature (v1.7) # Define various directories containing raw data and calibration data set raw=/net/sabrina/staging2/gmos/2001dec22/ set gcalib=../../2001dec25/Basecalib/ # set up the logfile for this reduction gmos.logfile="GN-2001B-Q-10_log5.txt" # The bias image has been made with gbias and has been overscan # subtracted and trimmed # Make the flat field # To let GSCUT find the edges automatically, fl_usegrad is set to yes. # Then, since we will later let GSCUT find the slit edges automatically, # we need to keep the 'combflat' image. gsflat N20011221S139,N20011221S142,N20011221S143 rgN20011221S139_flat.fits \ order=29 rawpath=raw$ bias=gcalib$N20011217S153_bias.fits \ mdfdir=/usr/dataproc/gmos/GN-2001B-distrib/GN-2001B-Q-10/ \ fl_usegrad+ combflat=rgN20011221S139_comb.fits fl_keep+ fl_over+ # In this wavelength range the flats contain a pair of emission lines # (due to a yet unidentified emission line source in the ISS) # Set the pixels in those lines to one to avoid introducing spurious # features imreplace rgN20011221S139_flat.fits[sci,1][1430:3890,*] 1 low=1.02 upper=INDEF # Reduce the science observations, the name of the output image is # defined by the default value outpref="gs" # Steps in gsreduce # subtract off the bias # clean for cosmic ray hits # mosaic the 3 detectors # interpolate accross the chip gaps to aid later reduction steps # flat field correction # cut the images into slitlets # run gsappwave to get an approximate wavelength calibration in the # header of the output image # Set the instrumental resolution for gscrrej which is called from gsreduce gscrrej.datares=7. # Update the _comb frame created by GSFLAT above with the location of # the slit edges. gscut rgN20011221S139_comb.fits fl_update+ gradimage=rgN20011221S139_comb # Reduce the spectra # 'refimage' contains information on the slit locations that was just found # by GSCUT. gsreduce N20011221S140,N20011221S141 rawpath=raw$ \ bias=gcalib$N20011217S153_bias.fits flat=rgN20011221S139_flat.fits \ mdfdir=/usr/dataproc/gmos/GN-2001B-distrib/GN-2001B-Q-10/ fl_gscrrej+ \ refimage=rgN20011221S139_comb.fits fl_over+ # Reduce the CuAr spectrum. The CuAr is not flat fielded. gsreduce N20011221S016 rawpath=raw$ \ fl_flat- fl_dark- bias=gcalib$N20011217S153_bias.fits \ mdfdir=/usr/dataproc/gmos/GN-2001B-distrib/GN-2001B-Q-10/ \ refimage=rgN20011221S139_comb.fits fl_over+ # Establish the wavelength calibration # This step requires a bit of interactions since the automatic line # id fails in about 20% of the cases, with this version of gswavelength # Improvements are planned for future releases of gswavelength # For MOS data, the step parameter must be set equal to 2 so that the # distortion in the spatial direction can be properly determined gswavelength gsN20011221S016.fits coordlist="linelists$cuar.dat" \ fwidth=13 cradius=13 minsep=5 aiddebug=s order=4 match=-10 \ fitcxord=4 fitcyord=4 step=2 # Transform the CuAr spectrum, for checking that the transformation is ok # Output image name is defined by the default value outpref="t" gstransform gsN20011221S016 wavtran=gsN20011221S016 # Inspect the transformed arc by using imexamine on each of the SCI # extensions for(i=1;i<=37;i+=1) { imexa("tgsN20011221S016[SCI,"//str(i)//"]") } # Transform the science exposures gstransform gsN20011221S140,gsN20011221S141 wavtran=gsN20011221S016 # Skysubtract the science exposures. Output image names are defined by the # default value outpref="s" gsskysub tgsN20011221S140,tgsN20011221S141 mos_sample=0.8 fl_inter+ # Inspect the sky subtracted spectra by imexamine on each of the SCI # extensions for(i=1;i<=37;i+=1) { imexa("stgsN20011221S140[SCI,"//str(i)//"]") } for(i=1;i<=37;i+=1) { imexa("stgsN20011221S141[SCI,"//str(i)//"]") # Test gsextract works, adjust the paramegers tsum and tstep to make # it possible to trace faint objects # Run the task interactively to make sure all the faint objects are # traced correctly gsextract stgsN20011221S141 tnsum=100 tstep=100 fl_inter+ # GEXTRACT may be repeated for the other image stgsN20011221S140 # Inspect the extracted spectra for(i=1;i<=37;i+=1) { splot("estgsN20011221S141[SCI,"//str(i)//"]") } # Flux calibrate 1D spectra, this only works correctly if the # sensitivity function covers the full wavelength range spanned # but the different slitlets in the MOS observation. This is not # normally the case. gscalibrate estgsN20011221S141 sfunction=../Basecalib_spec_old/sens # Inspect the flux calibrated spectra for(i=1;i<=37;i+=1) { splot("cestgsN20011221S141[SCI,"//str(i)//"]") }