Knut's Hydra Notes


Everyone has their own programs to generate the Hydra assignment files with the right formats. I use some IDL programs that I have written:

  • Given vectors containing object names, RA, DEC, and fiber type, HYDCOO produces a coordinate file suitable for feeding to hydraassign. Type hydcoo at the IDL prompt to get the full list of options. Example usage:

    IDL>hydcoo,name,ra,dec,replicate('O',n_elements(ra)),epoch=2000.0,fname='FIELD 1',fileout='field1.coo'

  • Takes a file containing Tycho stars (using the ESO Astrometric Catalogues Server, remember to save the output in text, not source, format) and converts them to FOPS stars with the right format. Calls,, and (optionally) Example usage:


I then merge the HYDCOO and TYCHO2HYD outputs into a single coordinate file for feeding into hydraassign.

Download tar file of IDL programs



How useful are all those flats? Here's what I've been doing:

  • Sky flats. I use these for the fiber-to-fiber throughput measurement. For my program I had to sit on a single configuration per night, so I took the sky flats with the object configuration for that night. If you have many configurations, it's best to do it in a largecircle and either hope the throughput doesn't change too much as you move the fibers around, or (preferably) take dark sky frames.
  • Dome flats. I use these for the flat field correction.
  • Projector flats. Once per configuration for tracing the apertures.
  • Milk flats. These serve both as two-dimensional flat fields and for making bad pixel masks.

Comparisons: I like to have a comparison adjacent to every object exposure, so that the observing sequence goes like this: comparison-object-object-comparison-object...



Preliminary steps:

  1. Removing cosmic rays from the images will make life much easier later on. I've found Pieter van Dokkum's Laplacian edge-detection routine works pretty well on single images.
  2. After overscan subtraction, trimming, and zero subtraction fit a surface to the milk flat, using a routine such as imsurfit in IRAF. Then divide the milk flat into the data.

Extractions with dohydra:

  1. Load up the imred.hydra package, type "epar hydra", and make sure dispaxis is set to 1, assuming you used the 400mm camera.
  2. Type "params" and check the parameters carefully. Many parameters for later tasks are kept hidden in this parameter file. In particular, if you used the penray comparison source, then download hydhenear.dat and set "coordli" to point to it.
  3. For dohydra to function properly, you must be careful to align the aperture numbers with the slit numbers found in the header. It's thus useful to have a list of the slit numbers and their location on the chip, measured from a flat field taken with the largecircle configuration. Here's a list from November 2009; the columns are slit number, chip x coordinate, relative peak throughput, and fiber number. You will likely find that the absolute x coordinates are different, but the spacing will not be.
  4. For each object, pick the arc lamp image(s), flat field, aperture reference image, and throughput image you want to use. Count how many fibers were assigned. Then run dohydra, e.g.:

    dohydra obj029c apref=pflat028 flat=dflat016 throughput=sflat020 arcs1=comp030 readnoise=3. gain=0.84 datamax=65000. fibers=107 width=12. minsep=6. maxsep=14.1 crval=4950. cdelt=-1.2 objbeam=0,1 skybeam=0 scatter- fitflat+ clean- dispc+ savearc- skysub+ skyedit+ savesky- splot+

    dohydra will take you through aperture identification (check it carefully!), aperture tracing, fitting of the flat field spectrum, arc lamp identification and dispersion correction, and sky subtraction. Sky subtraction can be tricky; if your spectrum is heavily contaminated by night sky emission lines, you may have to be more creative than dohydra allows. As a result, the above recipe works fairly well in the blue, but may fail in the red.

  5. You will probably want to combine spectra from many exposures. You likely can not do a straight combination of the extracted spectra, because differential refraction has undoubtedly altered the flux distributions between exposures. Instead, either fit out the continuum or match the individual spectra of each object to a single continuum before combining.


KAO 17 Aug 2002

Updated on June 14, 2021, 1:20 pm