Joint Astronomy Centre
Show document only
JAC Home
JCMT
UKIRT
Contact info
JAC Divisions
OMP
Outreach
Seminars
Staff-only Wiki
Weather
Web Cameras
____________________

Observing at UKIRT
Service Observing
UKIDSS Survey Operations
Target of Opportunity
Calibration & Utilities
UKIRT Archive
Public wiki
Accessing Flexed Data
Accessing UKIDSS Data
Reduction Cookbooks
Telescope
Site Quality
Instruments
Newsletter/Publications
UKIRT Faults
JAC Safety Manual
USG: CGS4 with Figaro
JACH | JCMT | UKIRT | Computer Services | USG

Previous: Sloping Lines | Up: USG Main Page | Next: Data Reduction

Figaro procedures for reducing CGS4 spectra

                        TRG  -  December 13, 1996
 
   (note : some of the following is useful for CGS3 data reduction too)
   
**************************************************************************


1. Extract positive (and negative) spectrum from  rg or ro file for
   subsequent analysis. You may wish to de-curve or de-slope the rg or ro
   file prior to extraction (see the separate files dealing with
   techniques for these).

It is possible to extract a range of rows (using EXTRACT), a single row
or portion of a row (using ISUBSET), or to optimally extract a spectrum
covering more than one row (using PROFILE and  OPTEXTRACT). 

1.1 Range of rows

   EXTRACT
     (e.g., extract rg960524_37)
     the program will prompt for the range of rows and the name of the
     extracted spectrum. Note that if the wavelength scale is tilted on
     the array, extracting a range of rows will lower the resolution of
     the spectrum. If you do not wish to do this, ectract individual
     rows as in 1.2 below and shift spectra as described in 2.2 below.

1.2 Individual row

   ISUBSET  
     (e.g. isubset rg960524_37

      Prompts for (a) the row number (e.g., 27 or 36) 
      (b) the beginning and ending wavelengths (usually easiest to answer 
          MIN and MAX), 
      (c) a name (e.g., cygx3_37, BS5685_r36, argon_37)


1.3 Optimal extraction

A  profile of signal per row as a function of row number over the rows in
which signal appears is first determined (for a high s/n spectrum) and
then the profile is used to optimally extract a low s/n spectrum. CGS4
spectra normally appear in 2-3 rows of the 256sq array. 

   profile rg920529_32 (high S/N spectrum)
     Prompts for (a) starting row (e.g., 28)
                 (b) end row  (e.g., 30)
                 (c) degree of polynomial of the fitted profile (at least 4 
                     or 5 is needed) to get a good fit.
                 (d) number of points to reject (5 is OK)
                 (e) use errors to weight the fit (Y/N).  Answer N.
                 (f) name of resulting profile image (e.g.,POS)
                 (g) name of image containing residuals (e.g., JUNK)

		Do this for both the positive and negative spectrum  
                  (i.e. rows 28-30 and 18-20) - name the negative profile NEG


     optextract rg920529_40 (low S/N 
                spectrum)
     Prompts for (a) profile image to use (e.g., POS;  see above)
                 (b) use errors to weight the data (Y/N) - N
                 (c) name for optimally extracted spectrum (e.g., P)
     do same for negative spectrum, using NEG, name the resulting
spectrum N

     Note that if the profiles (e.g., POS, NEG) determined above are applied 
          to the same spectrum, the resultant spectra (e.g., P, N) are the 
          sums of the signals in the rows.

------------------

2. Combine positive and negative spectra, for both standard and target.

2.1 If wavelength scale is not tilted (does not vary with row number)
    this is simple; simply subtract the negative rows from the positive
    rows.

e.g. 

    isub P N sn95b_40

or use iadd or combine if signals are same sign.
   e.g., iadd BS5532_row29 BS5532_row30 BS5532rows2930

   Note that IADD will add the signals of two rows,  COMBINE will average 
     the signals, weighting them according to S/N at each point.  The
     commands, ICMULT and ICDIV are often useful, they multiply/divide the
     spectrum by a constant.


2.2 If wavelength scale is tilted on the array, and the spectrum is
sampled once per pixel (i.e. 1x1 or 1x2 sampling), the simplest procedure
is to detilt the spectral image as described in "Coping with sloping lines
in CGS4 (/UKIRT/software/#cgs4) In short, detilt
the spectral image of an arc lamp or sky spectrum using arc, iarc, and
iscrunch and apply the same correction to the spectral image of the target
or standard.  Then use the procedures described in 2.1. 

    Alternatively, use the procedure in 2.3 below.

2.3 If the wavelength scale is tilted on the array and the spectrum is
oversampled (i.e. 2x1, 3x2, 4x2, etc.), there may be a sawtooth on the
spectrum; if so, it will be virtually impossible to remove the sawtooth
across the entire spectrum if the procedures in 2.2 are employed (this is
because the dispersion varies across the spectrum and iscrunch rebins the
spectrum to constant dispersion per data point). To be able to remove the
sawtooth, it is necessary to measure the shift (in pixels) of each of the
extracted rows and then to shift the spectrum of each row before combining
the rows. The shifts can be measured by extracting individual rows of the
arc lamp spectrum (i.e. as in 1.2, cross-correlating them (using scross to
determine the shift, and then applying the shift to the extracted target
and standard rows using ishift, before combining them using iadd or isub,
as in 2.1.


-----------------

3. De-ripple the spectra, if necessary  (not needed if S/N is very low)

     first calculate the ripple function

     irflat
     Prompts for (a) the filename, 
     (b) the period of the ripple (e.g., 2 or 3 data points, 
     (c) the name of the resultant 2- or 3-point ripple spectrum (e.g., 
         rip; 
     (d) the wavelength range(s) over which to calculate the ripple (avoid 
        the edges of spectra where the S/N is often low or the where the
        edge pixels are noisy or corrupted.
                  
       the ripple function will then be printed on the screen.


     Then divide out the ripple

     idiv bs5685_K  rip  bs5685_K_drip
     where the entries are the original spectrum, the ripple function, and the 
     name of the resultant (de-rippled) spectrum.

---------------------

4. Calibrate the wavelength scale of the arc lamp spectrum, and then copy 
   the wavelength scale onto the astronomical spectra.  This assumes that 
   a 1D arc spectrum has already been extracted from a CGS4 RO or RG file.

      ARC
      (e.g., arc 
      Prompts for (a) the filename (ARGON_K_31; it is also possible to use a 
          sky emission spectrum or a star spectrum with telluric absorption 
          lines)
      (b) the type of arc - answer with '' or NONE (you then specify the 
          wavelengths). If this doesn't work, enter ARGON.  In this case, you 
          always can force the routine to accept a particular wavelength by 
          putting space E after the number when inputting it. E.g., answer
          2.0992 E to the prompt. This will force the routine to use that 
          wavelength for the line just identified.
      (c) whether to use lines from a previous fit (FALSE);
      (d) order of polynomial fit (2 is sufficient, but you must have at
          least three lines, with two of them near the short and long 
          wavelength ends); If you only have two lines, enter 1
      (e) arc line half width (the default, 2 is OK).

      A plot of the spectrum appears on another window. Use this plot to 
      select lines, entering wavelengths on the original window. There 
      are several techniques for doing this - the one I usually use is to 
      position the cursor on a line, type E (expand scale), position the 
      cursor accurately (to ~ 0.1 pixel) at the peak, type W (wavelength), 
      and type the wavelength (e.g. 2.0922 or 2.0922 e). Continue this until 
      you have entered at least 3 well-spaced lines (esp. at the extrema of the 
      spectrum). Then type Q (quit). After the parameters of the fit are 
      listed, type Q again. Create an output file (YES), e.g., ARGON_K_CAL.

      Note that if sometimes the entire arc spectrum is not displayed. To see 
      an adjacent interval of spectrum, type N. Other options will be displayed
      by typing a ? .

      XCOPY   to BS5685_K or CYGX3_K;  from  ARGON_K_CAL;
             name of calibrated spectrum  BS5685_K_CAL or CYGX3_CAL
             (in practice I give the calibrated spectrum the same name as the
             original, in order to reduce the number of files I have stored)

-------------------

5. Edit out spikes in the object or standard, or spectral features (e.g.,
   Br gamma in a standard)

     isedit BS5685_K_CAL
     Prompts for (a) name of the edited spectrum (e.g., BS5685_K_CAL_E), and 
     (b) whether or not to plot the full spectrum (or just the portion
     near the data points to be edited
     There are then several ways to proceed. One of the simplest is to 
     interpolate across the line - position the cursor on one side, type I,
     position the cursor on the opposite side, and type any letter. Another
     simple technique is, for each data point, to position the cursor at the 
     location you want to move the data point (i.e. directly above or below the 
     data point) and type M. When finished type Q.

--------------------

6. Cross-correlate spectra of target and standard and shift spectra if 
   necessary to line up atmospheric absorption lines so that they ratio 
   properly.  This is mainly for cases where both the continuum of the 
   standard and the target have been detected with good S/N.

   scross std_1 target_2 
      specify wavelength range for calculating the shift (this should be a 
           range where prominent telluric absorption lines are present) 
   ishift target2   
      Specify for X shift the value calculated using SCROSS; the sign of
      the shift should be correct if scross is done as above). The 
      shift in Y should be 0, and the X and Y subdivisions should be 1
   

(One could shift either the target or the standard. My preference is to
shift the target, as (i) the standard is usually brighter and better
centered on the slit and (ii) the standard may be used with more than one
target.)

---------------

7. Divide and flux-calibrate spectra (result in mJy)

     irflux 
     Prompts for the "star spectrum" - this is the source  (CYGX3_K_CAL),
     (b) the "std spectrum"   (BS5685_K_CAL_E),
     (c) temperature of the standard,
     (d) the type of calibration (J,H,K, L, or F (flux in mJy)),
     (e) the numerical value of (d) above,
     (f)the name of the resultant spectrum (CYGX3_K_FNU - the result is in
        mJy)

    Convert to f-lambda, if desired, using IRCONV  
       irconv CYGX3_K_FNU CYGX3_K_FL
     

    Correct for differences in exposure times (CGS4 only) (if this was
        not done previously):
      icmult CYGX3_K_FL .05 CYGX3 
           (or use ICDIV - icdiv CYGX3_K_FL 20 CYGX3)

---------------------

8. Smooth spectrum

     ixsmooth CYGX3_K_FL
     Prompts for Gaussian half width in pixels (data points) (e.g., 0.75),
     Range of Gaussian  (e.g., 5 pixels)
     and name of resultant spectrum, (CYGX3_K_FL_SM)

--------------------------

9. Plot spectrum

Soft plot:
     ESPLOT   (with error bars)
     SPLOT    (without error bars)

     also queries for creation of a postscript file for hard plotting.
______________

10. Convert data to an ASCII file
 
    wascii CYGX3_K_FL  CYGX3_K_FL   (converted spectrum is CYG_K_FL.DAT)

Previous: Sloping Lines | Up: USG Main Page | Next: Data Reduction

JACH | JCMT | UKIRT | Computer Services | USG

Last Modification Date 1996/10/07 - Last Modification Author: frossie
Tom Geballe (tom@jach.hawaii.edu)
Contact: Tom Kerr. Updated: Wed Oct 6 12:07:27 HST 2004

Return to top ^