Displaying Spectra at APO

This document desribes ways of displaying raw spectro images and SOS-extracted spectra at Apache Point.

In this document:

Displaying Images From SOP

The fSAO display tool can be used to display the raw spectro images. This can only display the raw images, without overscan-correction. This means that there will be a baseline value of between 500 and 1250 ADU on each of the amplifiers. You will clearly see the split in overscan values between the left and right amplifiers.

From within SOP (or IOP), type the following (substituting for $MJD and $filename as appropriate):

  sop> cd /data/spectro/$MJD
  sop> set img [ regReadAsFits [regNew] $filename ]
  sop> saoDisplay $img
The default scaling will be for the full range of pixel values, which is usually not desirable. If you wish to display only in the range of 1000 to 1300 ADU,
  sop> saoDisplay $img "-min 1000 -max 1300"

Displaying Images From IDL

I've set up IDL on sdsshost.apo (and on sos.apo, plate-mapper.apo), for use in displaying spectro images. Note that since all the spectro data is automatically copied to sos.apo (by the Son-of-Spectro cron job), you can display images on either machine.

First, set up IDL and the idlspec2d product, and start up IDL:

  % setup idlspec2d
  % idl

Move into the directory for MJD 51886 and display the first image:

  IDL> cd,'/data/spectro/51886'
  IDL> img=rdss_fits('sdR-b1-00007538.fit')
  IDL> atv,img
A display widget, ATV, will then pop up. It functions much like SAOimage. There's a "Help" pull-down if you want to read what it does. But typically, you'll want to change the display limits in the "Min=" and "Max=" windows to be something reasonable - say, 0 to 20 for a bias. Row and column plots can be made by hitting the "r" and "c" keys.

There is another tool built on top of ATV that will overplot the bad column mask in red:

  IDL> atvrawspec,'sdR-b1-00007538.fit'
  IDL> atvrawspec,'sdR-b1-00007538.fit',min=0, max=20  ; <-- Force display range

To read in a raw image and median-filter before displaying,

  IDL> img=rdss_fits('sdR-b1-00007538.fit') ; <-- Read a raw image
  IDL> sdssproc,'sdR-b1-00007538.fit',img   ; <-- Or read + overscan-correct
  IDL> atvmedian(img,9)

Another useful command is

  IDL> logsheet
which will list select header information for the images in your current directory.

Displaying SOS-Reduced Spectra

The SOS-extracted spectra can be displayed using IDL tools on the computer sos.apo. For the full documentation, see http://spectro.princeton.edu/idlspec2d_doc.html#APOPLOT.

You must be logged onto sos.apo (or whichever machine is running Son-of-Spectro). Set up the idlspec2d product and start IDL with:

setup idlspec2d
idl

Quitting IDL:

IDL> exit

Analyzing Bias+Dark Frames

There's another useful (but slow!) command for analyzing bias and dark frames. This is the APO_PLOTBIAS procedure. It takes as its only argument a spectroscopic exposure number, then plots a histogram of bias values for all 4 cameras of that exposure:

IDL> apo_plotbias, 7538
This plot can optionally be written to a PostScript file with:
IDL> apo_plotbias, 7538, plotfile='bias.ps'
Bad regions on the CCD and saturated pixels are excluded from these histograms. The four histograms should be very near the fiducial, thick blue line. If not, you have a problem. The dark frames may show an increase in the tail of large values due to cosmic rays (though again, saturated cosmics are exluded from the plot).

After making its plot, the APO_PLOTBIAS procedure prints out a select number of percentiles. The 2-percentile is the value at which only 2% of the pixels are below, the 50-percentile is the value at which 50% of the pixels are below (e.g., the median), etc.

I find the typical percentiles for a bias to be:

Filename          02%   05%   10%   50%   90%   95%   98%
----------------  ----  ----  ----- ----  ----  ----- ----
sdR-any-exposure   -8    -5    -3     1     7     9    11
15-minute dark frames should have very similar values, since the saturated cosmics are excluded.
Maintained by David Schlegel and Scott Burles