Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.stsci.edu/hst/wfc3/documents/WFC3_aXe_cookbook.pdf
Äàòà èçìåíåíèÿ: Unknown
Äàòà èíäåêñèðîâàíèÿ: Sat Mar 1 15:37:12 2014
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: ï ï ï ï ï ï ï ï
The WFC3 IR Grism Data Reduction Cookbook
for Automated Extraction and Calibration of Slitless Spectra Harald Kuntschner, Martin Kummel, Jeremy R. Walsh ¨ Space Telescope European Coordinating Facility Editor: Janice C. Lee, STScI Version 1.3 March 11, 2013

1


Contents
1 List of acronyms 2 Intro duction 2.1 aXe and aXeSIM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Calibration and reference files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Example dataset 4 Reducing WFC3 IR grism data 4.1 Setup of directories and files . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Combination of direct imaging: astrodrizzle (and multidrizzle) . . 4.2.1 Multidrizzle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.2 Astrodrizzle . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Source detection: SExtractor . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Pro jection of master ob ject catalog to individual observations: iolprep 4.5 Building Input Image Lists . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Preparing the spectral extraction: axeprep . . . . . . . . . . . . . . . . 4.7 Extracting individual spectra: axecore . . . . . . . . . . . . . . . . . . 4.8 Combining dithered exposures: axedrizzle . . . . . . . . . . . . . . . . 4.9 Description and summary of output products . . . . . . . . . . . . . . . 4.9.1 SPC-file ­ extracted 1-dimensional spectra . . . . . . . . . . . . . 4.9.2 STP-file ­ extracted 2-dimensional spectral images . . . . . . . . 4.9.3 MEF-file ­ calibrated spectral stamps . . . . . . . . . . . . . . . . 4.9.4 OAF-file ­ extraction geometry . . . . . . . . . . . . . . . . . . . . 5 Quality control and simulations with 5.1 Basic data products check . . . . . . 5.2 Web page creation with aXe2web for 5.3 Simulations with aXeSIM . . . . . . 6 Troublesho oting 7 Acknowledgements A Parameter set of main aXe A.1 iolprep parameters . . . A.2 axeprep parameters . . . A.3 aXecore parameters . . . A.4 drzprep parameters . . . A.5 axedrizzle parameters . tasks ... ... ... ... ... 3 4 4 5 5 5 8 10 10 11 11 13 15 16 17 18 19 19 21 21 22

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

aXeSIM 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 visual inspection . . . . . . . . . . . . . . . . . . . 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 27 28 30 30 30 30 31 31

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

B Parameter set of main aXeSIM task 32 B.1 simdata parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2


1

List of acronyms
Software package for extraction of spectra from HST grism observations Simulation package for HST grism spectroscopy Stand alone python package to produce grism spectra Web pages "Normal" image of the target field taken with a given filter Early Release Science The Flexible Image Transport System Field-of-View Grism image taken with one of the grisms inserted into the path Infrared Pixel Extraction Table Space Telescope European Coordinating Facility Space Telescope Science Data Analysis System World Coordinate System Wide-Field-Camera 3

aXe aXeSIM aXe2web Direct image ERS FITS FOV Grism image IR PET ST-ECF STSDAS WCS WFC3

3


2

Intro duction

Slitless spectra are often considered 'difficult' in comparison with long slit spectra to extract and calibrate. This arises from the fact that the zero point of the wavelength scale is not fixed, but set by the position of the dispersed ob ject in the field, since there is no physical slit. Moreover, the overlap of spectra can lead to spectral confusion. These difficulties can be surmounted by dedicated software. This cookbook presents a short guide through a basic WFC3 IR grism (G141) data reduction performed with the aXe data reduction package (Pirzkal et al. 2001, Kummel et al. 2009). Some ¨ suggestions about quality checks of the results are provided in Sec. 5, including simulations with the package aXeSIM. Throughout the document we use the aXe package released as part of STSDAS 3.16 in 2013 April and aXeSIM package version 1.3. The purpose of this document is to provide a concise presentation of all steps involved in a basic aXe data reduction. For more detailed information please refer to the aXe and aXeSIM manuals provided on the Web (aXe Manual and aXeSIM Manual). The instructions and commands needed to perform the example data reduction are all provided so that the user can reproduce the results and modify the commands for their own data and requirements. The essence of the aXe software is to drive the extraction by a catalogue of the ob jects which are in the field of the slitless spectrum image, and by parameter files which calibrate the positioning of the spectra, the wavelength dispersion solution and the conversion from extracted detector units to physical units. The aXe software has been designed to operate automatically given a specified instrument mode, the ob ject catalogue and the requisite data. It enables extraction of thousands of spectra without user interaction. Important remarks or comments are indicated throughout the cookbook by the following symbol:


For example,


2.1

Cutting and pasting from the cookbook PDF file to run PyRAF commands works on most operating systems. However, depending on your detailed setup (fonts, language setting), and especial ly when quotation marks and underscores are included, this has caused problems. If in doubt simply type the command directly into your shel l.

aXe and aXeSIM

The software packages aXe and aXeSIM (Pirzkal et al. 2001, Kummel et al. 2009) are distributed ¨ as sub-packages to STSDAS under analysis.slitless.axe and analysis.slitless.axesim. For installation instructions please refer to the Web pages for aXe and aXeSIM. Further information on the STSDAS package can be found at STSDAS Home.



The aXe software package cannot work directly on data taken in sub-array mode. Data taken in sub-array mode must first be embedded in a ful l frame, before reduction with aXe. A python script which does this is available from the WFC3 Grism Resource Webpage under "aXe Spectral Extraction Software."

4


Table 1: Summary of input data files used in this cookbook
FILE ib6o23rsq ib6o23rtq ib6o23ruq ib6o23rwq ib6o23ryq ib6o23rzq ib6o23s0q ib6o23s2q FILTER G141 F140W G141 F140W G141 F140W G141 F140W DATE-OBS 2009-10-03 2009-10-03 2009-10-03 2009-10-03 2009-10-03 2009-10-03 2009-10-03 2009-10-03 TIME-OBS 14:43:57 15:02:54 15:07:35 15:24:52 16:15:13 16:34:10 16:38:51 16:56:08 EXPTIME 1102.935669 202.932922 1002.935364 202.932922 1102.935669 202.932922 1002.935364 202.932922 POSTARG1 -10.012000 -18.838249 9.988000 1.161730 9.971000 1.162243 -9.958000 -18.766710 POSTARG2 5.058000 5.026986 5.050000 5.053683 -5.045000 -5.041331 -5.054000 -5.084905

flt.fits flt.fits flt.fits flt.fits flt.fits flt.fits flt.fits flt.fits

2.2

Calibration and reference files

The aXe data reduction software is not instrument specific1 but instrument parameters are provided through a configuration file. Reference files for flux calibration, as well as special flat fields, also must be provided. To facilitate an accurate global background subtraction, a master sky is provided for both grisms. The files are available from the WFC3 grism Web pages at STScI (see also Kuntschner et al. 2009).

3

Example dataset

The data used in this cookbook originates from the WFC3 Early Release Science (ERS) II campaign (PID: 11359, PI: R. O'Connell). The WFC3 IR channel has a field of view of 123 x 136 arcsec at a resolution of 0.13 arcsec/pixel. The ERS II grism field lies in the north-central region of Chandra Deep Field South (J2000 53.071121 -27.709646 [degrees]). The data reductions for the two IR grisms (G102 and G141) are very similar (Straughn et al. 2010) and differ only in the use of separate input data, configuration and reference files; therefore we present in this cookbook only the example reduction for the G141 grism. There are four individual exposures in the F140W filter and four individual grism G141 images. The images were dithered mostly along the x-axis. Fig. 1 shows the general layout of the observed field and Table 1 provides information on filenames, exposures times and dither steps ("POSTARG1" and "POSTARG2").


4

The input files for this example data reduction were taken from a standard calwf3 pipeline reduction of the observing program. Note, that aXe works only with the flt.fits files and does not make use of any of the other files (e.g., drz.fits) which are produced by the standard calwf3 pipeline.

Reducing WFC3 IR grism data

We first give an overview of the basic steps involved in extracting spectra from grism images that typically contain traces from several hundred ob jects (see Fig. 2). Each of the steps below will then
1 The aXe package has b een extensively used for HST/ACS grism sp ectroscopy (e.g., Pirzkal et al. 2001; 2004; 2009, Pasquali et al. 2006) and also for the HST NICMOS G141 grism (Freudling et al. 2008).

5


-27.68

-27.70 DEC [deg] -27.72 -27.74

53.10

53.08 RA [deg]

53.06

53.04

Figure 1: Layout of the ERS II F140W observations. The colors represent different pointings.

be described in more detail in the sections that follow. · Make the direct image catalogue (SExtractor; §4.3). This step generates information on ob ject position and size for all ob jects in the field and creates a master ob ject catalogue. These measurements are later used to define extraction boxes and calculate wavelength solutions in the extraction step. Typically, the ob ject information is derived from a drizzled direct image which captures the full FoV (§4.2). · Pro ject the master ob ject catalogue p ositions to the co ordinate system of individual direct images (iolprep; §4.4). Since the individual images typically are dithered, the master ob ject catalogue positions need to be transformed to the coordinate system of each direct image­ grism image pair. · Prepare the grism images and remove sky background (axeprep; §4.6). In this step the units of the grism images are checked and a scaled master sky background is subtracted to achieve a homogeneous background level ready for spectral extraction. · Extract sets of pixels containing sp ectra for each ob ject. (axecore; §4.7). For each individual grism image the 2-dimensional spectra of all ob jects in the transformed catalogue are extracted and stored in a Pixel Extraction Table (PET). · Combine all available sp ectra of each ob ject using drizzle techniques (axedrizzle; §4.8). For each ob ject, the available 2-dimensional spectra are combined with the help of drizzle techniques. The results are saved in the form of calibrated, 2-dimensional spectral FITS images and as extracted 1-dimensional FITS tables, including information on counts, fluxes, and an estimate of the spectral overlap by other ob jects (hereafter referred to as "contamination"). · View results for all extracted ob jects on webpages (aXe2web; §5.2). For convenient visualization and quality control, Web pages showing the basic results (direct image cutout of 6


Figure 2: Example of one G141 grism exposure (ib6o23rsq flt.fits) showing spectral traces of more than 100 sources.

the ob ject, 2-dimensional spectral FITS image and extracted 1-dimensional spectrum in counts and flux units) for each ob ject may be produced. For the purpose of this cookbook we assume that the PyRAF STSDAS implementation of the aXe and aXeSIM packages is used. Commands issued on an xterm are indicated by the following symbol > whereas commands issued within a PyRAF environment are shown as --> For example, starting PyRAF and loading the aXe package would be shown as > pyraf --> stsdas --> analysis --> slitless --> axe In general PyRAF commands can also be conveniently run in Python. Below we show an example of a PyRAF command and the equivalent script for Python. PyRAF: --> axecore G141.lis WFC3.IR.G141.V2.5.conf extrfwhm=4.0 drzfwhm=3.0 back=no backfwhm=0.0 orient=no slitless_geom=no cont_model=gauss sampling=drizzle An equivalent Python script would read as: 7


from pyraf import iraf from iraf import stsdas, analysis, slitless, axe iraf.axecore(inlist="G141.lis", configs="WFC3.IR.G141.V2.5.conf", extrfwhm=4.0, drzfwhm=3.0, back="no", backfwhm=0.0, orient="no", slitless_geom="no", cont_model="gauss", sampling="drizzle")

4.1

Setup of directories and files

Before any data reduction can start a sensible directory structure should be created and environment variables set. The directory structure we use here has the top level directory G141 example with sub-directories (e.g., save, IMDRIZZLE, ...) given as follows: G141_example save IMDRIZZLE CONF DATA OUTPUT DRIZZLE A brief description of the purpose for each directory is first given. The commands required to carry out the directory set-up then follow. · save: A pristine copy of the original input data is kept in this directory. Before an aXe run, all content is copied to the 'DATA' directory. This separation is needed since the aXe reduction modifies the input data and it is best to keep a clean copy in case one wants to re-run the reduction with a different parameter set. · IMDRIZZLE: This directory is used to create a deep direct image of the field with the PyRAF astrodrizzle or multidrizzle tasks. It is important to have a separate directory since the drizzle tasks modify the input images and this can lead to conflicts with other software packages such as aXe. · CONF: All necessary aXe configuration and aXe reference files are stored here. · DATA: This directory contains the input data flt.fits files that will modified during the aXe reduction. · OUTPUT: This directory stores intermediate output products and the results of the extractions from single grism images. · DRIZZLE: The results of the axedrizzle reduction are stored here. These files comprise the final results where all the available grism data is combined together. The steps that need to be carried out to complete the setup for the reduction process are: · Step 1: Put the complete set of direct images and grism images in flt.fits format (see Tab. 1) in the directory G141 example. · Step 2: Create subdirectories and move the input data into the save directory.

8


Table 2: Required G141 Configuration and Reference Files WFC3.IR.G141.V2.5.conf WFC3.IR.G141.0th.sens.1.fits WFC3.IR.G141.1st.sens.2.fits WFC3.IR.G141.2nd.sens.2.fits WFC3.IR.G141.3rd.sens.2.fits WFC3.IR.G141.m1st.sens.2.5.fits WFC3.IR.G141.flat.2.fits WFC3.IR.G141.sky.V1.0.fits G141 configuration file G141 sensitivity 0th order G141 sensitivity +1st order G141 sensitivity +2nd order G141 sensitivity +3rd order G141 sensitivity -1st order aXe G141 flat-field cube G141 master sky image

> mkdir save IMDRIZZLE CONF DATA OUTPUT DRIZZLE > mv *_flt.fits save · Step 3: Point with environment variables to these directories by e.g., executing the following commands in your shell or placing equivalent commands in your .bashrc file. export export export export AXE_IMAGE_PATH=DATA AXE_CONFIG_PATH=CONF AXE_OUTPUT_PATH=OUTPUT AXE_DRIZZLE_PATH=DRIZZLE

If you are using a tcsh/csh shell, please use the equivalent commands such as: setenv AXE IMAGE PATH DATA. Note that axedrizzle does not accept path+file names that are longer than 80 characters, so please specify an AXE DRIZZLE PATH accordingly. This issue wil l be addressed a future version of aXe. · Step 4: Put the appropriate aXe configuration and aXe reference files and the master sky image into the CONF directory (see also Sec. 2.2 and the WFC3 Web pages). For the G141 grism the required files are listed in Table 4.1. · Step 5: The final step of this section is to get an overview of the data by checking the data type and other information. It is often convenient to prepare ASCII files containing lists of images which one wants to work on. Information for each image can be derived from simple IRAF commands such as those given below. > cd save > pyraf --> hedit *_flt.fits[1] FILTER ib6o23rsq_flt.fits[1],FILTER = ib6o23rtq_flt.fits[1],FILTER = ib6o23ruq_flt.fits[1],FILTER = ib6o23rwq_flt.fits[1],FILTER = ib6o23ryq_flt.fits[1],FILTER = ib6o23rzq_flt.fits[1],FILTER = ib6o23s0q_flt.fits[1],FILTER = ib6o23s2q_flt.fits[1],FILTER =

. updateG141 F140W G141 F140W G141 F140W G141 F140W 9


An ASCII file list of F140W images named F140W.lis can be prepared with the help of an text editor. The IRAF task hselect may also be used to generate a file list based on header keyword values. The resulting file looks like this: --> !more F140W.lis ib6o23rtq_flt.fits ib6o23rwq_flt.fits ib6o23rzq_flt.fits ib6o23s2q_flt.fits In order to keep a clean copy of the original input data we copy the direct image files into the IMDRIZZLE directory where we will produce the combined deep image and the master ob ject catalogue. --> copy @F140W.lis ../IMDRIZZLE --> copy F140W.lis ../IMDRIZZLE

4.2

Combination of direct imaging: astrodrizzle (and multidrizzle)

A deep image of all exposures in the observed FoV needs to be prepared. There are many advantages to combining multiple exposures. The most important ones are the rejection of deviant pixels (e.g. remaining cosmic rays, hot or bad pixels), and the increase in depth. Since in this example we have four dithered direct images available, we combine them using the PyRAF task astrodrizzle in the STSDAS package DrizzlePac.



We note that astrodrizzle is new software that replaced multidrizzle in 2012. The aXe package, however, was original ly written to support Multidrizzle formatted astrometric information. Beginning with aXe released in STSDAS version 3.16, aXe reduction tasks can accommodate the use of new Astrodrizzle products, while remaining back-compatible with Multidrizzle. For more detailed information on Astrodrizzle please see the DrizzlePac website. Here, use of both astrodrizzle and multidrizzle are il lustrated, but adoption of astrodrizzle is strongly recommended since multidrizzle is no longer supported by STScI. In the basic grism reduction il lustrated in this cookbook, a switch to Astrodrizzle products wil l only affect the aXe routine iolprep as described in §4.4 below. Multidrizzle

4.2.1

Here, we use the final version of multidrizzle which is available in STSDAS. For multidrizzle to work properly, we need to set up the local "iref" directory if this is not already available. Point with an environment variable to the directory in your shell or place the command in your .bashrc file as follows. Copy the needed version of the IDCTAB reference table (u1r16228i idc.fits for the data used in this cookbook; see the STScI WFC3 Calibration Website), containing multidrizzlestyle information on the geometric distortions, into the directory. Putting the IDCTAB table in the local directory with the direct images also works. For more details please refer to the WFC3 Data Handbook. > export iref=/mydisk/myiref/ > cp u1r16228i_idc.fits /mydisk/myiref/ If you are instead using tcsh/csh, set the environment variable via setenv iref /mydisk/myiref/. In PyRAF continue with the direct image combination. 10


Figure 3: The "drizzled" direct image (F140W drz.fits; [SCI] extension) showing the full FoV and covering about 160 â 133 arcsec. The horizontal streak next to the bright star originates from persistence effects on the detector caused by preceding grism observations of the same field (see also Tab. 1).

--> --> --> --> -->

cd ../IMDRIZZLE stsdas dither unlearn multidrizzle multidrizzle '@F140W.lis' output='F140W' final_rot='INDEF'

The output is the co-added image F140W drz.fits (see Fig. 3). Some artifacts (e.g., persistence, dead pixels) are clearly visible, and this should be kept in mind later on during catalogue creation. 4.2.2 Astrodrizzle

Here, we use astrodrizzle in STSDAS drizzlepac. The steps are analogous to those above for multidrizzle, except that the need for the IDCTAB reference table is now obviated. --> --> --> --> import drizzlepac from drizzlepac import astrodrizzle unlearn astrodrizzle astrodrizzle.AstroDrizzle('@F140W.lis',output='F140W',build=yes)

4.3

Source detection: SExtractor

Now that we have a deep, combined F140W image of the observed field, we can derive the needed information on ob ject positions, sizes and ma jor axis orientation angle from the image. A convenient and

11


readily available task for this is SExtractor (Bertin & Arnouts 1996; see http://www.astromatic. net/software/sextractor). · Step 1: generate a SExtractor default file (default.sex) and adjust the parameters file. For this simple example we used the default setup with the following adjustments2 . Higher values of the following parameters will select brighter sources. DETECT_MINAREA DETECT_THRESH ANALYSIS_THRESH 7 3.0 3.0 # minimum number of pixels above threshold # or , in mag.arcsec-2 # or , in mag.arcsec-2

· Step 2: isolate the science and weight extensions of the co-added F140W image. --> imcopy F140W_drz.fits[SCI] F140W_drz_sci.fits --> imcopy F140W_drz.fits[WHT] F140W_drz_wht.fits · Step 3: adjust the file responsible for the output list content (default.param). The necessary fields for aXe are: NUMBER, X_IMAGE, Y_IMAGE, X_WORLD, Y_WORLD, A_IMAGE, B_IMAGE, THETA_IMAGE, A_WORLD, B_WORLD, THETA_WORLD, MAG_AUTO



It is important that al l SExtractor output fields given above are present. Additional fields do not disturb the fol lowing reduction.

· Step 4: run SExtractor to produce the master ob ject catalogue. We use in this example the output catalogue name F140W.cat. > sex -c default.sex -WEIGHT_IMAGE F140W_drz_wht.fits -MAG_ZEROPOINT 26.46 -CATALOG_NAME F140W.cat F140W_drz_sci.fits An example of the output catalogue file (F140W.cat) from the SExtractor task is given in the following:
# # # # # # # # # # # # 1 2 3 ... 1 NUMBER Running object number 2 X_IMAGE Object position along x 3 Y_IMAGE Object position along y 4 X_WORLD Barycenter position along world x axis 5 Y_WORLD Barycenter position along world y axis 6 A_IMAGE Profile RMS along major axis 7 B_IMAGE Profile RMS along minor axis 8 THETA_IMAGE Position angle (CCW/x) 9 A_WORLD Profile RMS along major axis (world units) 10 B_WORLD Profile RMS along minor axis (world units) 11 THETA_WORLD Position angle (CCW/world-x) 12 MAG_AUTO Kron-like elliptical aperture magnitude 1068.231 145.935 5.3084350628e+01 -2.7692458920e+01 12.533 1043.301 60.690 5.3082445468e+01 -2.7689782110e+01 5.692 1154.522 29.426 5.3086403599e+01 -2.7687624369e+01 2.540 [pixel] [pixel] [deg] [deg] [pixel] [pixel] [deg] [deg] [deg] [deg] [mag] 6.509 -44.3 0.0004379272 0.0002476719 5.356 -43.5 0.0002022316 0.0001913925 2.087 -66.2 8.912657e-05 7.600131e-05

52.8 52.0 80.3

18.2001 18.2335 22.6103

2 A default SExtractor file can b e dump ed with the command sex -dd > default.sex and then mo dified with an editor. You will also need a default.conv file which you an easily find on the internet if it is not available on your system.

12




The creation of the master object catalogue is fundamental to the data reduction, since al l further reduction steps critical ly depend on it. Only objects correctly detected at this stage can later on be extracted from the grism images. Furthermore, spurious object detections wil l lead to wrong contamination predictions and should therefore be avoided. We strongly recommend to overplot the SExtractor source catalogue (F140W.cat) on the drizzled direct image (F140W drz.fits) as shown in Fig. 4. This can be achieved by producing, for example, a region file to be displayed in ds9 or in IRAF with tvmark. An introduction to ds9 can be found at e.g. http://chandraed.harvard.edu/learning ds9overview.html. Please adjust the SExtractor list of detection parameters to achieve the desired result. It is also important to set the correct ABmag zero-point (-MAG ZEROPOINT 26.46 for F140W) in the SExtractor run, since these magnitudes (MAG AUTO) are used by the aXe software to estimate the level of spectral overlap between sources (i.e. contamination). Always use the latest information on zero-points provided at http://www.stsci.edu/hst/wfc3/phot zp lbn. If the SExtractor information for individual objects or object classes is inadequate, then one can edit the master object catalogue with an editor or a scripting language. In this way one could, for example, also insert objects for which the position and size is known from other observations but fail to be detected on the WFC3 imaging. Object positions may e.g. be determined with the IRAF task imexam. If SExtractor cannot estimate a magnitude for an object it assigns a magnitude of "99". This value of magnitude leads to an error in the aXe reduction software. Either replace the magnitude with a realistic number or remove the object from the Master catalogue. SExtractor can be run with the option to produce a so cal led "segmentation map" (use -CHECKIMAGE TYPE SEGMENTATION in the SExtractor cal l). The resulting extra FITS image is cal led check.fits and displays patches corresponding to pixels attributed to each object. The value of each patch corresponds to the SExtractor catalogue number.


4.4

Pro jection of master ob ject catalog to individual observations: iolprep

For typical grism observations, one obtains for each grism exposure a direct image at the same (or close to the same) position on the sky. The purpose of this section is to pro ject the deep master ob ject catalogue back to the individual direct images and create an individual catalogue for each grism image. If multidrizzle products are used, this step must be carried out in the same data directory where the multidrizzle coefficient files are stored (i.e. IMDRIZZLE). We also use this step to prepare information on spectral cross-contamination estimates which aXe will derive in a later step if the catalogues are setup correctly. In its basic mode, the aXe software needs to know the magnitudes of all ob jects in the catalogue. For further details and information on computing more sophisticated contamination estimates see the aXe Manual. · Step 1: modify the master ob ject source list so that contamination estimates can be derived. This is triggered by renaming the column for the source brightness, MAG AUTO to MAG F1392 (column #12 in our example), with the pivot wavelength of the F140W filter being 1392 nm. We call this catalogue F140W prep.cat. The pivot wavelength for all WFC3 filters is provided at http://www.stsci.edu/hst/wfc3/phot zp lbn.

13


Figure 4: An F140W image subregion (24 â 14 arcsec) with sources indicated (plus signs) as detected by SExtractor.

· Step 2: load the aXe package and run the aXe task iolprep on the drizzled output image F140W drz.fits --> axe --> unlearn iolprep For multidrizzled images: --> iolprep F140W_drz.fits F140W_prep.cat dimension_in='+100,0,0,0' For astrodrizzled images, one additional parameter must be set to direct the task to use the astrometric solution stored by astrodrizzle in the header, instead of the previous multidrizzle formatted astrometry: --> iolprep F140W_drz.fits F140W_prep.cat dimension_in='+100,0,0,0' useMdriz=no This aXe task uses the information in the drizzled image to produce a separate ob ject catalogue for each individual input image. The four, comma separated values specified for the dimension in parameter define the region (in units of pixels) outside the input image FoV which should be taken into account. This is important since for WFC3 IR G102 and G141 grism spectroscopy the +1st order spectrum is not located at the pro jected position of the ob ject, but rather shifted to increasing x pixel position (see Fig. 5). The task iolprep generates an individual ob ject catalogue for each of the four input direct images. An example (ib6o23rtq flt 1.cat) can be seen below.
... # 10 B_WORLD Profile RMS along minor axis (world units) # 11 THETA_WORLD Position angle (CCW/world-x) [deg] # 12 MAG_F1392 Kron-like elliptical aperture magnitude 1 865.301 159.466 5.3084350628e+01 -2.7692458920e+01 2 842.747 66.900 5.3082445468e+01 -2.7689782110e+01 3 949.859 32.507 5.3086403599e+01 -2.7687624369e+01 ... [deg] [mag] 12.533 6.509 -47.5 0.0004379272 0.0002476719 52.8 18.2001 5.692 5.356 -46.8 0.0002022316 0.0001913925 52.0 18.2335 2.540 2.087 -68.0 0.0000891266 0.0000760013 80.3 22.6103

14


Figure 5: Relative position of direct image position and grism spectra. Top: G102 grism observation of the flux standard star GD153 (program 11552) with a F098M direct image (circled) superimposed to illustrate the relative positions. Spectral orders 0, +1, and +2 can be seen on the image. Bottom: G141 grism observation of the flux standard star GD153 (program 11552) with a F140W direct image (circled) superimposed to illustrate the relative positions. Spectral orders 0, +1, +2, and +3 can be seen in the image. The images show the full extent of the detector in the x-axis (1014 pixels) and about 200 pixels in the y-axis.

4.5

Building Input Image Lists

In order to run the data reduction tasks, we need to determine the correct associations between direct image and grism images for the whole dataset. In this section we describe the simple steps needed to achieve this. · Step 1: determine for each grism image the associated direct image. For example, this can be performed with the tasks dfits and fitsort (see ESO's "Science Archive Stand-alone FITS Tools in ANSI C"). Alternatively, IRAF hedit or hselect can be used. As can be seen from the list below, there is always a pair of grism and direct image taken at a similar position.
> cd mypath/G141_example/save > dfits *_flt.fits | fitsort FILTER POSTARG1 POSTARG2 RA_TARG DEC_TARG FILE FILTER ib6o23rsq_flt.fits G141 ib6o23rtq_flt.fits F140W ib6o23ruq_flt.fits G141 ib6o23rwq_flt.fits F140W ib6o23ryq_flt.fits G141 ib6o23rzq_flt.fits F140W ib6o23s0q_flt.fits G141 ib6o23s2q_flt.fits F140W POSTARG1 POSTARG2 -10.012000 5.058000 -18.838249 5.026986 9.988000 1.161730 9.971000 1.162243 5.050000 5.053683 -5.045000 -5.041331 RA_TARG DEC_TARG 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01 5.307083333333E+01 -2.771111111111E+01

-9.958000 -5.054000 -18.766710 -5.084905

15


· Step 2: prepare an Input Image List (G141.lis) with an editor of your choice. This ASCII file lists in a given row for each grism image the ob ject list to be extracted and the associated direct image. The format is [name of grism image] [object catalogue] [name of direct image] In our example, the file G141.lis would be: ib6o23rsq_flt.fits ib6o23ruq_flt.fits ib6o23ryq_flt.fits ib6o23s0q_flt.fits ib6o23rtq_flt_1.cat ib6o23rwq_flt_1.cat ib6o23rzq_flt_1.cat ib6o23s2q_flt_1.cat ib6o23rtq_flt.fits ib6o23rwq_flt.fits ib6o23rzq_flt.fits ib6o23s2q_flt.fits

· Step 3: Copy the Input Image List (G141.lis) from the save directory to the G141 example directory level. Copy all grism images and direct images from the save directory and the associated catalogues (e.g., ib6o23rtq flt 1.cat) from the IMDRIZZLE directory to the DATA directory. > > > > > cd cp cd cp cp mypath/G141_example save/G141.lis . DATA ../save/*.fits . ../IMDRIZZLE/i*.cat .

4.6

Preparing the sp ectral extraction: axeprep

Before the real spectral extraction can start, the grism images need to be pre-processed. For WFC3 IR grism images the main purpose here is the subtraction of a scaled master sky background image. For other HST grism images (e.g., ACS/WFC or NICMOS) this task is also used to convert the grism images to units of [e- /s]. Due to the combination of ubiquitous overlap of the various grism orders and large scale detector flat-field structure, the background exhibits a marked structure. This background can be removed by subtracting a scaled master sky background (see Fig. 6) from each grism image. The scaling is necessary since overall background levels vary significantly. For example, the G141 background typically shows average values between 0.9 - 2.4 e/s. Besides the Input Image List (G141.lis; including the ob ject catalogue) and the name of the master sky background (WFC3.IR.G141.sky.V1.0.fits) this task also requires as input the configuration file for this grism mode (WFC3.IR.G141.V2.5.conf). This is mainly needed here to determine grism image regions free of spectral traces from ob jects and thus use those "true" sky regions to scale the master background.



If the catalogues are too deep then one can end up in a situation with essential ly no free sky regions. In such a case it is worth generating a special configuration file for this task with a lower object magnitude limit. See the aXe Manual for more details.

--> cd mypath/G141_example --> unlearn axeprep --> axeprep G141.lis WFC3.IR.G141.V2.5.conf backgr='yes' backims='WFC3.IR.G141.sky.V1.0.fits' norm='no'

16


Figure 6: Left: The G141grism image ib6o23rsq flt.fits before background subtraction. Structure caused by detector sensitivity variations is most prominently seen in the lower right corner. Middle: Master sky background for the G141 grism WFC3.IR.G141.sky.V1.0.fits. This image was created by combining more than 100 publicly available grism observations and carefully excluding regions with spectral signatures from ob jects. The dark circular region at the bottom is a region of zero sensitivity on the detector. Right: The background subtracted grism image ib6o23rsq flt.fits. Note, that the small scale as well as large scale background structure has been removed.



Note, that the axeprep task has physical ly changed the flt.fits files for the grism images in the DATA directory by removing the background. If one wants to start a clean new reduction for whatever reason, the files need to be copied again from the save directory.

Congratulations! At this point you have concluded the preparations and are finally ready to run the spectral extraction tasks.

4.7

Extracting individual sp ectra: axecore

This section describes the core spectral extraction task which produces 2-dimensional and 1-dimensional spectra for each ob ject in the Input Ob ject List (the pro jected catalogue) for a given grism image. The task also applies the flat-field information which is noteworthy since the flat-field information is stored in a 3-dimensional, cube format. In slitless spectroscopy every pixel can in principle see signal from a portion of a spectrum with a given but a priori unknown wavelength. The response function of a detector is generally wavelength dependent and for the WFC3 IR detector this information was determined during thermal vacuum ground testing and stored in a flat-field cube. In the aXecore task, the ob ject position and size from a given F140W direct image is pro jected to the associated G141 grism image. The region containing the spectral information for each source and grism order (dubbed a "beam") is then determined and the pixel values are flat-fielded using the wavelength solution for this ob ject. Furthermore, potential contamination from neighboring and/or overlapping ob jects is estimated. As main output, the task produces 2-dimensional spectra ("stamp" images; .STP.fits files) and 1-dimensional summed up spectra (.SPC.fits files), where information for each ob ject in the catalogue is stored in a separate FITS extension (for more detailed information on the output formats see Sec. 4.9). The task, which will run for a while (30 min, depending on processing power), is called as follows. In order to start with a clean setup it is prudent to 'unlearn' the parameter set for axecore. --> unlearn axecore 17


--> axecore G141.lis WFC3.IR.G141.V2.5.conf extrfwhm=4.0 drzfwhm=3.0 back='no' backfwhm=0.0 orient='no' slitless_geom='no' cont_model='gauss' sampling='drizzle' The main inputs to the task are the Input Image List (G141.lis) and the configuration file for the G141 grism (WFC3.IR.G141.V2.5.conf). Further important parameters and their meaning are given in Table 3 (see Appendix A.3 for a full list of axecore parameters). Table 3: Important axecore parameters Parameter extrfwhm drzfwhm back backfwhm orient slitless geom cont model sampling Value 4.0 3.0 'no' 0.0 'no' 'no' 'gauss' 'drizzle' Comment Multiplicative factor for ob ject mask image Multiplicative factor for ob ject mask image after drizzle Create background PET? Multiplicative factor for background mask image Use tilted extraction? Optimize virtual slit geometry? Setting contamination model Setting the sample type

The extraction width extrfwhm is specified to be ±4 times the pro jected width of the source in the direction perpendicular to the spectrum trace. Exactly how this is interpreted in terms of the A IMAGE and B IMAGE values in the Sextractor master ob ject catalogue depends on the values of the parameters orient and slitless geom. The aXe manual provides more details. In this simple example we extract the spectrum with a perpendicular pseudo slit orientation, regardless of the orientation of the (extended) sources on the sky. The extraction of the final spectra will be performed from the drizzled, combined spectral images with an extraction width of drzfwhm (see Sec. 4.8) and for technical reasons extrfwhm should be at least 1 unit larger than drzfwhm. For the WFC3/IR grisms a final extraction factor of drzfwhm = 3 corresponds for point sources to extracting an aperture of 6 pixels and thus about 90% of the flux (for aperture corrections see Kuntschner et al. 2009). Another important parameter to set in the axecore task is the type of contamination model to be used. The 'gauss' model provides quantitive estimates of spectral overlap based on a Gaussian model of the source luminosity distribution (SExtractor A IMAGE and B IMAGE) and its magnitude (MAG F1392 in the pro jected source catalogue). Since we want to combine the data from different exposures with the axedrizzle task (see Sec. 4.8) and also provide a linear wavelength sampling for the extracted 2-dimensional spectral images, we choose here the sampling parameter to be 'drizzle'. For more details please refer to the aXe Manual. The various output files of this task are stored in the OUTPUT directory. For a detailed description of the output and data formats we refer the reader to Sec. 4.9

4.8

Combining dithered exp osures: axedrizzle

In this section we use the task aXedrizzle to co-add the individual, dithered exposures ('beams') for each ob ject to obtain a deep 2-dimensional spectrum with a pre-defined, constant dispersion in wavelength direction and a linear spatial sampling. From this product, the final 1-dimensional spectra are extracted for each ob ject. Similar techniques used in the astrodrizzle and multidrizzle tasks for direct imaging are used by aXedrizzle to combine spectral images, and in the process identify and reject deviating pixels 18


(e.g. undetected cosmic rays, un-flagged bad pixels). This the 2-dimensional spectra, median-combining them, blotting pixels by comparing the original 2-dimensional spectra with The setup for the main task aXedrizzle is performed in

is accomplished by individually drizzling them back and then identifying deviating the blotted back versions. a pre-processing step (drzprep).

--> unlearn drzprep --> drzprep G141.lis WFC3.IR.G141.V2.5.conf back='no' In this preparatory step, flat-fielded spectral images are produced from our internal data storage format ("PET" files) and also drizzle coefficients are determined. The images are stored in the .DPP.fits files. The main combination of individual 2-dimensional spectra is carried out with the task axedrizzle: --> unlearn axedrizzle --> axedrizzle G141.lis WFC3.IR.G141.V2.5.conf 4.0 3.0 back='no' driz_separate='yes' combine_nsigmas="4.0 3.0" driz_cr_snr="5.0 4.0" driz_cr_grow=1 driz_cr_scale="1.2 0.7" Apart from the Input Image List and the configuration file, the axedrizzle task requires a large set of parameters. The parameters infwhm and outfwhm (the 3rd and 4th input parameters in the axedrizzle call above, i.e. 4.0 and 3.0) mirror the axecore parameters extrfwhm and drzfwhm and must be set to the same values. Furthermore, the parameter 'back' must be set to the same value in the tasks axecore, drzprep and axedrizzle. In this example, we use standard drizzle and rejection parameters which have the same meaning as in the astrodrizzle and multidrizzle tasks. It is strongly recommended to carefully set and test these parameters against a "basic" drizzled spectral image (driz separate='no') before any extracted spectra are used for scientific purposes. With the completion of the axedrizzle task, the actual data-reduction of grism spectra is concluded and the output data is ready for inspection. In Sec. 4.9 we describe in some detail the various output products and formats. Note that currently the drizzling is only performed for the +1st order.

4.9

Description and summary of output pro ducts

In the course of the data reduction described above, many output files are produced including 1dimensional spectra and 2-dimensional spectral ('stamp') images, which are stored in the OUTPUT and DRIZZLE directories. All results for one particular ob ject are marked with the so called object ID, which is the entry in the column NUMBER in the SExtractor master ob ject catalogue (see Sec. 4.3) plus one letter indicating the extracted grism order (+1st order = A, 0th order = B, +2nd order = C, . . . see aXe Manual and configuration file for further details). Typically the throughput of the grism is concentrated in the +1st order and is therefore used for the extraction of the science spectra. The extracted 1-dimensional spectra are stored in the SPC-files. Grism 'stamp' images are stored in the STP-files, and the co-added, 2-dimensional, drizzled spectral images are the MEF-files. Important information on the extraction geometry is stored in the OAF-files. We will now explain the most important details of these files and the data format. 4.9.1 SPC-file ­ extracted 1-dimensional sp ectra

The SPC-files have the suffix .SPC.fits, e.g. OUTPUT/ib6o23rsq flt 2.SPC.fits. While an SPC-file in the OUTPUT directory (e.g. ib6o23rsq flt.fits) contains all individually extracted spectra from one grism image (including all BEAMS or spectral orders), only the SPC-file in the DRIZZLE directory, 19


DRIZZLE/aXeWFC3 2.SPC.fits, contains the +1st order 1-dimensional spectra extracted from all coadded drizzled images. The SPC-files are multi-extension FITS tables. A list of all extensions can be obtained with the PyRAF task catfits. Alternatively the FITS files can be explored with TOPCAT, the IDL task mrdfits.pro, or any other FITS reader of your choice. --> stsdas --> catfits DRIZZLE/aXeWFC3_2.SPC.fits EXT# FITSNAME FILENAME EXTVE DIMENS 0 1 2 3 4 5 6 ... DRIZZLE/aXeWF BINTABLE BINTABLE BINTABLE BINTABLE BINTABLE BINTABLE

BITPI OBJECT 16 15Fx201R 15Fx186R 15Fx186R 15Fx185R 15Fx185R 15Fx186R

BEAM_1A BEAM_10A BEAM_100A BEAM_101A BEAM_102A BEAM_103A

1 10 100 101 102 103

The +1st order spectrum of the ob ject with the ID 101 is stored in the extentsion with the name BEAM 101A, which has the index 4 in the above example. Only +1st order spectra ('beams') are drizzled, hence all extension names end with the letter A. Every extension of the SPC-file is itself a FITS table with the columns: --> tlcol DRIZZLE/aXeWFC3_2.SPC.fits[beam_101A] # DRIZZLE/aXeWFC3_2.SPC.fits[BEAM_101A] ID CH*60 %-60s "" N S %11d "" LAMBDA R %15.7g ANGSTROM TCOUNT R %15.7g COUNT BCOUNT R %15.7g COUNT COUNT R %15.7g COUNT TERROR R %15.7g COUNT BERROR R %15.7g COUNT ERROR R %15.7g COUNT FLUX R %15.7g "PHYSICAL UNITS" FERROR R %15.7g "PHYSICAL UNITS" WEIGHT R %15.7g PIXEL CONTAM R %15.7g FLAG DLAMBDA R %15.7g ANGSTROM DQ S %11d DQ The most important columns are: · LAMBDA: the wavelength in ° Angstrom · COUNT: the spectrum in units of counts [e- /s] · ERROR: the error for COUNT · FLUX: the spectrum in [erg /cm2 /s/° A] 20


· FERROR: the error for FLUX Plotting the spectrum in [counts/sec] of ob ject 101 in PyRAF can be done via: --> sgraph "DRIZZLE/aXeWFC3_2.SPC.fits[beam_101A] LAMBDA COUNT" 4.9.2 STP-file ­ extracted 2-dimensional sp ectral images

The STP-files have the suffix .STP.fits and follow the identical naming scheme as the SPC-files. Consequently, the file OUTPUT/ib6o23rsq flt 2.STP.fits contains all grism stamp images from the grism image ib6o23rsq flt.fits and DRIZZLE/aXeWFC3 2.STP.fits the grism stamps from all drizzled images. The STP-files are multi-extension FITS images. A list of all extensions is obtained with the PyRAF task catfits in the STSDAS package: --> catfits OUTPUT/ib6o23rsq_flt_2.STP.fits EXT# FITSNAME FILENAME EXTVE DIMENS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... ib6o23rsq_flt IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE IMAGE ib6o23rsq_flt.fits BEAM_1A WEIG_1A BEAM_1B WEIG_1B BEAM_1C WEIG_1C BEAM_1D WEIG_1D BEAM_1E WEIG_1E BEAM_2A WEIG_2A BEAM_2B WEIG_2B

BITPI OBJECT 16 -32 -32 -32 -32 -32 -32 -32 -32 -32 -32 -32 -32 -32 -32

134x78 134x78 33x77 33x77 10x10 10x10 10x10 10x10 208x78 208x78 155x38 155x38 33x36 33x36

1 1 1 1 1 1 1 1 1 1 2 2 2 2

The grism stamp of ob ject 198, +1st order, is stored in the extension with the name BEAM 198A. Please note that the results from the individual extractions contain also the other spectral orders (-1st , 0th , +2nd , +3rd orders) as indicated with the letters E, B, C, D in the extension names. The STP-file extensions can be displayed conveniently with any FITS-image viewer such as ds9. 4.9.3 MEF-file ­ calibrated sp ectral stamps

The MEF-files are named as DRIZZLE/aXeWFC3 mef ID.fits, e.g. the MEF-file of ob ject 101 is DRIZZLE/aXeWFC3 mef ID101.fits. They exist for drizzled ob jects only, thus all reside in the directory DRIZZLE. The MEF-files are multi-extension FITS images. In contrast to the STP-files, they contain a fully calibrated and linearized wavelength, as well as spatial coordinate, system. Furthermore, they provide information on errors and an estimate of the contamination. We recommend to use the MEF-files rather than the STP-files as input for any science investigations. A list of all extensions in a MEF-file can be obtained with the PyRAF task catfits in the STSDAS package: 21


--> catfits DRIZZLE/aXeWFC3_mef_ID101.fits EXT# FITSNAME FILENAME EXTVE DIMENS 0 1 2 3 4 5 DRIZZLE/aXeWF IMAGE IMAGE IMAGE IMAGE IMAGE

BITPI OBJECT 8 -32 -32 -32 -32 -32

SCI ERR EXPT CON WHT

1 1 1 1

213x34 213x34 213x34 213x34 213x34

101 101 101 101

The important extensions are: · SCI: the co-added (drizzled) flux values in units of [e- /s] · ERR: the error for SCI · EXPT: the effective exposure time for each pixel in units of [s] · CON: an estimate of the contamination from neighbouring ob ject spectra [e- /s] The MEF-files can be displayed conveniently with any FITS-image viewer, such as ds9, which will also display the coordinate system along the wavelength and cross-dispersion axis.


4.9.4

Since the MEF-files are ful ly calibrated with a WCS header showing the wavelength in x and the spatial direction in y , advanced users can make individual spectral extractions from the MEF-files using customized extraction boxes. The STP-file extensions of the drizzled images, DRIZZLE/aXeWFC3 2.STP.fits contain almost the identical information as the SCI-extension in the corresponding MEF-files. While the STP-file is necessary for the web page creation (see Sec. 5.2), the MEF-files with the WCS header and additional information should preferrential ly be used when examining single object results. OAF-file ­ extraction geometry

The OAF-files have the suffix .OAF, e.g. OUTPUT/ib6o23rsq flt 2.OAF or DRIZZLE/aXeWFC3 2.OAF. OAF-files are ASCII files (i.e. not FITS !) that contain all geometrical extraction information for all spectral orders and ob jects. OAF-files can be displayed via: > more DRIZZLE/aXeWFC3_2.OAF APERTURE 1 BEAM A REFPIXEL1A 14.0 42.0 CORNERS1A 1.0 1.0 201.0 1.0 201.0 84.0 1.0 84.0 CURVE1A 1 0.0 0.0 WIDTH1A 27.89 ORIENT1A 90.0 SLITGEOM1A 0.0 0.0 7.95 0.0 IGNORE1A 0 BEAM END APERTURE END APERTURE 10 22


BEAM A REFPIXEL10A 14.0 14.0 CORNERS10A 1.0 1.0 186.0 1.0 186.0 28.0 1.0 28.0 CURVE10A 1 0.0 0.0 WIDTH10A 7.15 ORIENT10A 90.0 SLITGEOM10A 0.0 0.0 1.82 0.0 IGNORE10A 0 BEAM END APERTURE END The information for one ob ject is enclosed with APERTURE ... APERTURE END. For each ob ject the information on the various spectral orders are enclosed in BEAM ...BEAM END; being the corresponding letter for the spectral order. Probably the most important information in the OAF-files are the extraction widths, given with the keyword WIDTH. The line: WIDTH1A 27.98 in the file DRIZZLE/aXeWFC3 2.OAF means that the extraction width of the ob ject number 1 was 27.98 pix on each side of the trace. This means the the spectrum DRIZZLE/aXeWFC3 2.SPC.fits[BEAM 1A] was extracted from the SCI-extension of the MEF-file DRIZZLE/aXeWFC3 mef ID1.fits with the total extraction width of ±27.98 = 2.0 27.98 = 55.96 pix.

5

Quality control and simulations with aXeSIM
automated tasks as described in this cookbook enables the extraction of several 100 from deep grism data. Nevertheless, it is still mandatory to check and validate the any science investigation can commence. In Sects. 5.1, 5.2 and 5.3 we describe basic which can help to validate data quality and understand the limits of the observations.

Running highly or 1000 spectra products before checks and tools

5.1

Basic data pro ducts check

Here we provide a list of suggested, basic checks users can carry out to validate the data reduction quality. Some hints on troubleshooting are given in Sec. 6. · Check grism background after axeprep. After running the axeprep task with a master sky the resulting grism images should show a smooth background level with zero counts. · Contamination: A convenient means of checking the quality of the contamination estimates is to blink the grism image (ib6o23rsq flt.fits) with the contamination image (ib6o23rsq flt 2.CONT.fits) in, e.g. ds9. In our example the files are stored in the OUTPUT directory. The trace locations and flux levels of the contamination image should resemble the real data. · Individual extraction versus drizzled sp ectrum: The quality of the drizzled 1-dimensional 1st order spectra (file: aXeWFC3 2.SPC.fits; DRIZZLE directory) can be checked by overplotting individual extractions (files: ib6o23rsq flt 2.SPC.fits, ib6o23ruq flt 2.SPC.fits, ib6o23ryq flt 2.SPC.fits, ib6o23s0q flt 2.SPC.fits; OUTPUT directory). · Compare achieved S/N with exp ected values from the ETC. For a true point source, compare the observed S/N with the expectations from the ETC. 23


Figure 7: An HTML page for the ERS G141 grism data as produced by aXe2web. The 1st column with an index number is followed by the ob ject ID number, the ob ject brightness and a column with coordinate information. The following columns show a direct image stamp (6.5 â 6.5 arcsec), the 2-dimensional spectrum image and the extracted 1-dimensional spectrum in units of [e- /s] and [erg/cm2 /s/° If non-zero, an estimate of the contamination level (blue) is provided for the spectrum A]. in physical units.

5.2

Web page creation with aXe2web for visual insp ection

The main purpose of this section is to create Web pages for easy visualization of the aXe output products and basic quality checks. The Web pages (see Fig. 7) provide, for each extracted source in the master ob ject catalogue, information on ob ject magnitude, coordinates, a stamp image extracted from the direct image and the full spectral information. Besides the Web pages, which show the details on individual ob jects, there is also a master index page, a page with an overview over all ob jects, as well as an info page which summarizes the parameter setup used for the aXe2web run. All pages are crosslinked to enable fast navigation within the dataset. aXe2web is a stand alone python code which is not distributed as part of the PyRAF STSDAS package, however, it can be obtained from the following link, including documentation: aXe2web. The following steps need to be carried out in order to produce the Web pages: · Step 1: create a new directory > mkdir visualization > cd visualization 24


· Step 2: copy all needed input files to this directory. The input files are: ­ the detection image F140W drz sci.fits ­ the magnitude column adjusted master ob ject catalogue F140W prep.cat ­ the extracted 1-dimensional spectra from the DRIZZLE directory (aXeWFC3 2.SPC.fits) ­ the stamp image file from the DRIZZLE directory (aXeWFC3 2.STP.fits) > > > > cp cp cp cp ../IMDRIZZLE/F140W_drz_sci.fits . ../IMDRIZZLE/F140W_prep.cat . ../DRIZZLE/aXeWFC3_2.SPC.fits . ../DRIZZLE/aXeWFC3_2.STP.fits .

· Step 3: make a parameter ASCII file to define the input, such as `G141.par': # # Example 1 # pagename = G141_ERS direct_image = F140W_drz_sci.fits stamp_image = aXeWFC3_2.STP.fits spectr_table = aXeWFC3_2.SPC.fits sextract_cat = F140W_prep.cat sort_column = MAG_F1392+ page_header = "aXe2web ERS G141" pagesize=50 error_bars=yes mark_sources=yes outputpath=web_pages lambda_range=11000,17000 # · Step 4: run aXe2web with the parameter file: > aXe2web --parfile G141.par The Web pages created by aXe2web provide a convenient means for obtaining an overview over several 100 spectra and also help to quickly identify data reduction problems.

5.3

Simulations with aXeSIM

Simulating slitless spectroscopic images with aXeSIM can assist in interpreting the spectra extracted from a data set. As an example, we simulate continuum point sources at various flux levels in order to estimate the SNR as a function of the F140W broad band magnitude. The identical directory setup generated for the extraction described in Sec. 4 can be used in the simulations. Moreover the configuration and calibration files necessary for aXeSIM are identical to the ones needed for aXe. The simulation is prepared as follows: 25


> cp DATA/ib6o23rtq_flt_1.cat DATA/SNR_sim.cat With a text editor, the file SNR sim.cat is modified to provide the ob ject parameters for the simulations. For example, we set up a configuration of sources aligned in x direction (X = 500) and varying Y-position. The source magnitudes are also set to different values. The file reads as follows: # # # # # # # # # # # # 1 NUMBER Running object number 2 X_IMAGE Object position along x [pixel] 3 Y_IMAGE Object position along y [pixel] 4 X_WORLD Barycenter position along world x axis [deg] 5 Y_WORLD Barycenter position along world y axis [deg] 6 A_IMAGE Profile RMS along major axis [pixel] 7 B_IMAGE Profile RMS along minor axis [pixel] 8 THETA_IMAGE Position angle (CCW/x) [deg] 9 A_WORLD Profile RMS along major axis (world units) [deg] 10 B_WORLD Profile RMS along minor axis (world units) [deg] 11 THETA_WORLD Position angle (CCW/world-x) [deg] 12 MAG_F1392 Kron-like elliptical aperture magnitude [mag] 1 500.0 400.0 2.91087e+02 9.893e+00 1.0 1.0 90.0 1.0 2 500.0 420.0 2.91087e+02 9.893e+00 1.0 1.0 90.0 1.0 3 500.0 440.0 2.91087e+02 9.894e+00 1.0 1.0 90.0 1.0 4 500.0 460.0 2.91087e+02 9.895e+00 1.0 1.0 90.0 1.0 5 500.0 480.0 2.91087e+02 9.895e+00 1.0 1.0 90.0 1.0 6 500.0 500.0 2.91087e+02 9.896e+00 1.0 1.0 90.0 1.0 7 500.0 520.0 2.91086e+02 9.897e+00 1.0 1.0 90.0 1.0 8 500.0 540.0 2.91086e+02 9.897e+00 1.0 1.0 90.0 1.0 9 500.0 560.0 2.91086e+02 9.898e+00 1.0 1.0 90.0 1.0 10 500.0 580.0 2.91086e+02 9.899e+00 1.0 1.0 90.0 1.0 11 500.0 600.0 2.91086e+02 9.899e+00 1.0 1.0 90.0 1.0 12 500.0 620.0 2.91086e+02 9.900e+00 1.0 1.0 90.0 1.0

1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0

90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0 90.0

20.0 20.5 21.0 21.0 22.5 22.5 23.0 23.0 23.5 23.5 24.0 24.0

In total, 12 ob jects with different brightness in the F140W filter are simulated. The ob jects are located at positions starting at (x, y ) = (500, 400) and then in steps of y = 20. In the setup prepared for the extraction, a simulation of a grism image with an exposure time of 1 hour and a typical sky background of 0.9 e/s is performed with: > pyraf --> stsdas --> slitless --> axesim --> simdata incat='SNR_sim.cat' config='WFC3.IR.G141.V2.5.conf' output_root='WFC3_G141_SNR' bck_flux_disp=0.9 silent='yes' exptime_disp=3600.0 extraction='yes' The provided background value (bck flux disp) is interpreted to be constant across the FoV and can be adjusted to a specific observed value. Furthermore, one can provide a full background image instead of a constant value if the shape of the background (see Fig. 6) is important. Fig. 8 shows the central part of the resulting simulated image WFC3 G141 SNR slitless.fits. For the brighter simulated ob jects one can see the 0th , +1st and +2nd orders from left to right. As expected, the traces become fainter or vanish with increasing y-axis position. 26


Figure 8: The simulated G141 image WFC3 G141 SNR slitless.fits (central cutout with full xextension and 370 pix in y). In this example, only point-like ob jects are shown.

An additional output of the simulations are the spectra extracted from the simulated grism image using methods (and even the code) from aXe. The extracted spectra are stored in the SPC-file WFC3 G141 SNR slitless 2.SPC.fits. An analysis of the SNR of all spectra stored in the SPC-file, e.g. using DER SNR.py3 , then leads to the SNR as a function of F140W magnitude as shown in Fig. 9. The SNR computed from the extracted spectra in DRIZZLE/aXeWFC3 2.SPC.fits can then be compared to the simulated numbers in Fig. 9. Since the size of an ob ject is a strong function in S/N, only observed and simulated ob jects of similar size and shape should be compared. For a more advanced use of the simulation package, including the simulation of direct images and user-defined input spectra, please see the examples provided in the aXeSIM Manual. Also a test package for the aXeSIM software is available from this Web page. The test package contains all necessary input data files (e.g. example input spectra, filter transmission curves4 ) to run the example simulations.

6

Troublesho oting

In this section we provide a, necessarily incomplete, list of commonly encountered problems and suggest possible solutions. · There is no sp ectrum of my favorite ob ject. Please check if the ob ject is listed in the master ob ject catalogue and was properly identified by SExtractor, including the information on size and ma jor axis position angle. · The aXe software claims that a given file do es not exist although I'm sure it's there in the right place. When using absolute path names in deep directory structures the path name can get very long. If the maximum number of characters that IRAF allows for command input is exceeded then the above error occurs. Either use relative path names or move the directory structure such that the path names are shortened.
DER SNR.py The filter transmission curves were cut at 1% transmission, if a higher accuracy is needed then the full filter transmission curves should be re-retrieved from STScI.
4 3

27


Figure 9: The Signal-to-Noise-Ratio of simulated point source observations as a function of the F140W magnitude (aXeSIM package).

· Contamination estimates seem to b e unrealistically high. Please check if the flux columns in the master ob ject catalogue (MAG F1392 in F140W prep.cat) are set correctly and that pivot filter wavelength are given in units of [nm]. Note, that a wavelength must be specified and that listing only MAG AUTO will lead to a error-exit of the software. · Do not run axeprep more than once on grism images. Multiple runs will result in the header keyword for the background level to be set wrongly and subsequent reduction steps will fail. · Imp erfect background subtraction. aXe can also be used with a local background subtraction (see aXe Manual) which can help to achieve better results for individual ob jects. · Use of flt.fits files. The input data images for the aXe software are in flt.fits format. Please do not use drz.fits images since this will lead to wrongly applied distortion corrections. · Magnitude 99 for ob jects in Master Catalogue. If SExtractor cannot estimate a magnitude for an ob ject it assigns a magnitude of "99". This value of magnitude leads to an error in the aXe reduction software. Either replace the magnitude with a realistic number or remove the ob ject from the Master catalogue.

7

Acknowledgements

For invaluable comments on early versions of the cookbook we would like to thank Kim Nilsson, Howard Bushouse and Nimish Hathi.

28


References
Bertin E., Arnouts S., 1996, A&AS, 117, 393 Freudling W., Kummel M., Haase J., Hook R., Kuntschner H., Lombardi M., Micol A., Stoehr F., ¨ Walsh J., 2008, A&A, 490, 1165 Kummel M., Walsh J. R., Pirzkal N., Kuntschner H., Pasquali A., 2009, PASP, 121, 59 ¨ Kuntschner H., Bushouse H., Kummel M., Walsh J. R., 2009, Technical report, WFC3 SMOV proposal ¨ 11552: Calibration of the G141 grism (WFC3-2009-17) Pasquali A., Pirzkal N., Larsen S., Walsh J. R., Kummel M., 2006, PASP, 118, 270 ¨ Pirzkal N., Burgasser A. J., Malhotra S., Holwerda B. W., Sahu K. C., Rhoads J. E., Xu C., Bochanski J. J., Walsh J. R., Windhorst R. A., Hathi N. P., Cohen S. H., 2009, ApJ, 695, 1591 Pirzkal N., Pasquali A., Demleitner M., 2001, Space Telescope European Coordinating Facility Newsletter, 29, 5 Pirzkal N., Xu C., Malhotra S., et al., 2004, ApJS, 154, 501 Straughn A. N., Kuntschner H., Kuemmel M., et al., 2010, AJ in press (arXiv:1005.3071)

29


A

Parameter set of main aXe tasks

In this Appendix we list the full, default parameter setup of all aXe tasks used in this cookbook.

A.1

iolprep parameters

--> lpar iolprep mdrizzle_ima input_cat (dimension_in (useMdriz = = = = "" "" "0,0,0,0") yes) Drizzled image Input catalogue Additional pixels on the left,right,bottom,top Use multidrizzle header info for coord transform (False for Astrodrizzle)

(mode = "al")

A.2

axeprep parameters
List with input images Configuration filenames for CCD's Subtract background image? Background image(s) Background podest mage Multiplicative factor for mask image Normalize image by exposure time? Apply gain correction?

--> lpar axeprep inlist = "" configs = "" (backgr = yes) (backims = "") (backped = "") (mfwhm = 2.0) (norm = yes) (gaincorr = no) (mode = "al")

A.3

aXecore parameters
List with input images Configuration filenames for CCD's Multiplicative factor for object mask image Multiplicative factor for object mask image after axedrizzle Finge configuratione filenames for CCD's Create also the background PET GOL2AF parameters: Multiplicative factor for background mask image Use tilted extraction? Use geometry optimized for slitless data? Remove faint objects from the results? Wavelength to apply MMAG_EXTRACT and MMAG_MARK? PETCONT parameters: Which contamination model? Scale factor for the model width? 30

--> lpar axecore inlist = "" configs = "" extrfwhm = 4.0 drzfwhm = 3.0 (fconfigs = "") (back = no)

(backfwhm (orient (slitless_geo (exclude (lambda_mark

= = = = =

6.0) yes) yes) no) 800.0)

(cont_model = "gauss") (model_scale = 3.0)


(inter_type = "linear") (lambda_psf = 800.0)

Which interpolation type? Wavelength the psf was measured? BACKEST parameters: Number of points to use for computation Type of interpolation to perform Number of kappa-sigma klippings on median? Number of kappa-sigma klippings on fit? Kappa? Smoothing length? FWHM in background smoothing? PET2SPC, STAMPS: Extract spectra and stamp images? Using size-adjusted sensitivity curve? Compute (and use) optimal weights? Which sampling type?

(np (interp (niter_med (niter_fit (kappa (smooth_lengt (smooth_fwhm

= = = = = = =

) ) ) ) ) ) )

(spectr (adj_sens (weights (sampling (mode

= = = = =

yes) no) no) "drizzle") "al")

A.4

drzprep parameters
Name of image list Configuration filenames for the CCD's Use optimal extraction in aXedrizzle? Generate ALSO a background DPP file using a PET?

--> lpar tdrzprep inlist = "" configs = "" (opt_extr = no) (back = no) (mode = "al")

A.5

axedrizzle parameters

--> lpar axedrizzle inlist = "" configs = "" infwhm = outfwhm = (back = no) (driz_separat = no) (clean = yes)

Name of image list Configuration filenames for the CCD's Multiplicative factor in DPP's List of multiplicative factors for drizzled data Drizzling a background image? Drizzling to separate image and CCR reject? Remove temporary files? MEDIAN IMAGE parameters: Type of combine operation? Percentage of weight image below which is is flagged as bad? Significance for accepting minimum instead of median (for minmed)? Number of low pixels to reject? Number of high pixels to reject? Lower threshold for clipping input pixel values? Upper threshold for clipping input pixel values?

(combine_type (combine_mask (combine_nsig (combine_nlow (combine_nhig (combine_lthr (combine_hthr

= = = = = = =

"median") 0.7) "4.0 3.0") 0) 0) INDEF) INDEF)

31


(combine_grow = 1.0)

Radius (pixels) for neighbor rejection? BLOT BACK parameters: Interpolant (nearest,linear,poly3,poly5,sinc)? Scale for sinc interpolation kernel? REMOVE COSMIC RAYS parameters: Driz_cr.SNR parameter? Driz_cr_grow parameter Driz_cr.scale parameter SPECTRAL EXTRACTION parameters: Making the final SPC and STP? Using size-adjusted sensitivity curve? Using optimal extraction?

(blot_interp = "poly5") (blot_sinscl = 1.0)

(driz_cr_snr = "5.0 4.0") (driz_cr_grow = 1.0) (driz_cr_scal = "1.2 0.7")

(makespc (adj_sens (opt_extr (mode

= = = =

yes) no) no) "al")

B
B.1

Parameter set of main aXeSIM task
simdata parameters
Model object table name aXe configuration filename Root for the output names Run in silent mode PREPSPECTRA parameters: List of template spectra (fits or ascii) Total passband for flux scaling PREPIMAGES parameter: List of template images (fits) SIMDISPIM parameters: Wavelength the object shape was determined at [nm] Dimension of simulated dispersed image in x (if non-default) Dimension of simulated dispersed image in y (if non-default) Exposure time for simulated dispersed image Backgrounds flux/image for dispersed image in [e/s] Do a dummy extraction on the dispersed image SIMDIRIM parameters: Name of the total passband file (fits or ascii) Dimension of simulated direct image in x (if non-default) Dimension of simulated direct image in y (if non-default) Exposure time for simulated direct image 32

--> lpar simdata incat = "" config = "" (output_root = "") (silent = yes)

(inlist_spec = "") (tpass_flux = "")

(inlist_ima = "")

(lambda_psf (nx_disp (ny_disp (exptime_disp (bck_flux_dis (extraction

= = = = = =

) ) ) ) "0.0") yes)

(tpass_direct (nx_dir (ny_dir (exptime_dir

= = = =

"") ) ) )


(bck_flux_dir = "0.0") Backgrounds flux/image for direct image in [e/s] (version = "1.21 (2009Apr01)") aXeSIM version number (mode = "al")

33