PRIMUS throughput

From NYU CCPP Wiki

This is a page about the PRIMUS project.

This describes our current procedures for determining and using the PRIMUS instrument throughput, on IMACS at the Baade 6.5m telescope at Las Campanas.

Contents

Atmosphere

The current atmospheric model is stored in the file:

$PRIMUS_DIR/data/atmosphere.dat

and can be read with the following piece of IDL code:

readcol, getenv('PRIMUS_DIR')+'/data/atmosphere.dat', $
     atm_wave, atm_thru, /sil, f='(f,f)'

This file is meant to represent the atmospheric throughput as a function of wavelength at Palomar. I'm not sure where this file came from. The opacity of the water and OH bands (at 6900, 7300, 7600, 8300, and 9500 Angstroms) were reduced by hand by Scott Burles, since they seemed high for our results at Las Campanas. The original file (uneditted) is called "atmosphere.original".

template2primus() multiplies these numbers by the current airmass, then applies it to the template before convolving and sampling it.

Baseline absolute throughput

We have a guess at the baseline absolute throughput, around which all of our empirical tweaks are based. This baseline was determined by slitless spectra of standards and is stored as two separate files, which can be read as follows

readcol, getenv('PRIMUS_DIR') + '/data/slitless/IMACS_qe_mar06.dat', $
     imacs_wave, imacs_thru, /silent
readcol, getenv('PRIMUS_DIR') + '/data/slitless/IMACS_ccds.dat', $
     ccd_wave, ccd1, ccd2, ccd3, ccd4, ccd5, ccd6, $
     ccd7, ccd8, /silent

Generally, we use CCD 5 as the baseline, because Richard Cool's flat images indicate it is the best behaved chromatically. Thus, our baseline is "imacs_thru" multiplied by "ccd5".

Note that none of these wavelength grids are aligned, so one needs to interpolate to get the arrays to match up correctly.

template2primus() multiplies these numbers to the template before convolving and sampling it.

inter-CCD variation

There is an overall variation in the chromatic throughput among the eight IMACS CCDs. By comparing the stacked sky spectra for a large number of masks, we have determined what this variation is.

The results for the stacked sky fluxes are in

$PRIMUS_DATA/skyflux

Each individual mask has two files, both produced by the code "primus_all_skyflux", which calls "bolton_avg_sky" to determine the sky for each mask. The two files are (for mask 122, for example):

xmma0122-skyflux.fits - the outputs of "bolton_avg_sky", one row per slit
xmma0122-ccdflux.fits - the inferred QE for each CCD relative to CCD 5

The "inferred QE" is just the average sky in each CCD relative to the average sky. For each CCD and mask we fit a low order polynomial (sixth) to this QE. This low-order fit is what we actually use. In the structure in the "ccdflux" file this fit is called "QE_POLY".

However, for the inter-CCD variation we do not use any individual mask, we use an average of all of the masks, produced by the code "avg_ccdflux". This code produces the file:

$PRIMUS_DATA/skyflux/qe-ccd.fits

which has the columns:

WAVE: [5501], wavelength in Angstroms
QE_CCD: [5501, 8], throughput relative to CCD 5

At the 5% level, the inter-CCD variation shows remarkable consistency across many masks.

template2primus() multiplies the templates by these throughputs before convolving and sampling.

intra-CCD throughput

The same sky-fitting code that determines the inter-CCD variation also determines the intra-CCD variation. Here, we model this more simply, as a parabola determined independently for each slit.

The throughput (relative to the mean for the CCD) for each slit is stored in the "skyflux" files mentioned in the previous section. We refer to these corrections as a "tweak" and they can be obtained (if you have a structure "slitstr" with the 1d slit output in it) with the call:

tweak= get_sky_tweak(slitstr, pair=pair)

"pair" is 1 for slit A, 2 for slit B.

Since this is so low order, and varies among each individual slit, we usually don't apply it in template2primus() but outside of it.

Overall F-star throughput

Finally, we determine the overall throughput from observations of F-stars. In particular, we are currently relying on F-stars in the SWIRE and SDSS fields (the ones whose photometry we trust the most and that we think are actually F-stars). In order to account for the sky fluxing vectors found above, the code quoted in this section must all be called with the "/tweak" option. (We should make this the default at some point).

The F-stars are fit using "fit_fstar_allmasks", which for each observed mask calls "fit_fstar_mask", which for each F-star slit uses the photometry to build a model of the F-star and runs template2primus() on the model. This code ignores the fstarcorr.fits file (described below) existing when this is run. The throughput for each slit is then determined by taking the ratio of the actual flux to that predicted by the model. Low-order polynomial fits (fifth) are then made to the throughput.

For each mask a file like:

$PRIMUS_DATA/fstarflux/fstarcorr-xmma0122.fits

is made, with two HDU:

HDU1: overall throughput determination for mask
HDU2: fluxes and F-star fits for each F-star

Once the above files are made for each mask, we run the program "stack_fstars_sdss", which stacks the throughput for each mask. It makes some QA files that show the throughput as a function of CCD and position within CCD, but it also makes the file that has the mean over all the CCDs:

$PRIMUS_DATA/fstarflux/fstarcorr.sdss.fits

which I then symlink to "fstarcorr.fits". Recall that the inter- and intra-CCD variations should have been fixed in template2primus(), so we don't have to just use the CCD 5 data here.

As we will see, if the "fstarcorr.fits" file exists, template2primus() will use it as an overall multiplicative factor on the template before convolving and sampling it to PRIMUS resolution.

template2primus()

Here let us summarize what template2primus does:

  1. Multiplies template by the atmospheric throughput to the template
  2. Multiplies template by the overall throughput baseline from IMACS_qe_mar06.dat
  3. Multiplies template by the CCD 5 throughput baseline from IMACS_ccds.dat
  4. Multiplies template by the inter-CCD variation (relative to 5) determined by the sky fluxing
  5. Multiplies template by the overall throughput determined from F-stars
  6. Transforms the template to icron units (inverse cubic micron)
  7. Transforms template to pixel units (a small perturbation on icrons)
  8. Rebins template to lower resolution (16 times final)
  9. Convolves (at each output pixel) template with:
    1. object times slit function, convolved with
    2. instrumental PSF, convolved with
    3. pixel shape (tophat).

Intra-CCD variations must be applied after template2primus(). This approximation is possible because the variations are low order; it is desired because they are known on a slit-by-slit basis, and we try to avoid calling template2primus() for each slit.

Typically, we are using template2primus() for individual slits only in cases like the F-stars, where there are a small number of objects with known redshifts. As explained below, for redshift fitting, we use a grid of templates run through template2primus() under various conditions, because this can be ten or so times faster.

Use of templates in redshift fitting

The redshift-fitting code is "primus_fit_redshift". This procedure calls three other procedures:

  1. primus_k_fit_spec() (for galaxies)
  2. primus_fit_star() (for stars)
  3. primus_fit_qso_spec() (for QSOs)

Right now, redshift fitting does not use the intra-CCD variations at all.

The redshift fitting of galaxies can use either the grid or template2primus() directly, depending on whether "primus_k_fit_spec()" is called with the "/grid" keyword. If it is not given, the code uses a procedure "primus_galaxy_templates" to yield the predicted counts for each set of templates given the redshift, airmass, slitwidth, A/B, etc, from template2primus().

If the "/grid" keyword is given, the code interpolates the fits from the galaxy grid, which is in:

$PRIMUS_DIR/data/galaxy_grid.fits

The grid loops over redshift and CCD, and has a wavelength sampling five times that of a typical slit, so that we can interpolate it onto any wavelength grid. The grid is produced by "primus_galaxy_grid" (which, of course, just calls "primus_galaxy_templates").

There is currently no accounting for airmass variations or variation of anything else. I AM NOT SURE THE GALAXY GRID GOT UPDATED AFTER THE LAST FEW FIXES TO THE THROUGHPUTS!!!

The QSOs use a very similar system to the galaxies for fitting: one can either use a grid or call template2primus() directly.

For the stars, template2primus() is called directly by "primus_fit_star".