GMOS Long-slit Reductions: It's an ADVENTURE!
Some resources:
- The Cookbook.
- In IRAF/gemini/gmos do a "gmosexample longslit"
- But best: The turorials (which is what this is basically modeled on).
Installation
- Install the special-doesn't-work-with-normal-IRAF-gemini software:
- Go to https://www.anaconda.com/download/#macos and download the installer for Python 3. Run the installer.
- Open a terminal window and do a "bash -l".
- which conda should return something
- conda config --add channels conda-forge
- conda config --add channels http://astroconda.gemini.edu/public
- conda create -n geminiconda python=3.7.9 iraf-all pyraf-all ds9
- cd
- mkdir gemiraf
- conda activate geminiconda
- cd gemiraf
- mkiraf
- cl should invoke iraf; pyraf should invoke PyRAF, and python starts singing I'm a Lumberjack.
- To update:
- conda activate geminiconda
- conda install iraf.gemini=1.15 --no-update-deps
- Subsequent times:
- Starting up IRAF
- Open an xgterm window
- bash -l
- conda activate geminiconda
- which cl
- cd wherever you created the login.cl and uparm
- cl
- gemini, gmos
- When done, conda deactivate
Reducing long-slit data
- Download the data. Put all of the cals and science bais frames in a subdirectory called "Raw"
- Make an observing log. The difficulty is that some header words are in [0] and others are in [1]. This gets around this. Here's a handy script:
makelogs.cl. It creates obsLog.txt and (unlike the manual) retains the keywords.
I found it handy to then write down in a notebook what the pertinent frames were.
- Making lists--although you may not need to so skip this section for now.
- The major issue is that because of all the MEF stuff it's hard to just
make a list of file names. You could, of course, use ls *.fits > mylist
and edit it using the log, but the following is a little easier:
- If you're dealing with a situation with only a few frames, you can
easily deal with them as below and then do some editing.
- files S*%.fits%% > arcs.txt
- copy arcs.txt flats.txt
- copy arcs.txt science.txt
- You can also just do something like:
- gemlist "S20150503S" "275-278,280 > bias.txt
Everything all at once
- Why, yes, there is a script for doing everything
Here's how it works:
- set rawdir="Raw/"
- Make master bias frame: gbias @bias22.txt Zero22 rawpath=rawdir$ fl_over+ fl_trim+ fl_inter-
- If you have only a few frames, do things the easy way:
- !echo S20210209S0047.fits > science
- !echo S20210209S0048.fits > flat
- !echoo S20210209S0049.fits > arc
- Do the basic processing (overscan, trim, and bias subtraction). Note that
some of the unnecessary flags (like fl_cut-) actually are needed because,
well, bugs I guess.
- #Flat
- gsreduce @flat rawpath="rawdir$" fl_flat- fl_gmosaic- \
- fl_cut- fl_gsappwave- bias="Zero22.fits"
- #Science
- gsreduce @science rawpath="rawdir$" fl_flat- fl_gmosaic- \
- fl_cut- fl_gsappwave- bias="Zero22.fits"
- #Arc. Mosaic it.
- gsreduce @arc rawpath="rawdir$" fl_flat- fl_gmosaic+ fl_fixpix- \
- fl_gsappwave- fl_over+ bias="Zero22.fits"
- Do the wavelength solution on the mosaic'd arc:
- gswavelength gs//@arc fl_inte+ fl_addf-
- gstransform gs//@arc wavtran=gs//@arc
- implot the resulting "t" frame and make sure everyting is nicely lined up.
- Do the QE corrections for the flat and the science exposures. These
aren't mosaic'd yet (makes sense!)
- #QE the science exposure:
gqe gs//@science ref=gs//@arc
- #QE the flat:
gqe gs//@flat ref=gs//@arc
- Make the flat-field:
- gmosaic qgs//@flat fl_fixpix+
- gsflat mqgs//@flat FlatN.fits order=23 fl_over+
- Reduce the science exposure, mosaic'ing it in the process: gsreduce qgs//@science flat="FlatN" fl_over- fl_bias- fl_trim-
- Apply the wavelength calibration. Note the extra "gs" at the start that got added abover:gstransform gsqgs//@science wavtran=gs//@arc
- Extract the spectrum and enjoy:
- gsskysub tgsqgs//@science
- gsextract stgsqgs//@science fl_inte+ clean+
- imcopy e*.fits[sci] CD.fits
- splot CD.fits