GMOS is the Gemini Multi-Object Spectrograph. Nearly-identical versions of this instrument are mounted on both Gemini-North (in Hawaii) and Gemini-South (in Chile) and the reduction scripts and techniques that apply to one will almost without fail apply to the other. (This is true as of February 2011, but sometime in the near future the Gemini-North CCD will be replaced by a deep-depletion red-sensitive unit, similar to the one now resident within LRIS, which will likely have a different reduction tool and characteristics.) GMOS-S will continue to be reduced by the steps below in the foreseeable future.

GMOS operates in three modes: imaging, longslit spectroscopy, and multi-object spectroscopy. These are all reduced differently. Basic Gemini reduction is generally best done within Gemini's own IRAF package, although these routines can be extremely slow to run, and I (Daniel Perley) use my own IDL routine for processing longslit spectroscopy. The GMOS tool can be loaded by typing at at IRAF's command-line:

cl> gemini

ge> gmos

Of course, before running any of these routines you will need to acquire the data. Gemini has one of the best online archive tools of any major telescope, the Gemini Science Archive. Use of this is fairly self-explanatory if not necessarily well-documented; you should ask the PI of your proposal for the appropriate login and password information to use the web-based archive tool. Daniel Perley also has a simple Python script to download data en masse once the night and file numbers have been identified (just ask).


Imaging reduction is quite straightforward, particularly if the data are not fringed (filter wavelengths shorter than about 8000 Angstroms). In fact, the Gemini package has its own example script containing a walkthrough of a basic data reduction: type gmosexamples (and then imaging) to see this, although these examples are much more complicated than what you need to do as they use unnecessarily fancy steps to select the files, log all the input, organize the directories, etc.

1. Acquire calibration files

Before you can begin, however, you will need to get the appropriate flat-field for your observations. Unless they happened to take a sky flat the same night your data were acquired (in which case you can try to find it on the web archive by clicking on the Processed Calibration Files link in the search table output), this is more complicated than it ought to be. Go to “GSA Queries”, then “Search for Processed Calibrations” which should bring you to this form. You want Calibration Type = “Processed Imaging Twilight Flat” and Instrument = “GMOS-N”; you can also narrow the date range by typing in something in UT Date the format similar to “> 1 Jan 2011” or “20 Dec 2008..25 Dec 2008”. Irritatingly, to my knowledge you cannot search for or recognize the extent to which the data are binned. Find your flats (appropriate filter) and download (probably with the Java applet). Verify that these have the same binning (same pixel dimensions) as your science data by checking that the unzipped file size of the flat is about twice that of the raw data; if more or less, keep looking until you find the appropriate data. You will probably want to rename the file to be something more informative and easy to type; e.g. “rflat.fits” instead of “N20101231S0421_flat.fits.gz” You'll also need a bias file, similarly appropriately binned: go back and search for Calibration Type = “Processed Bias”.

2. Bias-subtract and flat-field

OK, with that done, you can actually reduce the data. Fire up IRAF and the Gemini package. The standard basic CCD reduction steps (bias subtraction, flatfielding, trimming) are done in a single step using gireduce. This is almost trivial: simply type something like,

gireduce @i.list bias=bias.fits flat1=iflat.fits

(The file list of all the i-band files should be in “i.list” in this example. You can also use wild-cards here rather than write to a file; particularly handy to save a step if all your data in the directory are in one filter anyway.)

Presuming your data, bias, and flats are all binned the same way and your file list is good, this should crunch away for way longer than seems necessary for such basic data processing, but eventually return a bunch of files prepended with rg. (It will also write out intermediate files prepended with just g, which you should promptly delete so you don't get them confused. Note the confusing terminology given that two of GMOS's broadband filters are r and g, which of course this prefix has nothing to do with. Sigh.)

3. Create fringe frame (i/z-band only)

What you do next depends on if the data are fringed or not. g-band and r-band are unfringed, and you can proceed right to combining and stacking. i-band and z-band are heavily fringed and require the fringe pattern to be solved for and removed before you can properly stack the data.

Fortunately this is easy. Gemini's fringe solver is gifringe. Running this is as simple as:

gifringe @rgi.list output=ifringe.fits

Where rgi.list is a file containing a list of all the processed files (prefix rg) going into this fringe frame; this should be all your i-band data. (By the way, I hope you chose a good dither pattern when requesting the observations: the default dither step in Phase II is too small to produce a good fringe frame, but that's another story…) Again, that will chug away and output a file with the name you chose in the output above.

4. Fringe-correct (i/z-band only)

Now you use that file to remove the fringing from your other files. For this you want girmfringe. This is pretty easy too:

girmfringe @rgi.list fringe=ifringe.fits

Again, things will grind away for a while but hopefully in the end it will write out some images with the fringe pattern at least mostly removed. The routine is not perfect as the Gemini fringing can be pretty bad, but hopefully the residuals aren't too terrible.

5. Mosaic CCDs together

Alright, now you're ready to start wrapping things up. If you attempted to open any of the data files so far in DS9 or IDL or Python, you probably noticed that these images have all been multi-extension FITS files; one extension per chip (there are three). Gemini can combine all frames into a single image using gmosaic. This is the easiest step yet:

gmosaic @frgi.list

Where frgi is the list of fringe-corrected files (prefix frg); if the filter is not fringe-affected you can just mosaic the flattened images directly; e.g. (which using this confusing convention you might store in a file like rgg.list).

6. Coadd exposures

Now, finally, you can stack all your exposures together to make the deep image. The procedure of choice here is imcoadd. To use it with the default options, just do:

imcoadd @mfrgi.list

(using your mosaiced image stack) and after another long processing run you should get (hopefully) a beautiful deep image of your field. You're done!

7. Final formatting tweaks and astrometry

Actually, wait, you're probably not quite done, because the astrometry of the final image is probably off by a couple arcseconds: Gemini does not attempt to make a final astrometric solution. Also, the data array is in a FITS extension and this can throw off some analysis software (such as PHOT in IRAF). So I personally then finish things up with my own scripts to convert the FITS file into a more standard format (no extension) and then solve the astrometry using a catalog. I use and for these purposes, but you can use whatever you like.

Longslit Spectroscopy

I use my own completely-custom and fully-automated IDL routine qgemspec for end-to-end reduction of bright-object longslit spectroscopy. Gemini does also have its own spectroscopy reduction routines analogous to the imaging one aboves that you can try by following the examples in gmosexamples.

Multi-Object Spectroscopy

This is the most complex mode. I have no experience with it.