/* calstis7.h 2-D spectral extraction */ /* requires "../stis.h" */ /* values based on OBSTYPE keyword */ # define UNKNOWN_TYPE (-1) # define SPECTROSCOPIC_TYPE 1 # define IMAGING_TYPE 2 /* Image description and reference files for calstis7. Phil Hodge, 1997 Dec 11: Add pctcorr and pctab to the StisInfo7 struct; add ref to the StisInfo7 struct; add pcorr to the PhotInfo struct. Phil Hodge, 1998 Mar 17: Remove ref_aper from the ApInfo struct. Phil Hodge, 1998 Aug 4: Add one to the length of each string buffer (except ref_aper). Phil Hodge, 2000 Jan 13: Add one to ref_aper buffer size (in DispRelation). Phil Hodge, 2000 Apr 5: Add center_target to the StisInfo7 struct. Phil Hodge, 2000 Aug 9: Rename pc1 & pc2 --> xcoeff & ycoeff in DistInfo Remove all references to MAMA offset table or coefficients. Phil Hodge, 2000 Oct 9: Change the contents of the DistInfo struct. */ typedef struct { /* input and output image names */ char input[STIS_LINE+1]; /* input image to be calibrated */ char output[STIS_LINE+1]; /* output calibrated image */ char rootname[STIS_CBUF+1]; /* root name for set of obs */ int printtime; /* print time after each step? */ int verbose; /* print additional info? */ /* keywords and file names for reference files */ RefFileInfo *refnames; /* info about input image */ char obsmode[STIS_CBUF+1]; char aperture[STIS_CBUF+1]; char opt_elem[STIS_CBUF+1]; char det[STIS_CBUF+1]; /* name of detector */ int detector; /* NUV-MAMA, FUV-MAMA, or CCD */ int obstype; /* spectroscopic or imaging */ int wavecal; /* true if ASN_MTYP is "WAVECAL" */ int nimages; /* number of "groups" in file */ int first_order; /* true if first order grating */ int center_target; /* center target in output? normally true */ short sdqflags; /* serious data quality values */ /* CCD-specific info */ double atodgain; /* actual gain of CCD */ /* values specific to each group */ double exptime; /* exposure time (sec) */ double expstart; /* exposure start time (MJD) */ double expend; /* exposure stop time (MJD) */ double hfactor; /* heliocentric correction factor */ /* coordinate info */ double ltm[2]; /* matrix part of transformation to det. */ double ltv[2]; /* offset to detector coordinates */ int cenwave; /* central wavelength */ int dispaxis; /* dispersion axis, 1 ==> X, 2 ==> Y, or 0 */ double ra_targ; /* right ascension of target, degrees */ double dec_targ; /* declination of target, degrees */ /* these crpix are from the SCI extension, not the reference table */ double crpix[2]; /* reference pixel, zero-indexed */ /* This is based on output cdelt, but scaled to be similar to input. Note that this is only used for spectroscopic mode; for imaging mode, the scale is given in the DistInfo struct. */ double plate_scale[2]; /* arcseconds per pixel, for spectroscopic */ /* various offsets */ double msm_slop[2]; /* SHIFTAi (measured by cs4) */ double ap_offset[2]; /* aperture offset in pixels */ double total_offset[2]; /* sum of the above offsets */ /* calibration switches */ int wavecorr; /* has wavecal processing been completed? */ int x2dcorr; /* 2-D spectral extraction (or geocorr)? */ int x2dcorr_o; /* local to a given order (for pedigree) */ int sgeocorr; /* correct for small-scale distortions? */ int heliocorr; /* convert to heliocentric wavelengths? */ int fluxcorr; /* convert to absolute flux units? */ int fc_corr; /* conserve flux? */ int statcorr; /* compute statistics? */ /* pctcorr is not a header keyword */ int pctcorr; /* include PCT correction with fluxcorr? */ /* calibration images and tables */ RefTab distntab; /* SDC or IDC, coordinate & dist info table */ RefImage sdstfile; /* SSD, MAMA small-scale distortion file */ RefTab apdestab; /* APD, aperture description table */ RefTab apertab; /* APT, relative aperture throughput table */ RefTab phottab; /* PHT, photometric throughput table */ RefTab disptab; /* DSP, dispersion coefficients table */ RefTab inangtab; /* IAC, incidence-angle correction table */ RefTab sptrctab; /* 1DT, 1-D spectrum trace table */ RefTab pctab; /* PCT, photometric correction table */ } StisInfo7; /* CoordInfo describes the coordinates for the output image. Note that the coordinate parameters (WCS info) describe the output rectified image, not the input or any reference image. These values are read from the _sdc table in spectroscopic mode or from the _icd table in imaging mode. */ typedef struct coo *CoordPtr; typedef struct coo { int sporder; /* order number */ double a2center; /* Y detector location corresp. to crpix[1] */ int npix[2]; /* size of output image */ double crpix[2]; /* reference pixel, zero-indexed */ double crval[2]; /* coordinates at reference pixel */ double cdelt[2]; /* increment per pixel */ CoordPtr next; /* pointer to next struct in list */ } CoordInfo; /* for info from SDC */ /* Distortion information, used for imaging mode only, read from _idc. */ # define MAX_ORDER 5 /* maximum degree of polynomial */ # define DCM_SIZE (MAX_ORDER + 1) /* distortion coefficient matrix size */ # define MAX_NCOEFF (DCM_SIZE * DCM_SIZE) /* number of coefficients */ # define WHICH_COEFF(i,j) (i*DCM_SIZE + j) typedef struct { int allocated; /* true if memory has been allocated */ int npix[2]; /* size of output image */ int norder; /* order of the polynomial fit */ double scale; /* arcseconds per reference pixel */ double xref, yref; /* zero points (zero indexed) */ double *xcoeff, *ycoeff; /* coefficients for X and Y */ } DistInfo; /* Dispersion relation at A2CENTER, a Y location on the detector. These values are read from the _dsp table. */ # define MAX_DISP_COEFF 10 /* length of array of dispersion coeff */ typedef struct dsp *DispPtr; typedef struct dsp { double a2center; /* Y location on detector */ int ncoeff; /* number of coefficients */ double coeff[MAX_DISP_COEFF]; /* array of coefficients */ char ref_aper[STIS_CBUF+1]; /* reference aperture for dispersion relation */ DispPtr next; /* pointer to next struct in list */ } DispRelation; /* Spectrum trace info, the displacement in the cross-dispersion direction at each detector pixel, read from the _1dt table. */ # define MAX_SP_TRACE 1024 /* length of array for spectrum trace */ typedef struct sptrc *TracePtr; typedef struct sptrc { double a2center; /* Y location on detector */ double a1center; /* X location on detector */ int nelem; /* actual size of array */ double a2displ[MAX_SP_TRACE]; /* spectrum trace */ TracePtr next; /* pointer to next struct in list */ } SpTrace; /* This contains the incidence-angle correction coefficients, which are read from the _iac table. */ typedef struct { int allocated; /* true if memory has been allocated */ int ncoeff1; /* sizes of coefficient arrays */ int ncoeff2; double *coeff1; /* arrays of coefficients */ double *coeff2; } InangInfo; /* This contains factors for converting from count rate to absolute flux, read from the photometry table _pht. */ typedef struct { char bunit[STIS_FITS_REC+1]; /* units for flux-calibrated data */ int allocated; /* true if memory has been allocated */ int nelem; /* size of wavelength and flux corr arrays */ double *wl; /* array of wavelengths */ double *thru; /* array of throughputs (QE) */ double *pcorr; /* array of correction factors */ } PhotInfo; /* This contains a description of the slit, including throughput. Values are gotten from the aperture description table (_apd) and aperture throughput table (_apt). */ # define MAX_BARS 3 /* maximum number of occulting bars */ typedef struct { /* aperture throughput _apt */ int allocated; /* true if memory has been allocated */ int nelem; /* size of wavelength and throughput arrays */ double *wl; /* array of wavelengths */ double *thr; /* array of fraction of light passed by slit */ /* geometric description _apd */ double width[2]; /* width of slit in X and Y directions */ double ap_offset[2]; /* offset from nominal location in X and Y */ double barlocn[MAX_BARS]; /* distance of bar from slit center */ double barwidth[MAX_BARS]; /* width of bar */ int nbars; /* number of occulting bars */ } ApInfo;