Spectroscopic Pipeline Parameters

The spectroscopic pipeline creates a spec object from a parameter file. The example below shows the default parameters. A library of parameter files is available at https://github.com/eas342/tshirt/tree/master/tshirt/parameters/spec_params

procFiles: ../example_data/spec_time_series/*.fits ## files on which to do spec extraction
excludeList: null
srcName: Lab LED
srcNameShort: labLED
nightName: UT2017_09_08
dispDirection: x ## dispersion direction 'x' or 'y'
starPositions: ## positions of the stars in the spatial direction. The first one is the target
   - 104
dispOffsets: null ## dispersion offset positions of the stars for multi-object spectroscopy
mosBacksub: False ## Do individual background subtraction for each star for multi-object spectroscopy?
refPhotCentering: null ## photometry fits file where to obtain centroid shifts to apply from 1 star/source
bkgSubDirections: ['Y','X'] ## The direction and sequence of background subtractions to do
bkgRegionsX: ## a list of background regions in the X direction
   - [0, 258]
bkgOrderX: 0 ## order of polynomial subtraction in the X direction
bkgRegionsY: ## a list of background regions in the Y direction
   - [0, 60]
   - [158, 255]
bkgOrderY: 2 ## order of polynomial subtraction in the Y direction
apWidth: 30. ## Source aperture width
dispPixels: [320, 2020] ## pixels to use in the dispersion direction
jdRef: 2457551 ## JD reference offset to subtract for plotting
timingMethod: JWSTint ## how to assign integration times? None, 'JWSTint' will add int time to exposure start
isCube: True ## Is the data a cube (3D)?
cubePlane: 0 ## The plane to choose if data is in cubes
doCentering: False ## Center the aperturess with Gaussian?
FITSextension: 0 ## FITS extension of science frames
HEADextension: 0 ## FITS extension of the header info (for exposure and timing)
isSlope: True ## Is the FITS image a slope image that should be multiplied by the int time?
itimeKeyword: INTTIME ## The FITS keyword describing integration time
readNoise: 14 ## Read noise in electrons
detectorGain: 1.8 ## Optionally specify the detector gain e-/DN
dateFormat: Two Part ## Format of date. "Two Part" is split over DATE-OBS and TIME-OBS, whereas "One Part" is all in DATE-OBS
backPreScreen: False ## Pre-screen the background for outliers before trying to fit?
splineSpecFitOrder: 3 ## order of the Spline to fit along the dispersion direction (for profile & badpix)
splineSigRej: 2 ## number of sigma to reject when fitting the Splines along dispersion direction
splinePreScreen: False ## pre-screen the points going into spline fitting?
splineFloor: null ## set a floor for spline fitting in logarithmic space or None to use 2X the read noise.
sigForBadPx: 300 ## number of sigma difference from smoothed profile where to mark bad pixels
numSplineKnots: 20 ## number of spline Knots when fitting the Splines along the dispersion direction
nImgForProfile: 1 ## number of images to used to calculate a profile when the profile is fixed
nanTreatment: 'leave' ## How to treat NaNs in image? 'zero' will set to 0, 'leave' will leave at NaN
lowPassFreqCC: 0.99 ## Below this frequency, all information is included for cross-corr alignment analysis
hiPassFreqCC: 0.015 ## Above this frequency, all information is included for cross-corr alignment analysis
nOffsetCC: 20 ## maximum number of pixels for cross-correlation during alignment stage
specShiftMultiplier: 1.0 ## this is a multiplier to shift the spectra an extra fraction
waveCalMethod: null ## the wavelength calibration method (None/null, NIRCamTS, simGRISMC, wfc3Dispersion)
waveCalOffset: 0.0 ## offset to the wavelength calibration, subtracted afterwards
waveCalPxOffset: 0.0 ## offset to the pixels applied to the wavelength calibration, subtracted before
readNoiseCorrelation: False ## Treat the read noise as correlated across spatial pixels?
readNoiseCorrVal: 0.01 ## The value of reaad noise correlation (if handling read Noise correlation)
dispNoiseCorrelation: False ## Treat the read noise as correlated across spectral pixels?
readNoiseCorrDispVal: 0.01 ## The value of read noise correlation in disp direction (if used)
ignorePhotNoiseInCovariance: False ## a diagnostic parameter to see covariance weights w/ out photon noise
superWeights: False ## Use (S/N)^2 to weight instead of optimal extraction
fixedProfile: False ## Use a fixed profile for all images?
readFromTshirtExamples: False ## read the data from T-shirt examples within the package? Use only for examples.
saveRefRow: False ## save rows of reference pixels?
dateKeyword: DATE-OBS ## default FITS keyword to find date/time information from
DATE-OBS: None ## manually supply a DATE-OBS if nothing is available in the header
saveSpatialProfileStats: False ## save the spatial profile stats
profilePix: null ## the pixels to use in calculating the spatial profile statistics (not used in extraction)
useSmoothProfileForStats: False ## use the spline-smoothed profile for profile statistics?
traceCurvedSpectrum: False ## Fit the trace to the spectrum?
traceOrder: 3 ## polynomial order for the trace fitting
traceFitBoxSize: 18 ## the spatial box size used to fit the trace
traceFWHMguess: 2 ## Guess size for the spatial FWHM
backgMinRadius: 5 ## minimum distance for background
skyPositions: None ## use RA and Dec for positions (only works for photometry though)
downselectImgWithCoord: False ## Check images for source w/ coordinates (only works for photometry though)

Notes on Parameters

The following gives some more information on the parameters in the spectroscopic pipeline.

apWidth

The full width of the extraction box used for the source. It is going to be centered on starPositions with apWidth/2 above and apWidth/2 below the starPositions value. The equivalent IRAF apall “lower” and “upper” values would both be apwidth/2 each.

mosBacksub

If True, background subtraction is done individually for each source. This only subtracts locally around the dispersion pixels and spatial pixels of the source. The

bkgRegionsX

The pixels for which you want to do background subtraction. Must be a list of lists. When mosBacksub is True, the numbers are the pixels relative to a spectral source. Otherwise, they are absolute pixel dimensions of the image. If you have a source region that you want to subtract over from 10 to 20 pixels and mosBacksub is False, you might set this to:

bkgRegionsY: ## a list of background regions in the Y direction
   - [0,10]
   - [20,30]

bkgRegionsY

The same as background regions X.

dispPixels

The absolute pixel region over which to do spectral extractions. When mosBacksub is True, the absolute pixels are used for the first source and then the dispOffsets parameter shifts it for all other sources.

numSplineKnots

This is a critical parameter in finding the spectroscopic profile. If it is too large, the profile, normalization and variance-weighted fit can be driven to huge numbers. If it is too small, the profile fit will not capture the shape of the spectrum and my chop it off at its peak. You can check the profile fitting by running. The following

img, head = spec.get_default_im()
imgSub, bkgModel, subHead = spec.do_backsub(img,head,directions=spec.param['bkgSubDirections'])
profileList, smooth_img_list = spec.find_profile(imgSub,subHead,showEach=True)

This will show you one profile fit at a time with the spline knots shown. You can step through each cross-dispersion pixel by pressing “c”. When you are done, press “q” to quick the python debugger (pdb).

waveCalMethod

The method to turn the dispersion pixels into wavelengths.

  • None When it is None (null in the YAML file), the wavelengths are equal to the pixel in microns (just as a placeholder)

  • NIRCamTSquickPoly Quick polynomial fit to NIRCam grism time series from before flight measurement (use with caution)

  • wfc3Dispersion Hubble Space Telescope Wide Field Camera 3 quick wavecal (use with caution)

  • quick_nrs_prism Simple Polynomial fit to the NIRSpec prism using the jwst pipeline evaluated at Y=16 on 2022-07-15 (use with caution)

  • grismr_poly_dms A polynomial fit to flight data from program 1076. Should be accurate to within a few angstroms for F322W2. F444W depends on where the target position lands after position adjustments.

saveSpatialProfileStats

If True, save the spatial profile centroid and FWHM for de-trending from the median profile. If False, those are populated with NaN.

profilePix

If None, all dispersion pixels (along the wavelength direction) are used in calculating spatial profile statistics. If a 2 element list like [50,100], pixels 50 through 100 in the dispersion/wavelength direction will be used to measure the spatial profile statistics. Note that this only has an effect if saveSpatialProfileStats is True and this will not affect the extraction in current versions of tshirt. It will ony affect the saved profile statistics.

useSmoothProfileForStats

Use the smoothed profile for the profile statistics? If True, the statistics will be on the man profile along the dispersion direction. Otherwise, a median of the data is calculated. Note that if fixedProfile is True, this will give constant statistics for all images