Contents:
A set of routines to assist reduction of Spitzer MIPS (24 micron) data.
To prepare a run (set AORs, frame numbers, etc.) edit initobs()
To generate empirical flat-fields, see mipsflat()
To extract photometry (aperture or PSF-fitting), see mipsphot()
To better array photometry, remove first-frames, etc., see binphot()
REQUIREMENTS: | pylab, numpy, os, NIRSPEC Data Analysis, pyfits,:doc:phot,:doc:tools, and maybe some others |
---|---|
HISTORY: | 2009-08-24 15:55 IJC: Created 2011-06-15 09:37 IJMC: Better Sphinx documentation. |
Bin down MIPSPHOT time-series photometry.
INPUT: | outputs – EITHER:
|
---|---|
OPTIONAL INPUT: | dumpframes – (sequence) TBD – frames to throw away. sigma – (float) value for sigma-clipping
binfactor – see ANALYSIS.ERRXY returnstats – print numbers about # of observations, and # of deleted frames |
EXAMPLE: | import spitzer
outputs = []
for ii in range(14):
outputs.append(spitzer.mipsphot(dataset='upsand1', dithernum=ii))
out2 = spitzer.binphot(outputs)
|
NOTES: |
on values extracted from FITS headers and partly on calculations. If “out2” is the output object, “out2.keys” will contain a list of all the header keywords used. Each key values will be binned down by the appropriate factor, and the standard error on that measurement contained in a related keyword. For example, out2.AD24TMPA and out2.eAD24TMPA.
normalize for first-frame effects or dither position sensitivity variations. Similarly for out3.quadbg. |
SEE ALSO: | mipsphot(), analysis.errxy() |
Compute flux throughput of the IRS instrument using a lookup table.
INPUTS: |
version: string order: string
|
---|---|
EXAMPLE: | import tools
offset_sl1 = 0.0
wave, fraction = spitzer.feps_flux_loss(0, version="S18.18.0",order='SL1')
|
Object generated with whatever attributes are passed to it.
Initialize variables for SPITZER data analysis.
OPTIONAL INPUT: |
dce: (list) Which DCEs to load. Defaults to 0-35 inclusive. |
---|---|
OUTPUT: |
|
Perform aperture photometry on a MIPS file or list of MIPS files.
INPUT: | fn – (str) filename, or (list) list of filenames |
---|---|
OPTIONAL INPUT: | dap – (3-sequence) pixel diameters: target aperture, inner sky, outer sky mask – (array) mask to pass to phot.aperphot. Otherwise, generate one from dap. |
NOTES: |
|
Generate a MIPS data file name according to the standard in the MIPS Data Handbook v3.2:
SPITZER_M+chnlnum_aorkey_expid_dcenum_version_type.suffix
INPUT: | separate values, or a list, or lists of lists, representing the quantities:
ALTERNATIVELY, input can be a (str) filename |
---|---|
OUTPUT: |
ALTERNATIVELY, output is a tuple of type (ch,aor,exp,dce,ver,type,suff) |
EXAMPLES: | inp = (1, 26598144, 7, range(3), 1, ['bunc', 'bcd'], 'fits')
spitzer.mipsfile(inp)
# OR
spitzer.mipsfile(1, 26598144, 7, range(3), 1, ['bunc', 'bcd'], 'fits')
# OR
spitzer.mipsfile('SPITZER_M1_26598144_0007_0000_1_bunc.fits')
|
Make a flat field from a set of MIPS filenames. Use a stack median. In creating the flat only use the half-side of the detector that the target star is not falling on.
If nmax is too large, you may run out of memory. Set it lower!
INPUTS: | norm=True – whether to normalize the final flat by the chip-wide median. nmax – the number of files to use, per |
---|---|
EXAMPLE: | init = spitzer.initobs('upsand2')
files = [init.path+f for f in init.files[0]]
flat = spitzer.mipsflat(files)
|
Analyze a Spitzer/MIPS 24um photometric dataset.
INPUTS: | dataset – (str) ‘upsand1’, ‘upsand2’, ‘upsand2cal’, ‘hd209458_0’, ‘hd209458’, ‘hd189733_1’, ‘hd189733_2’ dce & expid – if ‘all’, use all dce & expid values valid for the specified dithernum.
sigma – sigma-clipping value when computing means psffile – model PSF to use for PSF-fitting photometry (from TinyTim). pmask – filename for MIPS bad pixel mask scale – scaling of model PSF relative to physical MIPS detector. fileind – either set to ‘all’, or a sequence of which files to extract dflatfield – filename of a FITS flat-field by which to divide all frames before photometry. sflatfield – filename of a FITS flat-field by which to subtract all frames before photometry. dithernum – should be any value from 0 to 13, inclusive. offset – pixel offset from nominal MIPS 14-dither position |
---|---|
EXAMPLE: | import spitzer
outputs = []
for ii in range(14):
outputs.append(spitzer.mipsphot(dataset='upsand1', dithernum=ii))
# OR use different model PSFs for each position:
psfs = ['/Users/ianc/proj/spitzer/psf/psfx100_6200K_%s_sm.fits' %s \
for s in ['39.0x87.6','39.0x38.1','89.5x87.6','89.5x38.1']]
dnum = [[0,2,4,6],[1,3,5],[7,9,11,13],[8,10,12]]
outputs = []
for ii in range(4):
for jj in dnum[ii]:
outputs.append(spitzer.mipsphot(dataset='upsand1',dithernum=jj,psffile=psfs[ii]))
|
Return the approximate x,y location of a star on the MIPS detector.
INPUT: | expid – (int) exposure ID number. dcenum – (int or list of ints) DCE, 0-35 inclusive. |
---|---|
OPTIONAL INPUT: |
|
OUTPUT: | (xpos, ypos) – tuple of floats, if retfnum==False ( (xpos, ypos), fnum) – tuple of (tuple, floats) |
EXAMPLE: | mipspos(0,0)
mipspos(35,1, retfnum=True)
[mipspos(range(36), expid) for expid in [0,1]]
|
NOTE: | Based on the prescription of even DCE on the LHS, odd DCE on the RHS, and per Table 8.7 in the Spitzer Observer’s Manual. |
Generate a full spectrophotometric model of an IRS-observed eclipse.
INPUTS: |
|
---|---|
EXAMPLE: | test = model_irs_eclipse(params, nobs, nchan, rampfunc, npar_ramp, transit_params, this_mbjd, phase, )
|
Compute flux throughput of the IRS instrument using a lookup table.
INPUTS: |
|
---|---|
EXAMPLE: | import spitzer
slitloss = spitzer.model_irs_slitloss(y_offset_pu_a, nobs, nchan, False)
|
Compute size of pixels (in steradians) for a given FITS image.
INPUT: | fn – str. filename |
---|---|
OPTIONAL INPUT: | key1 – str. FITS Header Key of first pixel scale value, in arcsec/pix key2 – str. FITS Header Key of second pixel scale value, in arcsec/pix |
OUTPUT: | a – float. area of a pixel, in steradians. |