[Michelle logo]

Using the Gemini MIDIR Package for Michelle Data Reduction

Introduction

This page gives an outline of how to reduce images or spectra taken with Michelle (or with T-ReCS, as things are very similar in the two cases) using the IRAF tasks in the midir package. Imaging observations can be reduced semi-automatically if the observations were made in good conditions. If there were problems with part of the observations some interactive work is needed even in imaging mode. Polarimetry imaging reductions are only slightly more difficult than normal imaging reductions. On the other hand, spectroscopy observations nearly always need at least a little interactive work in the reductions.

Imaging Reductions

Imaging reductions normally are straightforward. If an observation has been taken under good conditions then the reduction of the raw data files is a one-step process. The mireduce task is used with the raw data files and produces a stacked final image. For many imaging observations this is sufficient.

If there are some NODs (or individual savesets, for T-ReCS) that are bad in the observation--due to detector noise, a chopping problem, clouds passing by or something else of this sort--then it is necessary to examine the individual images in the raw data file and see which of these need to be removed before the final image is produced. The tasks tview, mview, and miview are all intended for this purpose. The difference between the three task are that tview is for raw T-ReCS files, mview is for raw Michelle files, and miview is for files produced by mprepare or tprepare where the files have been changed to a common format. Each of these tasks lets one look at individual images one by one and mark those that are bad. Please note that due to the radiative offset of the telescope if a NOD A frame is removed from the set of images then a corresponding NOD B frame must also be removed. Due to limitations in IRAF, all of these tasks are very slow given the number of images in a normal T-ReCS or Michelle observation.

Even in the case where all the images in an observation are good, it may be necessary to register the images before adding them together to get the final image. In that case, a region for registration needs to be defined (as using the whole image for registration does not work very well at all). In such cases the method would be to run the mprepare task, then examine an individual image from the resulting file to locate the science target, and then run miregister on the file to make the final image. Note that the xregister task in IRAF, which is used for the registration, may not produce the best possible registration. Some experimentation may be needed to produce a good result. PIs should run the imaging reduction with and without registration and compare the results in detail to see if the registration really has improved the image.

An example of how to run the reduction would be something like the following:

mi> mireduce N20050903S0360 rawpath=datapath$
MIREDUCE 
MIREDUCE ------------------------------------------------------------------
MIREDUCE Log opened at [Sat 18:03:54 18-Feb-2006]
MIREDUCE 
MIREDUCE --------------------
MIREDUCE Input Parameters:
MIREDUCE      inimages       = N20050903S0360
MIREDUCE      outimages      = 
MIREDUCE      rawpath        = datapath$
MIREDUCE      outpref        = r
MIREDUCE      fl_background  = no
MIREDUCE      fl_view        = no
MIREDUCE      fl_mask        = no
MIREDUCE      bpm            = 
MIREDUCE      fl_flat        = no
MIREDUCE      flatfieldfile  = 
MIREDUCE      stackoption    = stack
MIREDUCE      frametype      = dif
MIREDUCE      fl_display     = no
MIREDUCE      fl_check       = yes
MIREDUCE      fl_rescue      = no
MIREDUCE      logfile        = 
MIREDUCE      verbose        = yes
MIREDUCE --------------------
MIREDUCE Processing 1 images(s).
MIREDUCE FORK -- Forking to MPREPARE ...
MPREPARE 
MPREPARE ------------------------------------------------------------------
MPREPARE Log opened at [Sat 18:03:54 18-Feb-2006]
MPREPARE 
MPREPARE --------------------
MPREPARE Input Parameters:
MPREPARE      inimages       = N20050903S0360
MPREPARE      rawpath        = datapath$/
MPREPARE      outimages      = mN20050903S0360
MPREPARE      outprefix      = 
MPREPARE      rescue         = no
MPREPARE      logfile        = midir.log
MPREPARE      verbose        = yes
MPREPARE --------------------
MPREPARE Processing 1 files
MPREPARE --------------------
MPREPARE     input file ->    output file
MPREPARE datapath$/N20050903S0360.fits[0] -> mN20050903S0360.fits
MPREPARE Rearranged image for nod 1
MPREPARE Rearranged image for nod 2
MPREPARE Rearranged image for nod 3
MPREPARE Rearranged image for nod 4
MPREPARE Rearranged image for nod 5
MPREPARE Rearranged image for nod 6
MPREPARE Rearranged image for nod 7
MPREPARE Rearranged image for nod 8
MPREPARE 
MPREPARE Finished with image number 1 at [2006-02-19T04:03:57]
MPREPARE --------------------
MPREPARE --------------------
MPREPARE Exit status: SUCCESS
MPREPARE Log closed at [Sat 18:03:59 18-Feb-2006]
MPREPARE ------------------------------------------------------------------
MPREPARE 
MIREDUCE FORK -- Returning to MIREDUCE ...
MIREDUCE FORK -- Forking to MISTACK ...
MISTACK 
MISTACK -------------------------------------------------------------------
MISTACK Log opened at [Sat 18:03:59 18-Feb-2006]
MISTACK 
MISTACK --------------------
MISTACK Input Parameters:
MISTACK      inimages       = mN20050903S0360
MISTACK      rawpath        = 
MISTACK      outimages      = reducetmpfile4063fwb
MISTACK      outpref        = r
MISTACK      logfile        = midir.log
MISTACK      frametype      = dif
MISTACK      fl_variance    = no
MISTACK      verbose        = yes
MISTACK --------------------
MISTACK   mN20050903S0360 --> reducetmpfile4063fwb
MISTACK Instrument is:michelle
MISTACK Number of extensions is 8
MISTACK 
MISTACK Feb 18 18:03: IMCOMBINE
MISTACK   combine = average, scale = none, zero = none, weight = none
MISTACK   blank = 0.
MISTACK                 Images 
MISTACK         tmpfile14063owb
MISTACK         tmpfile14063qwb
MISTACK         tmpfile14063swb
MISTACK         tmpfile14063uwb
MISTACK 
MISTACK   Output image = tmpfinal4063mwb, ncombine = 4
MISTACK   Sigma image = tmpvar4063lwb
MISTACK --------------------
MISTACK Exit status: SUCCESS
MISTACK Log closed at [Sat 18:04:01 18-Feb-2006]
MISTACK -------------------------------------------------------------------
MISTACK 
MIREDUCE FORK -- Returning to MIREDUCE ...
MIREDUCE Renaming image reducetmpfile4063fwb to rN20050903S0360
MIREDUCE All 1 images successfully reduced.
MIREDUCE --------------------
MIREDUCE Exit status: SUCCESS
MIREDUCE Log closed at [Sat 18:04:01 18-Feb-2006]
MIREDUCE ------------------------------------------------------------------
MIREDUCE 
mi> display rN20050903S0360[1] 1    
Warning: setting CD3_3 to 1.
Warning: setting CD4_4 to 1.
z1=-126.3013 z2=1311.35
mi> imexam
Warning: setting CD3_3 to 1.
Warning: setting CD4_4 to 1.
#   COL    LINE   COORDINATES
#     R    MAG    FLUX     SKY    PEAK    E   PA BETA ENCLOSED   MOFFAT DIRECT
 148.81  111.64 148.81 111.64
  11.49  13.66  34512.   1.626   1365. 0.24  -44 4.54     3.82     3.96   3.83
mi> miregister mN20050903S0360 outpref="r"
MIREGISTER 
MIREGISTER ----------------------------------------------------------------
MIREGISTER Log opened at [Sat 18:15:05 18-Feb-2006]
MIREGISTER 
MIREGISTER --------------------
MIREGISTER Input Parameters:
MIREGISTER      inimages       = mN20050903S0360
MIREGISTER      rawpath        = 
MIREGISTER      outimages      = 
MIREGISTER      outpref        = r
MIREGISTER      logfile        = 
MIREGISTER      fl_variance    = no
MIREGISTER      verbose        = yes
MIREGISTER --------------------
MIREGISTER   mN20050903S0360 --> rmN20050903S0360.fits
MIREGISTER Instrument is: michelle
MIREGISTER Number of extensions is 8
MIREGISTER 
MIREGISTER Feb 18 18:15: IMCOMBINE
MIREGISTER   combine = average, scale = none, zero = none, weight = none
MIREGISTER   blank = 0.
MIREGISTER                 Images 
MIREGISTER         tmpfile14063mxb
MIREGISTER         tmpfile14063rxb
MIREGISTER         tmpfile14063vxb
MIREGISTER         tmpfile14063zxb
MIREGISTER 
MIREGISTER   Output image = tmpfinal4063kxb, ncombine = 4
MIREGISTER   Sigma image = tmpval4063lxb
MIREGISTER --------------------
MIREGISTER Exit status: SUCCESS
MIREGISTER Log closed at [Sat 18:15:09 18-Feb-2006]
MIREGISTER ----------------------------------------------------------------
MIREGISTER 
mi> display rmN20050903S0360[1] 1
Warning: setting CD3_3 to 1.
Warning: setting CD4_4 to 1.
z1=-75.59988 z2=1441.532
ke> imexam
Warning: setting CD3_3 to 1.
Warning: setting CD4_4 to 1.
Warning: setting CD3_3 to 1.
Warning: setting CD4_4 to 1.
#   COL    LINE   COORDINATES
#     R    MAG    FLUX     SKY    PEAK    E   PA BETA ENCLOSED   MOFFAT DIRECT
 148.36  112.21 148.36 112.21
  11.06  13.66  34367.   1.623   1501. 0.18  -44 6.73     3.71     3.82   3.69

In this example, an observation of a star, the radial profile was fit for both the unregistered and registered images. There was some improvement as seen in the FWHM values (3.83 compared to 3.69 pixels) and the ellipticity (0.24 compared to 0.18). The registration might also work better using less than the entire image.

Clues as to the quality of the image can be found from looking at the variance of the pixels. This is done by setting the fl_variance flag in the call to miregister or mistack. Also examining the negative beams, if these are visible, may give an idea of the stability of the seeing and the guiding.

Absolute Calibration of Imaging Observations

All imaging observations are accompanied by observations of a photometric standard star, at as close an airmass match as circumstances allow. This observation allows conversion from counts on the detector to zero magnitude flux density in the filter, assuming that the atmospheric absorption is the same for the observation of the standard and the observation of the science target.

A listing of standard stars and their estimated flux density values (wavelength flux density in Jy) is given at this link. These values were calculated by integrating the assumed spectral energy distribution of the standard over the filter profiles for the different Michelle filters. It is difficult to estimate the uncertainties in these values because the atmospheric corrections are usually the largest contributor to the uncertainties in the calibration of Michelle images. The formal uncertainties in the spectral energy distributions for standard stars are generally of the order of 3% to 5%, giving a similar uncertainty in all efforts to calibrate Michelle images.

There is also an uncertainty in deriving flux density values in those cases where the spectral shape of the radiation for the science object is different than that of the standard star (which usually is the case). This colour correction may be significant for objects with very low colour temperature spectra in N-band and Q-band. This effect is smaller for narrower filters and if the filter profile is symmetric about its peak. Colour corrections are expected to be relatively small for all of the filters normally used by Michelle, but are significant for the broad N and Q filters (which are only rarely used due to saturation problems).

Imaging Polarimetry Reductions

Polarimetry mode involves using a half-wave plate to select polarization along different directions. The wave-plate is rotated between four positions in an "ABBA" type pattern to help to remove any linear drifts with time or sky position. For each NOD position short images are obtained with wave-plate positions 0, 45, 45, 0, 22.5, 67.5, 67.5, and 22.5 degrees. Then the telescope is moved to the next NOD position and the cycle is repeated.

Experience from the commissioning of the polarimetry mode shows that registration of the wave-plate images is essential to get an accurate result. The image of a star falls on the detector in slightly different positions for the four wave-plate angles. If these shifts are not removed, then the reduction finds a spurious polarization signal.

The registration is carried out by the reduction tasks. However it is found that the registration is sensitive to the area of the array used, and that if the entire image is used the result tends to be poor. Thus the reduction of the raw images requires three steps:

Some trial and error may be needed in selecting the proper region for the registration. For a point source a 21 by 21 pixel box seems to work. For a more extended object the box needs to be larger. The output of the misptack task is a MEF file with four extensions, being the stacked images for wave-plate angles of 0, 22.5, 45, and 67.5 degrees. These individual images can then be copied to normal FITS files, and used with the "polpack" software in the U.K. Starlink package. The only possible IRAF task to use for polarimetry analysis is the linpol task.

In stacking the frames one has the option of registering all frames or just those of a single wave-plate position. The former appears to work much better than the latter. If the registration is done for images at each wave-plate position, then these stacked images should again be registered when calculating the Stokes parameters.

Once the four wave-plate images have been obtained, these can be converted into Stokes (I, U, Q) images using the miptrans task. Again, it is generally necessary to register the images.

Another way to combine the wave-plate images is to form individual Stokes parameter images, I, U, and Q, for each AB NOD pair in the observation, and then to combine these to form the final Stokes images. This is done using the mipstokes and mipsstk tasks respectively. In doing so one can get an estimate of the signal to noise ratio for each pixel, so as to be able to screen out pixels with low S/N which produce spurious polarization signals. When this is done one can obtain estimates of the polarized and unpolarized fluxes, the percent polarization, and the position angle. Note, however, that the output polarization parameters are calculated in the simplest possible manner, and may overestimate the polarization especially when only a weak polarization signal is present. These routines may not produce science quality reductions. A dedicated polarization analysis package should be used for detailed analysis.

Due to the newness of the imaging polarimetry mode, further development of the package is likely to occur during 2006.

Spectroscopy Reductions

The examples given here are for the low resolution spectroscopy mode of Michelle. Very similar remarks apply to the reduction of spectra taken at higher resolution, even for the echelle mode, but there are some specific things that are different about these modes compared to low resolution spectroscopy, the most critical one being that the wavelength calibration requires a different line list than the default one in the package. The handling of the fringing is also different at higher resolution than it is for low resolution spectra. Some of these differences are outlined below.

The Observations

A normal set of spectral observations includes the following:

The flat and bias observations are optional; they are taken for all Michelle spectroscopy, but are not done for T-ReCS spectroscopy. For a point source it turns out that the flat and bias correction does not appear to make a big difference in the output spectrum. It is likely to be more important for an extended source.

The calibration object will either be a star or an asteroid. Asteroids are needed as calibration targets for high spectral resolution because their spectra are featureless. They therefore allow the removal of telluric features. For low resolution N-band or Q-ban spectra stars are more often used as calibration sources, since they also allow absolute spectral calibration if their spectral energy distribution is known.

A difference between the higher resolution spectral modes of Michelle and the low resolution modes (and all T-ReCS spectroscopy) is that the higher resolution Michelle observations are carried out without chopping, but only using nodding along the slit to subtract the atmospheric background, as is the case for near-infrared observations. T-ReCS spectroscopy and the low resolution N-band or Q-band spectroscopy from Michelle are carried out with chopping and nodding.

The Reduction Process

Several steps are needed in the reduction. All of these steps are included in the msreduce task in the midir package. The parameters of this task include many flags (the fl_ parameters) for either turning these steps on or off, where they are optional, or for whether the steps are done automatically or not. It turns out that a few of the steps either have to be done interactively or need "supervision" in case the automatic algorithms fail.

The msreduce task can be used in two ways. One can extract individual spectra without carrying out telluric corrections, if the fl_standard flag is "no". This produces a wavelength calibrated raw spectrum. Or one can extract the object and calibration spectra together and produce a wavelength calibrated and flux calibrated output spectrum, if the fl_standard flat is "yes". The flux calibration can be either absolute or relative depending upon the options chosen.

The only required parameter is the name of the raw data file for the object. If one is only extracting the raw spectrum without doing the telluric correction and calibration then no standard spectrum file needs to be specified. More usually one needs to give the name of the raw data file for the calibration standard (instd), set fl_standard to "yes". There are then two possibilities for how the calibration is carried out. If one sets the fl_blackbody flag to "yes" and specifies a temperature via the bbody parameter then the spectral shape of the calibration object will be assumed to follow that of a blackbody at the specified temperature. In the blackbody case the resulting spectrum is of arbitrary intensity scaling, in the case where a spectrophotometric standard is used one gets an absolutely calibrated spectrum -- although it has to be assumed that the slit losses are the same for the science target and for the calibration target. One also may run into problems if the airmass match between the science target and the standard is too large, or if atmospheric conditions have changed during the observations.

The outline of the steps in msreduce is as follows, where in parentheses the associated flag parameters of the task are listed:

These steps will now be discussed in turn.

Flat Fielding

If this option is chosen then the names of the raw data files for the flat-field spectrum and the bias frame need to be defined as the flat and bias parameters respectively. These are both taken in stare mode with no chopping or nodding. The files each have a single image extension with dimensions [320,240,1,1]. The raw "flat" frame is actually very nearly a blackbody spectrum at the ambient temperature of the dome when the observation was taken. The msflatcor routine is used to make a normalized flat from the two files, subtracting off the bias and making a fit to the spectral shape. Once the normalized flat has been made then the raw data file is changed by (1) subtracting the bias level off of the raw images, and (2) dividing the resulting image by the normalized flat image.

For spectra of point sources it appears that the flat fielding does not make an appreciable difference in the results. It is for extended sources where the flat fielding correction is potentially important, since the spectrum for the source and for the standard may come from very different parts of the array.

By default an "f" prefix is added to the original file name at this step.

The Initial Processing

This refers to the process of taking the raw data file, something like N20060108S0120.fits, and carrying out the initial processing that is needed for all Michelle observations. This involves using the mprepare and mistack tasks. For spectroscopy in addition to stacking up the difference frames one also needs to stack up the source frames to make a sky spectrum image. The output files from this step have prefix "r" or "a" added to the name, for the stacked difference frame and the stacked sky spectrum respectively. There is also an output file with prefix "m" which is just the raw data rearranged a bit for consistency with the corresponding T-ReCS "prepared" data file.

Once the initial processing is done then this step need not be re-done as long as the "a" and "r" files are present in the current directory.

The Line Identification

This is a step that needs to be done interactively in most cases. The lines that are marked by the automatic process are usually wrong. The sky spectrum is used for this purpose since arc spectra cannot normally be taken in the N-band or in the Q-band. The nswavelength task in the gnirs package is used in this step. It in turn calls the identify task in the NOAO package.

There is a default line list file for Low resolution N-band and Q-band spectroscopy in the "data" directory of the gnirs package. These "lines" are blends or band features in some cases. For example one feature that is used in N-band is the 9.503 micron peak of the ozone band. At very high resolution, as with the Michelle echelle mode, many individual lines are seen, but at the moment there is no list of all of these lines.

The extent to which the lines/bands stand out from the general sky emission is a strong function of the conditions, especially the water vapour column along the line of sight, and also depends strongly on of the slit width used. Below are shown a few examples of what these spectra look like when one is in the identify task. Initially one has to check the line IDs that are automatically done when the task starts. Usually one has to clear all the IDs with the "i" key and start over.

The following are the line wavelengths, in Angstroms, for the lines that are used with the low resolution spectroscopy modes:

N-band

74670 Sky
78750 Sky
85140 Sky
88020 Sky
95030 Sky
102600 Sky
117280 Sky
128770 Sky

Q-band

175860 Sky
182980 Sky
186480 Sky
190150 Sky
193100 Sky
198900 Sky
203220 Sky
206530 Sky
211750 Sky
218550 Sky
225950 Sky
229410 Sky
231990 Sky

Now here are some screen shots:

Narrow slit/dry conditions at Mauna Kea case--

On a dry night the general background at longer wavelengths goes down as is true for this particular observation. Using a narrow slit, 2 pixels in this case, increases the resolution somewhat and reduces the background level. In this case eight of the nine N-band "lines" are found automatically, which is enough to get a good solution. The marked lines are listed in the table below. The "wavelength" is the fitted wavelength value, while the "Line ID" column gives the nominal line wavelength. Both these values are in Angstroms.

   pixel    wavelength   Line ID
-----------------------------------
   47.78   74619.2101     74670.
   63.93   78813.4841     78750.
   88.50   85166.8354     85140.
   99.62    88033.285     88020.
  126.45   94941.4424     95030.
  156.33   102622.713    102600.
  213.27   117303.511    117280.
  257.31    128759.52    128770.

More average at Mauna Kea, and a wider slit--

When the water vapour is higher the general background goes up and the contrast between the "lines" and the background is reduced. With a wider slit the effective wavelength resolution is reduced. This makes finding various of the "lines" much more difficult. Compared to the spectrum above, note that the background level is about 2.5 times higher in the two spectra shown just below. These were taken one after the other but one sees a difference in the number of "lines" that can be located.

This observation used the four pixel slit and was at lower airmass than the observation shown above. Other things being equal the background would be expected to be increase by a factor of 1.7 compared to the above observation, instead it is a factor of 2.5. So the general background level is something like 50% higher on this night than it was for the first observation.

For this spectrum only four of the "lines" could be identified.

   pixel    wavelength   Line ID
-----------------------------------
     26.88 74568.0089     74670.
     43.82 78907.1222     78750.
    106.18  94944.751     95030.
    192.82 117330.486    117280.
    237.00 128749.632    128770.

For this spectrum seven of the "lines" could be identified.

   pixel    wavelength   Line ID
-----------------------------------
     26.98  74579.809     74670.
     43.69 78800.4521     78750.
     69.21 85325.1787     85140.
    106.14 94888.4792     95030.
    135.37 102506.004    102600.
    192.75 117419.864    117280.
    237.03 128720.213    128770.
 

In general one just has to try to locate the "lines" and get a consistent wavelength solution with only small residuals. The 95030 Angstrom and 78750 Angstrom bands are always easily located, so in the worst case one can use these to define a linear wavelength scale. The 117280 Angstrom band is the next easiest feature to locate.

Q-band spectroscopy

The situation in Q-band is much worse than for N-band because the atmospheric bands are stronger. The features chosen for the identification are all peaks of bands, and in the resulting raw extracted spectrum these peaks become minima. The only good thing about this is that all 13 features are always present in the spectra, exactly as listed above.

   pixel    wavelength   Line ID
-----------------------------------
    61.83   175780.171    175860.
    83.68   182971.936    182980.
    94.70   186596.989    186480.
   105.69   190216.019    190150.
   114.53   193123.953    193100.
   131.93   198851.61     198900.
   145.20   203220.359    203220.
   155.23   206521.998    206530.
   170.89   211676.384    211750.
   191.69   218524.299    218550.
   213.93   225844.891    225950.
   224.97   229478.821    229410.
   232.82   232062.571    231990.

In the higher resolution modes of spectroscopy the lines that can be identified are different than those listed above. However we do not have a definitive line list for every mode and wavelength range. In these cases, PIs should work with their contact scientist to identify the atmospheric lines.

Finding the Wavelength Transformation

After the initial identification of lines the tasks then seek to identify the same lines in spectral sections from other parts of the sky spectrum, since the sky fills the slit from top to bottom. In most cases this re-identification can be done automaticly.

There are rare cases where the automatic re-identification fails and then it must be re-done interactively.

Once the lines have been identified over the image, a transformation is calculated from pixel position to wavelength. This is applied to the spectrum when it is extracted in the next step.

Extracting the Raw Spectrum

The next step is to extract the spectrum. This is done using the standard routines in the NOAO twodspec package, specifically the apall task. One first marks the region to be extracted from a cut across the difference spectrum, and then traces this across the dispersion direction. Normally for brighter objects this is routine.

One should normally set the fl_extract flag to "yes" in order to examine the tracing. Usually the points at the left and right ends of the spectrum are not reliable and should be removed from the tracing. Spectra from Michelle or T-ReCS do not change position very much over the detector (usually 1 pixel or so) and the tracing of the spectrum should be close to linear. If either of these things is not the case from the automatic tracing, points need to be excluded until a reasonable tracing is obtained. An example of a reasonable fit is shown below. Note the points that were deleted at left and at right.

The reason why the tracing is lost at left (short wavelengths) and at right (long wavelengths) is that there are strong water bands in these regions. Unless the conditions are exceptionally dry these regions, wavelengths of less than 7 microns or of more than 13 microns, suffer from too much absorption to be used at this low resolution.

Given that the aperture is 6 pixels wide a linear fit would have been just as good as the slightly curved fit that is shown here.

Defringing the Spectrum

The Michelle and T-ReCS spectra are often subject to fringing. At high resolution the fringing is nearly always present. For low resolution spectra the fringing may not be seen, depending on the slit width. The fringes can generally be identified via fourier analysis and removed. This is an interactive step in the reductions, if requested, because finding the correct filter in the fourier domain is not something that can be automated.

An example of a badly fringed T-ReCS spectrum is shown below. When the msdefringe task is called it carries out a fourier transform of the input spectrum and initially plots the real and imaginary parts as a function of frequency bin. For a low resolution spectrum only the highest frequency component needs to be removed. One has the option of setting the range of components that are to be removed, and these can either be set to zero or be replaced by an interpolated value from the end points. Another option that is available is to screen out all negative values to zero, This is not always a good idea. If all the "real" structure in the spectrum is positive then this works well, but if the baseline level is slightly offset to negative values due to a drift in the sky background during an observation then it will not work properly.

The following screen shots show the process of defringing a spectrum.

the original spectrum

the fourier plot

The white curve is the real part, and the red curve is the imaginary part. One usually looks for the fringes in the real part.

a zoomed view of the high frequency part of the plot; the white line indicates the filtered values for the real and imaginary parts. In this case both are set to zero.

Once one exits from the fourier domain plot with the "q" key the next plot comes up: the original and defringed spectra. If the defringing has removed real structure, this is where one should reset with the "r" key or choose to exit without defringing using the "i" key.

Here is the output defringed spectrum by itself.

If the defringed spectrum has lost its baseline level the plot of the "before" and "after" spectra looks like this--

where the red curve is the "corrected" spectrum, but it does not have the correct base level. This is the result of masking out negative values when the baseline in the original spectrum is slightly negative. If such a behavior is seen, the only option is to run msdefringe manually outside of msreduce and then run the telluric correction/calibration step afterward.

Calibrating the Spectrum

This step is done with the msabsflux task. It in turn calls the telluric task in the NOAO onedspec package. In most cases it is wise to carry out this step interactively, since the automatically found "best" spectrum often is not actually what is wanted, especially for low resolution spectra. This is due to typically having large regions of little or no signal in the source and calibration spectra. Noise in these regions produces absurdly large signals in the resultant spectrum which severely skew the chi-squared minimization used in telluric to find the optimum shift between the two spectra.

In view of this problem the first thing one should do in running the task interactively is to window the plot to exclude the long and short wavelength regions with little or no signal. Typically that is wavelengths longer than 13 microns and wavelengths shorter than 7.5 microns.

One way to proceed is to set :offset 0. and :dscale 0. so only one "output" spectrum is plotted in the upper panel. A scaling can usually be found that shows the proposed output spectrum fairly well. Then one needs to search the parameter space to get a good output spectrum.

What is generally best is to change the shift value with the :shift command. It appears that the shifts are usually small, so starting at zero and then checking values slightly positive and negative from there is usually helpful. The main goal is to choose a shift that removes the ozone feature as well as possible. Wrong shifts cause the edges of the band to no longer match leaving a residual feature that tends to show up at around 9.3 to 9.6 microns.

The following screen shots show the initial plot screen, the plot screen once the wavelength range has been restricted somewhat, and then the plot screen when the shift has been set to 0 pixels. In this case having no shift produces a nice, smooth output spectrum over the region seen in the plot. This is the spectrum of an asteroid so what is seen is something that is very close to a 217 K blackbody shape.

Initial plot:

After changing the range and setting offset, dscale to 0.0:

With a shift of 0.0 pixels:

If a simple shift is not enough to get rid of the ozone feature then one can try to change the scale value. This should be done with caution.


[Science Operations home] [Michelle home]


Last update 18 February 2006; Kevin Volk