-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.old
288 lines (193 loc) · 9.79 KB
/
README.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
STISEXTRACT (v1.3)
----------------------------------
J. Christopher Howk
Kenneth R. Sembach
March 5, 2001
----------------------------------
I. INTRODUCTION:
----------------
STISEXTRACT is a set of IDL procedures designed to extract
high-resolution echelle data from the Space Telescope Imaging
Spectrograph (STIS), estimate the on-order background spectrum, and
remove the background spectrum from the data. The procedure is
described by Howk & Sembach (2000, Astron. Journ., in press).
This software is freely distributed to all interested parties.
However, in return we ask the following: (1) Astronomers using this
software should send us an email telling us they are doing so (so that
we can announce any updates or prominent bug fixes). (2) In your
papers discussing data reduced with our algorithm, please reference
the Howk & Sembach (2000) paper. (3) Please inform us if you find any
bugs, or if you make potentially important modifications to the code.
In the latter case, please document your changes in the header and
send us an email copy of the procedure.
II. INSTALLATION:
-----------------
The steps to installing the STISEXTRACT distribution are as follows.
0) Create a directory (rootdir) in which to install STISEXTRACT and
copy the tar file to that directory.
1) Unpack the STISEXTRACT tar file with:
tar -xvf stisextract_v1.3.tar
This makes a directory tree beginning with stisextract/ as its root.
2) Edit your IDL startup file so that the !help_path includes
the stisextract/help/ directory:
Example:
!help_path= '/home/vulpecula/howk/idl/stisextract/help:'+!help_path
4) Make sure your .idlstartup file is located in your home directory or else
set the appropriate path with the unix environment variable IDL_STARTUP
Example: setenv IDL_STARTUP /home/vulpecula/howk/.idlstartup
5) Make sure that your IDL_PATH environment variable includes the
stisextract/ directory.
Example: setenv IDL_PATH +/home/vulpecula/howk/stisextract:$IDL_PATH
Don't forget that leading "+" symbol. It allows IDL to search down the
directory tree established by STISEXTRACT.
III. REDUCING YOUR STIS DATA:
-----------------------------
Using STISEXTRACT to reduce your high-resolution STIS echelle mode data
is a two part process. The first step is to produce the rectified two
dimensional images using the standard CALSTIS distribution within IRAF
(this can be obtained from the STScI web page). The second is to run
STISEXTRACT from within IDL. We detail these steps below:
1) Create rectified two dimensional images using the standard CALSTIS:
First you must use the standard STScI CALSTIS distribution within IRAF
to produce rectified two dimensional images of each spectral order within
your observation. These images will be stacked within a FITS file entitled:
rootname_x2d.fits -or- rootname_sx2.fits
where rootname is the STScI archive rootname for your particular
observations. The latter file type is produced if you have multiple
exposures within the same observation and requires the header keyword
RPTCORR to be set to PERFORM (more on this below). These files are
created from:
rootname_raw.fits (rootname_wav.fits)
The _wav file is only present if a wavelength image was created.
The standard processing done by STScI before sending you your data
typically do not produce the rectified images discussed above.
The first step in producing the _x2d or _sx2 files for an observation
is to adjust several values in the image headers. Header keywords can
be adjusted using the IRAF task hedit:
hedit filename KEYWORD NEWVALUE update+
We suggest setting the following:
IRAF> hedit rootname_raw.fits[0] X2DCORR PERFORM update+
IRAF> hedit rootname_raw.fits[0] RPTCORR PERFORM update+
The first is absolutely essential: without it no _x2d files will be
produced. The second will coadd all of the exposures within a given
observation before extraction. STISEXTRACT is currently not able
to recognize multiple exposures in an _x2d file.
The next step is to make sure that you have the appropriate reference
files for recalibration and that they are in a directory IRAF will
recognize. This is discussed in the CALSTIS help pages within IRAF.
We recommend making sure you are always using the 'best' calibration
reference files. You can download a list of appropriate reference
files for a given observation at the web page:
http://www.stsci.edu/cgi-bin/cdbs/getref.cgi
which is the same as using the IRAF task getref at STScI. You can
then use upref to load the downloaded information into your image
headers. See the upref help pages within IRAF. Be sure you have the
appropriate reference files before trying to recalibrate your data;
you may need to request the best reference files from the HST data
archive.
After adjusting the image headers to reflect your choice of reference
files and processing options, simply run the following:
IRAF> calstis rootname_raw.fits
This should, if all goes well, produce the required _x2d or _sx2 data
files.
2) Extract your spectra using the STISEXTRACT software within IDL:
This is the easy part. To run the extraction software distributed
within STISEXTRACT, do the following within IDL:
IDL> stisdriver, 'rootname'
where rootname should be replaced by the STScI archive rootname of
your data. This will go through each order in the _x2d file (updating
you on its progress as it goes) and derivie the on-order background,
subtract it from the gross data, and write the results to an IDL save
file. It will also output a postscript file showing the net and
background fluxes for each spectral order (three orders to a page).
This postscript file is stored in ROOTNAME.ps (where ROOTNAME is the
archival rootname in all caps). If you wish to use an _sx2 file,
use the following call to stisdriver:
IDL> stisdriver, 'rootname', /summed
By default, versions 1.3 and later of this software identify the
spectral trace in a 2D image by fitting a Gaussian profile to the
average cross-dispersion profile of the image. These versions also
look at the residuals of this Gaussian fit and attempt to identify
other interloping spectral orders that might adversely affect the fit
to the background. If such interlopers are present and near the edge
of the image, these versions of the software mask out the interloping
orders in the background fitting process.
This approach to identifying the spectral trace of the order of
interest and any interlopers is a slight departure from the algorithm
reported in Howk & Sembach (2000). One can run the extraction
routines using the older method of identifying spectral traces by
doing the following:
IDL> stisdriver, 'rootname', /nogauss
It should be noted that the new approach is more robust to the use of
non-optimal CALSTIS reference files.
The series of routines driven by this procedure will produce one IDL save
file for each order within your observations. Each file is named:
rootname.mmm.save
where mmm is the three digit spectral order contained in the save file.
To access these data, type:
IDL> restore,'rootname.mmm.save'
This will read the following one-dimensional IDL variables into your
system:
wave -- Wavelength array in Angstroms.
gross -- Raw extracted flux before background subtraction
bg -- Derived on-order background
flux -- Derived net flux (=gross-bg)
err -- Formal error array (does not include background error)
order -- Current spectral order mmm.
If you would rather have the data saved to a series of ascii files
named with the convention
rootname.mmm.dat
you can run the stisdriver routine with the following keyword:
IDL> stisdriver, 'rootname', /ascii
This will produce ascii files with columns corresponding to the wave,
gross, flux, err, and bg vectors described above (in that order).
Currently the software does not automatically produce a postscript
plot when using ascii files for output. This is because reading in
the ascii files for the number of files produced by our routines takes
a significant amount of time. One can produce the postscript plot for
a given observation after producing the output ascii files by doing
the following:
IDL> plotorders, 'rootname', /ascii
Should you decide to convert save files of an observation to ascii at
some later point, simply type
IDL> stis_asciiconvert
and all of the information in the IDL save files in the current
directory will be copied to the appropriate ascii files.
What you do from this point is up to you, but you have in your hands
the end result of our extraction software. Minimal help pages have
been created detailing the purposes of each of the procedures in the
STISEXTRACT distribution. These can be accessed through the old-style
IDL help by typing:
IDL> widget_olh
or
IDL> man
Also, most of the procedures will give a calling sequence by simply
typing the procedure name with no arguments. For example:
IDL> stisdriver
produces:
STISDRIVER, rootname, /summed, /skip, /ascii, /nogauss
*Inputs:
rootname -- STIS _x2d or _sx2 rootname.
*Keywords:
/summed -- Use _sx2 FITS file.
/ascii -- Output ascii files rather than IDL save files.
/skip -- Skip the first order of the observation.
/nogauss -- Do not use Gaussian to identify spectral trace.
IV. REPORTING ERRORS AND BUGS:
------------------------------
Error and bug reports should be sent to:
or
J. Christopher Howk
The Johns Hopkins University
Dept. of Physics & Astronomy
3400 N. Charles St.
Baltimore, MD 21218
V. THANKS:
----------
Thanks to J. Lauroesch and D. Meyer for testing the early versions of
this distribution and identifying several areas for fixes. Thanks
also to the file-access suggestion from W. Landsman, which has allowed
us to increase the speed of these routines significantly.