Supplementary Material¶
Several topics intimately tied to data reduction are gathered here for reference. Most topics apply to multiple GMOS observing configurations.
Creating an Observing Log¶
Raw data files from a single observing program can number in the hundreds. Add to that the files generated during the course of data reduction: intermediate files, MasterCal reference files, combined exposures, extracted spectra, etc. and the task of keeping track of files in your workflow rapidly becomes a challenge. There is no uniquely correct way to manage the large number of files, but there are a couple of common approaches to sorting through the raw input files:
Separate files of various types (e.g., calibrations, science, etc.) into subdirectories based on common attributes. This is a typical approach for preparing to run IRAF file processing tasks.
Create an sqlite3 database of files and the relevant metadata (see below). Such a database is useful even if you choose IRAF for your image processing, since you can view and select by exposure attributes with the sqlite browser. The tool enables you to develop selection criteria, from which file lists with common attributes may be built with the IRAF hselect task.
In either case, it is usually helpful to do the following:
Collect the raw calibration exposures (bias, dark, flat) into a subdirectory (called
/raw
in the tutorials).Collect the raw science exposures (arcs, standard stars, science targets) into the same subdirectory.
The primary reduction tasks all have a rawpath
parameter that allows processing in the main work directory, while accessing input files from a subdirectory (called /raw
in the tutorials).
Finally, the intermediate files, by default, follow a File Nomenclature based on a prefix to the input file names, to make them easy to identify.
Once these intermediate files have been checked for quality and you are certain you no longer need them, they can be deleted.
Using IRAF hselect¶
An observing log may be built with the IRAF task imutil.hselect. Within an IRAF session, create two string variables:
one with the names of the fields (i.e., the header row),
and the the other with the corresponding names of the header keywords (which are not case-sensitive) containing the metadata.
# Create a log header with more meaningful field names:
string fieldNames = "# File ObsDate ObsTime Object ObsType ObsClass CcdBin RoI Filter1 Filter2 Disperser SlitName SlitType Rotator CenWave T_exp Airmass"
print (fieldNames, > "obsLog.txt")
string keywords = "$I Date-Obs Time-Obs Object ObsType ObsClass Ccdsum DetRO1ys Filter1 Filter2 Grating MaskName MaskType PA GrWlen ExpTime Airmass"
Now build the log with the header row plus one row for each FITS file in the directory, excluding acquisition exposures. Redirect the task output to a log file:
hselect ("*.fits[1,inherit=yes]", keywords, "obstype!='acq'", >> "obsLog.txt")
Note the use above of the first HDU header and the “inherit” kernel switch, which retrieves information in the files from both the PHU and HDU-1.
Using Python¶
Alternatively, you can build an observing log with a python script (download: obslog.py
), in the form of an sqlite3 database.
The script will create a database with the fields and metadata described above.
At the unix prompt, create the observing log and store it a file (obsLog.sqlite3
) in the /raw
subdirectory.
cd /path/to/work_directory/raw
python obslog.py obsLog.sqlite3
You may add the -v
option to also write the metadata for each file to STDOUT (which you can re-direct to an ASCII file). The output file is an SQLite3 database, which can be accessed via the python API, or viewed directly with the SQLite3 browser.
An example of the data browser is shown below.
The browser provides a quick way of assessing the content of an observing program, and for crafting the correct IRAF selection criteria for grouping files with related content.
The PyRAF tutorials use SQL to select files that match exposure metadata stored in the database.
Header Metadata¶
Values from the keywords listed below are harvested from the data headers. Some of the names are obscure, so they are re-mapped to somewhat more intuitive field names if you create an sqlite3 database. Fields may be added (or deleted: not recommended) by changing the KW_MAP definition at the top of the python script.
Keyword |
DB Field |
Description |
---|---|---|
|
Flag: indicates file usage or exclusion [ |
|
|
|
Name of the data file |
|
|
UT Date of observation start (YYYY-MM-DD) |
|
|
UT Time of observation start (HH:MM:SS.S) |
|
|
Name for target of exposure. |
|
|
Right Ascension of target |
|
|
Declination of target |
|
|
Type of observation: [ |
|
|
Class of observation: [ |
|
|
Pixel binning during read-out; combinations of \(1\times [1|2|4]\) through \(4\times [1|2|4]\) |
|
|
Region of interest for CCD read-out [ |
|
|
Mode for Nod-and-Shuffle [ |
|
|
Size of shift (pix) for Nod |
|
|
Number of N&S cycles during exposure |
|
|
Detector translation X position (\(\mu\mathrm{m}\)) |
|
|
Name of selected filter in wheel 1 |
|
|
Name of selected filter in wheel 2 |
|
|
Name of selected disperser (name of blocking filter is appended after the |
|
|
Name for selected slit(mask) |
|
|
Type of selected slit(mask) [ |
|
|
Position angle (\(\rho\)) of slit on sky (N through E). At \(\rho = 0\) (default) N is “up” and E is to the “left” in a default ds9 display |
|
|
Grating approximate central wavelength (nm) |
|
|
Exposure duration (s) |
|
|
Atmospheric column through which exposure was obtained |
Be sure to browse the observing log and/or display the exposures, and remove (or mark as “excluded”) any files that should not be processed, such as test or acquisition exposures.
GMOS Processing Keywords¶
The keywords listed below are introduced or modified during the course of processing.
Keyword |
Added by |
Description |
---|---|---|
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating update of gain and readnoise |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating header updated |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
UT Timestamp indicating successful processing |
|
|
Name of Bias Residual MasterCal |
|
|
Flag for flux calibration |
|
|
WCS deriviative matrix |
|
|
WCS deriviative matrix |
|
|
WCS deriviative matrix |
|
|
WCS deriviative matrix |
|
|
WCS reference pixel for axis1 |
|
|
WCS reference pixel for axis2 |
|
|
Value of WCS at reference pixel for axis1 |
|
|
Value of WCS at reference pixel for axis2 |
|
|
Type of WCS coordinate for axis1 |
|
|
Type of WCS coordinate for axis2 |
|
|
Flag for dispersion correction |
|
|
Name of reference arc |
|
|
Axis number of dispersion direction (1 for spectroscopy) |
|
|
Flag for extinction correction |
|
|
Name of extension (SCI) |
|
|
Version of extension (1 to no. amps in use) |
|
|
Name of Flat-field MasterCal |
|
|
Updated value of gain from DB |
|
|
Value of gain after gain correction |
|
<Any task> |
UT Timestamp for last modification by a gemini task |
|
|
gmosaic clean value |
|
|
Interpolant used to resample image |
|
|
GSCRREJ equivalent instrumental FWHM |
|
|
GSCRREJ sigma rejection threshold |
|
|
Total number of MEF extensions |
|
|
Number of SCI extensions |
|
|
Observing mode; derived from |
|
|
Updated value of read noise from DB |
|
|
Value of read noise after gain correction |
|
|
Indicates removal of overscan (yes|no) |
|
|
UT Timestamp indicating successful processing |
|
|
WCS description |
|
|
Continuation of WCS description |
|
|
Continuation of WCS description |
|
|
Name of reference wavelength solution |
Caution
The gmos tasks require the above keywords from prior reduction stages to be present and populated correctly for processing to proceed to the next stage. If you choose to perform some of the processing with your own or other IRAF tools, you will need to ensure that the expected processing keywords are inserted into the output headers if you want to continue processing with gmos tasks.
GMOS BPM Flag Encoding¶
Bad pixel masks are (optionally) used in GMOS processing to track the various conditions that apply to individual pixels during the course of data reduction.
The BPM pixel values correspond to a logical or
of one or more bit values: \(2^{N-1}\), where N is the bit corresponding the a particular, recognized pathology.
The Static BPM MasterCal files describe the permanent features of the GMOS detectors; other flags are introduced during data reduction.
The following table describes the meaning assigned to values that are used (and reserved) by GMOS software.
Bit |
Pixel Value |
Meaning |
---|---|---|
0 |
|
No conditions apply |
1 |
|
Generic bad pixel: region not illuminated (or occulted); hot pixel; bad column. |
2 |
|
Highly non-linear response |
3 |
|
Saturated pixel |
4 |
|
Affected by cosmic-ray hit |
5 |
|
Pixel contains invalid data (e.g. all data rejected during stacking) |
6 |
|
[Not used] |
7 |
|
[Not used] |
8 |
|
[Not used] |
9 |
|
SCI pixel value has been replaced by interpolation |
10 |
|
SCI pixel value has been replaced but not interpolated |
The IRAF help for the gemfix task describes how they may be used. Be aware that the BPM for processed data (intermediate or final data products) may be different than that for raw data. For example, when images are stacked the flagged data will be excluded during the combine operation.
Calibration Material¶
Many calibration reference files are distributed with IRAF and the gemini package. Others are available from other sources. This sections provides pointers to many of the files you will need for GMOS.
Bad Pixel Masks¶
A set of Static Bad Pixel Masks (BPM) are available in the gmos$data/
directory.
The BPMs differ for each type of CCD, and the choice of binning used during read-out; there are often separate versions for individual CCDs and mosaiced images.
The BPMs depend in principle upon the number of amplifiers used for read-out, but in practice science programs use only one choice of amps for a given generation of CCDs.
Beware that many of the BPMs are appropriate for mosaic’d exposures, rather than CCDs in separate image extensions.
Additional BPMs have been constructed for this Cookbook, and may be downloaded via a link in the last column.
See the table below for the set of available files.
Instrument |
CCD Type |
Binning |
Mode |
Location |
---|---|---|---|---|
GMOS-N |
EEV |
\(1\times1\) |
Imaging |
|
\(2\times2\) |
|
|||
e2vDD |
\(1\times1\) |
|
||
\(2\times2\) |
|
|||
GMOS-S |
EEV (old) |
\(1\times1\) |
Imaging |
|
\(2\times2\) |
||||
GMOS-S |
EEV (new) |
\(1\times1\) |
Imaging |
|
\(2\times2\) |
|
|||
\(1\times1\) |
Spect. |
|||
GMOS-S |
Hamamatsu |
\(1\times1\) |
Imaging |
|
\(2\times2\) |
|
|||
\(4\times4\) |
|
Arc Lamp Atlas¶
Line identifications may be found on the Gemini/GMOS CuAr Spectra page. A one-page atlas of the comparison arc is shown below.
The Cu-Ar lamp is the primary wavelength calibration source, and line lists are provided in the gmos IRAF package. However for the highest dispersion modes, the standard line lists are incomplete if the arc is well exposed. The following line lists are available:
Location |
Notes |
---|---|
|
Default list for gmos package; subset for non-interactive fits. |
|
Preliminary list; more lines but less precise wavelengths. |
Download: |
Complete list downloadable with this Cookbook; suitable for deeply exposed Arcs at high resolution. |
Note
You may wish to use the high-dispersion line list to determine the dispersion solution for the highest resolution configurations (B1200 and R831 with a slitwidth <1.0arcsec). If the Arc exposure is sufficiently deep it should be possible to include more than 100 lines in the dispersion solution (with an RMS less than a few tenths of a pixel), except in the near IR. The fit will require a polynomial of order 6 or 7 to yield an acceptable solution.
Spectrophotometry¶
Atmospheric Extinction¶
The correction for atmospheric extinction normally involves the application of averaged extinction coefficients for a given site, in units of magnitudes per unit airmass over a grid of wavelengths. The correction typically only includes Rayleigh scattering, aerosols, and ozone, but not telluric absorption. Gemini data reduction procedures provide for standard IRAF extinction curves, which are available for KPNO and CTIO (and an undocumented curve ostensibly for Mauna Kea), but not for the higher altitude of the Gemini sites on Mauna Kea and Cerro Pachon where the extinction is (not surprisingly) lower. These extinction curves are plotted below, along with a model developed by Buton et al. (2013; [BC]), derived from extensive observations on Mauna Kea.
Although the Buton et al. model also does not include the (time dependent) telluric absorption, it is clearly more appropriate for GMOS-N data.
The extinction files may be found in the locations given below (locations beginning with onedstds$
refer to an IRAF system directory).
Observatory |
File Location |
---|---|
CTIO |
|
KPNO |
|
GMOS-N |
Download: |
Note
The extinction curve named gmos$calib/mkoextinct.dat
is very coarsely sampled, has no provenance, and is very different from the curve from Buton et al.; it should not be used.
Standards List¶
A set of photometric standards are routinely observed with GMOS to monitor instrument performance and to enable flux calibration of spectra. Individual observing programs may in addition have observed these or other flux standards.
There are often multiple published monochromatic magnitudes of spectrophotometric standards.
The following table is the tertiary standard subset of the spectrophotometric standards included in the IRAF noao package.
The monochromatic magnitudes have been published in one of the references given below the table.
These files may be found under the IRAF directory noao$lib/
(except for EG 131 which is in gmos$calib/
) in the subdirectory indicated.
The table heading caldir
is the IRAF name of the calibration directory in which the monochromatic magnitudes for the standard are located.
Some alternative standards are available, such as those provided by ESO or STScI, which may have better sampling, or have been extended to the UV or near IR. In these cases a link from the star name has been provided to the relevant repository. For other standards the monochromatic magnitudes may only be available from an external source.
Star |
Caldir |
IRAF Name |
Literature Codes |
---|---|---|---|
|
HST |
||
|
|
MS88; MG90 |
|
|
Oke90 |
||
|
Oke90; HST |
||
|
|
Oke90; HST |
|
CD-32 9927 |
|
|
HSHWG |
EG 21 |
|
|
HSHWG |
EG 81 |
|
|
HSHWG |
EG 131 |
|
|
|
|
|
HSHWG |
|
|
|
HST; MS88; MG90 |
|
Feige 56 |
|
|
HSHWG |
|
|
HSHWG |
|
|
|
HSHWG |
|
|
|
HSHWG; MG90 |
|
|
|
MS88; MG90; HST |
|
|
Oke90; HST |
||
|
HST |
||
|
HST |
||
|
HST |
||
|
Oke90; HST |
||
|
|
HSHWG; MG90 |
|
HD 192281 |
|
|
HSHWG |
HD 217086 |
|
|
HSHWG |
|
HST |
||
|
Oke90; HST |
||
|
|
Oke90; HST |
|
|
|
HST |
|
|
|
MS88; MG90; HST |
|
|
|
HSHWG |
|
|
HST |
||
|
Oke90; HST |
||
LTT 377* |
|
|
HSHWG |
LTT 1020 |
|
|
HSHWG |
LTT 1788 |
|
|
HSHWG |
LTT 2415 |
|
|
HSHWG |
|
|
HSHWG |
|
LTT 3864 |
|
|
HSHWG |
LTT 4364 |
|
|
HSHWG |
LTT 4816 |
|
|
HSHWG |
LTT 6248 |
|
|
HSHWG |
LTT 7379 |
|
|
HSHWG |
|
|
HSHWG |
|
LTT 9239 |
|
|
HSHWG |
|
|
HSHWG |
Literature references:
B99: Bessell (1999, PASP, 111, 1426), A revision of the HSHWG spectrophotometry redward of 670 nm to remove telluric features
HSHWG: Hamuy et al. (1994, PASP, 106, 566), Southern hemisphere secondary and tertiary spectrophotometric standards over the range 330–1050 nm
HST: Bohlin, Colina, & Finlay (1995, AJ, 110, 1316), White dwarf Standard Stars: G191-B2B, GD 71, GD 153, HZ 43
MS88: Massey & Strobel (1988, ApJ, 328, 315) Northern hemisphere spectrophotometric standards over the range 320–8100 nm
MG90: Massey & Gronwall (1990, ApJ, 358, 344) Extension of MS88 spectrophotometric data to 1000 nm
Oke90: Oke (1990, AJ, 99, 1621) Faint spectrophotometric standard stars, intended to support HST, covering the range 320 to 920 nm
*Note that L745-46A is labelled CD-34 241 in the ESO list. CD-34 241 was mistakenly named LTT 377 in Hamuy et al. (1992 & 1994).
IRAF Reduction Tools¶
A few of the IRAF data reduction tasks have interactive options, where the user provides input via the IRAF graphics utility.
These tools involve cursor interactions and keystrokes, which can be viewed by entering ?
when in cursor mode.
The most commonly used options for two of the most complex tasks are given below, for reference.
Wavelength Calibration¶
Wavelength calibration is performed with the gmos.gswavelength task, which is really a wrapper for the IRAF identify family of tasks.
Cursor Keys¶
Key |
Description |
---|---|
|
Clear the screen and print a menu of options. |
|
Apply next center or delete operation to all features |
|
Identify features and find a dispersion function automatically using the coordinate line list and approximate values for the dispersion. |
|
Center the feature nearest the cursor. Used when changing the position finding parameters or when features are defined from a previous feature list. |
|
Delete the feature nearest the cursor. Delete all features when preceded by the |
|
Find features from a coordinate list without doing any fitting. This is like the |
|
Fit a function of the pixel coordinates to the user coordinates. This enters the interactive function fitting package. |
|
Fit a zero point shift to the user coordinates by minimizing the difference between the user and fitted coordinates. The coordinate function is not changed. |
|
Initialize (delete features and coordinate fit). |
|
Locate features in the coordinate list. A coordinate function must be defined or at least two features must have user coordinates from which a coordinate function can be determined. If there are features an initial fit is done; then features are added from the coordinate list; and then a final fit is done. |
|
Mark a new feature using the cursor position as the initial position estimate. |
|
Move the cursor or zoom window to the next feature (same as |
|
Pan to the original window after zooming on a feature. |
|
Quit and continue with next image. |
|
Redraw the graph. |
|
Shift the fit coordinates relative to the pixel coordinates. The user specifies the desired fit coordinate at the position of the cursor and a zero point shift to the fit coordinates is applied. If features are defined then they are recentered and the shift is the average shift. The shift is printed in pixels & user coordinates & z (fractional shift). |
|
Enter a new user coordinate for the current feature. When marking a new feature the user coordinate is also requested. |
|
Window the graph. A window prompt is given and a number of windowing options may be given. For more help type |
|
Find a zero point shift for the current dispersion function. This is used by starting with the dispersion solution and features from a different spectrum. The mean shift is printed in user coordinates & mean shift in pixels & the fractional shift in user coordinates. |
|
Zoom on the feature nearest the cursor. The width of the zoom window is determined by the parameter zwidth. |
|
Move the cursor or zoom window to the feature nearest the cursor. |
|
Move the cursor or zoom window to the next feature. |
|
Move the cursor or zoom window to the previous feature. |
Colon-command Summary¶
The following is an abridged list of colon commands (i.e., command names preceded by the :
key) to view (with no argument) or set (including trailing argument) a gswavelength task parameter.
The commands may be abbreviated.
For a full list see identify or invoke the ?
cursor command within an interactive session.
Key |
Value |
Description |
---|---|---|
|
file |
Show the values of all the parameters. If a file name is given then the output is appended to that file. If no file is given then the terminal is cleared and the output is sent to the terminal. |
|
file |
Print the feature list and the fit rms. If a file name is given then the output is appended to that file. If no file is given then the terminal is cleared and the output is sent to the terminal. |
|
file |
Set or show the coordinate list file. |
|
value |
Set or show the centering radius in pixels. |
|
value |
Set or show the detection threshold for centering. |
|
name |
Set or show the database for recording feature records. |
|
value |
Set or show the feature type (emission or absorption). |
|
value |
Set or show the feature width in pixels. |
|
value |
Set or show the feature label type ( |
|
value |
Set or show the coordinate list matching distance. |
|
value |
Set or show the maximum number of features automatically found. |
|
value |
Set or show the minimum separation allowed between features. |
|
value |
Set or show the zoom width in user units. |
APEXTRACT Summary¶
The aperture extraction utility (apextract) in IRAF is invoked from the gmos.gsextract task. When run interactively, this utility provides a variety of cursor keys to control the extraction of target spectra. If you use IRAF for your data reduction, you will need to get comfortable with this task. See the apextract.apall documentation for details.
The following are the available cursor commands for aperture definition and spectrum extraction.
Key |
Ap |
Description |
---|---|---|
|
Print help |
|
|
Toggle the ALL flag |
|
|
an |
Set background fitting parameters |
|
an |
Center aperture(s) |
|
an |
Delete aperture(s) |
|
Find apertures up to the requested number |
|
|
an |
Recenter aperture(s) |
|
ac |
Set lower limit of current aperture at cursor position (see |
|
Define and center a new aperture on the profile near the cursor |
|
|
Define a new aperture centered at the cursor |
|
|
Quit |
|
|
Redraw the graph |
|
|
an |
Shift the center(s) of the current aperture to the cursor position |
|
ac |
Trace aperture positions |
|
ac |
Set upper limit of current aperture at cursor position (see |
|
Window the graph using the window cursor keys |
|
|
an |
Set aperture limits to intercept the data at the cursor y position |
|
an |
Resize aperture(s) |
|
n |
Select the aperture nearest the cursor to be the current aperture |
|
c |
Select the next aperture (in ID) to be the current aperture |
|
c |
Select the previous aperture (in ID) to be the current aperture |
|
Interrupt task immediately. Database information is not saved. |
The letter a following the key indicates if all apertures are affected when the ALL flag is set. The letter c
indicates that the key affects the current aperture while the letter n
indicates that the key affects the aperture whose center is nearest the cursor.
Colon-command Summary¶
The following is an abridged list of colon commands (i.e., command names preceded by the :
key) to view (with no argument) or set (including trailing argument) a gsextract task parameter.
For a full list see apall or invoke the ?
cursor command within an interactive session.
Command |
Description |
---|---|
|
Background fitting function |
|
Background fitting function |
|
Background high/low rejection limits |
|
Determine background from average or median |
|
Function order for background fit |
|
Comma-separated list of background sample region(s) [ |
|
Background to subtract (e.g. |
|
Subtract background in automatic width? [ |
|
Detect and replace bad pixels? [ |
|
Extract sky & sigma etc. in addition to spectrum? |
|
Dispersion line over which to display profile |
|
Extent over which to determine profile (positive for sum or negative for median) |
|
Lower/upper aperture limits relative to center |
|
Lower/upper rejection threshold |
|
Print the current value of all parameters |
|
Profile centering radius |
|
Type of fitting function for trace |
|
Upper/lower rejection limits for trace [sigma] |
|
Number of dispersion pixels to sum for trace |
|
Order of trace fitting function |
|
Step size for fitting function |
|
Extraction weights [ |
|
Profile centering width |
Note that all parameters having to do with positions or distances are in units of binned pixels.
Background Information¶
Description of the Dispersion Solution¶
The gratings used in GMOS introduce significant nonlinearity to the dispersion relation, which can generally be well characterized with a Legendre or Chebyshev polynomial of order 6 or 7.
If a non-linear dispersion solution is written directly into the FITS header (as it is by the IRAF task dispcor
when linearization is turned off), it will consist of a number of terms including the coefficients of the fitted polynomial.
The coefficients are described in the paper The IRAF/NOAO Spectral World Coordinate Systems (1991, F. Valdes).
The following excerpt describes how to compute wavelengths from the nonlinear function of choice.
There are three coordinates of relevance: the pixel coordinate p of the spectrum array; the normalized coordinates n over the domain of the fitting function, in the interval [-1, 1]; and the world coordinates w at each pixel. The transformation from pixel to normalized coordinates n is:
Note that in practice the range of pixels will extend somewhat beyond the domain over which the fitting function was defined. For a single function type (the usual case unless comparison arcs taken immediately before and after a science exposure are used to refine the wavelength zero-point), the transformation from pixel coordinates p and world coordinates w is:
where z is the Doppler factor. The dispersion function \(\Lambda(p)\) at pixel p can be evaluated over the function coefficients \(c_i\):
where \(x_1 = 1; x_2 = n\). The non-linear terms for order \(i>2\) may be computed recursively; for Chebyshev polynomials we have:
or for Legendre polynomials:
IRAF spectroscopic tasks have a built-in capability to read dispersion solutions with the above form.
For python users the following snippet of code may be used to construct a wavelength array from Legendre or Chebyshev function parameters and coefficients, using the functions in poly.py
:
import numpy as np
import poly as pl
# Extract function, parameters, and coefficients from WAT2_00x keywords.
# An example from the center of an arc comparison exposure using grism b2k
# and facility longslit 3pxC:
pMin, pMax = [90.65229797363281, 4054.766357421875]
c = np.array([5160.180854771875, 1399.010545377342, 64.60055185877235, -24.74632014374652, 0.1313465583541718, -0.1962541400576848, -0.06403879553807495])
nPix = 4096
# Generate an array of world coordinates (in Angstroms, the declared WCS unit).
n = pl.getNormCoords(pMin, pMax, nPix)
w = pl.evDispersion(pl.evLegendre, c, n)
World Coordinate Systems¶
It is useful to have at least an approximate World Coordinate Solution (WCS) specified in the header of your science images; this solution can be refined later in target processing.
Imaging WCS¶
For imaging mode exposures, the WCS may be of scientific interest even when imaging was not the focus of the original observing program. For observing programs that used custom MOS slits, the WCS in acquisition images is helpful for associating slit locations with specific targets (or regions within extended astronomical objects).
Setting the WCS Description¶
An approximate solution was inserted in the observing environment from the telescope alignment during each exposure, and the instrument rotator angle. The following table lists the WCS keywords that are necessary to specify a complete FITS WCS in the image extension header.
Keyword |
Update |
Value |
Meaning |
---|---|---|---|
|
Deleted |
|
Deprecated keyword |
|
Deleted |
|
Not used for WCS |
|
Added |
|
Celestial coordinate reference frame |
|
Added |
|
Number of axes in WCS description |
|
Updated |
|
Coordinate type for axis1 |
|
Updated |
|
Coordinate type for axis2 |
|
Updated |
|
Coordinate units for axis1 |
|
Updated |
|
Coordinate units for axis2 |
|
Updated |
|
CCD to image offset: axis1 |
|
Updated |
|
CCD to image offset: axis2 |
|
Updated |
(see below) |
Derivative of World Coordinate values |
The CD matrix is given by the following:
where:
In the above, platescale is in arcsec/pixel, PA
is the position angle in degrees given by this keyword value, and \(\theta\) is measured from North through East.
For both GMOS instruments, \(\theta=0\) yields an orientation where N is down and E is to the left.
Refining the Reference Coordinates¶
The world coordinates at the reference pixel are taken from the commanded telescope pointing, which may be off by up to a few arcmin. The WCS zero-point can be adjusted by correcting the CRVALi keywords with offsets determined from stars in the field. Often this correction can be determined using the SAOImage DS9 image display tool. The process is:
Process the image through bias- and flat-fielded correction
Display the image in DS9
From the pull-down menu, select “WCS \(\rightarrow\) degrees” for the coordinate display
Select Analysis \(\rightarrow\) Catalogs \(\rightarrow\) Optical \(\rightarrow\) USNO UCAC3
Compare the pattern of star locations with those of the catalog, as shown below
Select any star from the catalog (sorting by RA or Dec may help) and:
record the coordinates from both the catalog star and the image display cursor at the position of that star in the image
compute the difference (i.e., the offset values in degrees) in each coordinate
Update the
CRVAL1
andCRVAL2
keyword values with these offsets
Highly Accurate WCS¶
If your science objectives require a highly accurate WCS you must determine a full WCS solution with community software, such as the IRAF mscred.mscfinder.msctpeak
task (see the tutorial).
An astrometric catalog will be needed for this calibration; magnitudes in the same bandpass will be needed for the photometric calibration.
Although the process to fit a full WCS solution is involved, it is possible to characterize optical distortions into the WCS (using the TNX
projection); RMS uncertainties of 200 mas should be achievable.
Refined Imaging WCS¶
Solving for the WCS in a image requires using community software. There are a few possibilities, some of which also require local access to an astrometric catalog. The options include:
The IRAF MSCRED package (requires catalog)
The astrometry.net software (downloading & installing software may be necessary)
Using Aladin to determine WCS, and transferring the keywords to the header manually
Using the USNO image and catalog service
Refined Spectroscopic WCS¶
It is possible to refine the zero-point of the wavelength calibration if night-sky emission lines are present in your spectrogram, using the rv package. See IFU Wavelength Alignment for details.
Advanced Longslit WCS¶
It is possible to create a linear WCS that will describe the RA and Dec along the slit, as well as wavelengths in the dispersion direction, by introducing a degenerate third image axis, as described by Calabretta & Greisen (2002, A&A, 395, 1077; Sect. 7.4.3).