MUSE Pipeline Reference Manual  0.18.1
muse_dfs.h
1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set sw=2 sts=2 et cin: */
3 /*
4  * This file is part of the MUSE Instrument Pipeline
5  * Copyright (C) 2005-2014 European Southern Observatory
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef MUSE_DFS_H
23 #define MUSE_DFS_H
24 
25 /*----------------------------------------------------------------------------*
26  * Defines *
27  *----------------------------------------------------------------------------*/
28 /* data dictionary version to add into the product header */
29 #define MUSE_PRO_DID "PRO-1.15"
30 
31 /* regular expression of all FITS header keywords that *
32  * we want to keep from being overwritten by cpl_dfs */
33 #define MUSE_HEADERS_KEEP_REGEXP "^OBJECT$|ESO DRS MUSE"
34 
35 /* Define here the DO.CATG keywords */
36 #define MUSE_TAG_EMPTY ""
37 #define MUSE_TAG_BIAS "BIAS"
38 #define MUSE_TAG_DARK "DARK"
39 #define MUSE_TAG_FLAT "FLAT"
40 #define MUSE_TAG_SKYFLAT "SKYFLAT"
41 #define MUSE_TAG_ARC "ARC"
42 #define MUSE_TAG_WAVE "WAVE"
43 #define MUSE_TAG_MASK "MASK"
44 #define MUSE_TAG_NONLINCORR "NONLINEARITY_CORRECTION"
45 #define MUSE_TAG_MASTER_BIAS "MASTER_BIAS"
46 #define MUSE_TAG_MASTER_DARK "MASTER_DARK"
47 #define MUSE_TAG_MASTER_FLAT "MASTER_FLAT"
48 #define MUSE_TAG_MASTER_SKYFLAT "MASTER_SKYFLAT"
49 #define MUSE_TAG_TRACE_TABLE "TRACE_TABLE"
50 #define MUSE_TAG_TRACE_SAMPLES "TRACE_SAMPLES"
51 #define MUSE_TAG_WAVECAL_TABLE "WAVECAL_TABLE"
52 #define MUSE_TAG_WAVECAL_DEBUG "WAVECAL_RESIDUALS"
53 #define MUSE_TAG_LINE_CATALOG "LINE_CATALOG"
54 #define MUSE_TAG_BADPIX_TABLE "BADPIX_TABLE"
55 #define MUSE_TAG_ARC_RED_LAMP "ARC_RED_LAMP"
56 #define MUSE_TAG_ARC_RED "ARC_RED"
57 #define MUSE_TAG_ARC_RESAMP "ARC_RESAMPLED"
58 #define MUSE_TAG_WAVE_MAP "WAVE_MAP"
59 #define MUSE_TAG_GEOMETRY_TABLE "GEOMETRY_TABLE"
60 #define MUSE_TAG_MASK_REDUCED "MASK_REDUCED"
61 #define MUSE_TAG_MASK_COMBINED "MASK_COMBINED"
62 #define MUSE_TAG_SPOTS_TABLE "SPOTS_TABLE"
63 #define MUSE_TAG_EXTINCT_TABLE "EXTINCT_TABLE"
64 #define MUSE_TAG_STD_FLUX_TABLE "STD_FLUX_TABLE"
65 #define MUSE_TAG_TELLREG "TELLURIC_REGIONS"
66 #define MUSE_TAG_STD_RESPONSE "STD_RESPONSE"
67 #define MUSE_TAG_STD_TELLURIC "STD_TELLURIC"
68 #define MUSE_TAG_CUBE_STD "DATACUBE_STD"
69 #define MUSE_TAG_ASTROMETRY_REFERENCE "ASTROMETRY_REFERENCE"
70 #define MUSE_TAG_ASTROMETRY_WCS "ASTROMETRY_WCS"
71 #define MUSE_TAG_CUBE_ASTROMETRY "DATACUBE_ASTROMETRY"
72 #define MUSE_TAG_SKY_SPECTRUM "SKY_SPECTRUM"
73 #define MUSE_TAG_SKY_MASK "SKY_MASK"
74 #define MUSE_TAG_SKY_LINES "SKY_LINES"
75 #define MUSE_TAG_FILTER_LIST "FILTER_LIST"
76 #define MUSE_TAG_OUTPUT_WCS "OUTPUT_WCS"
77 #define MUSE_TAG_IMAGE_FOV "IMAGE_FOV"
78 #define MUSE_TAG_CUBE_FINAL "DATACUBE_FINAL"
79 #define MUSE_TAG_PIXTABLE_COMBINED "PIXTABLE_COMBINED"
80 #define MUSE_TAG_PIXTABLE_POSITIONED "PIXTABLE_POSITIONED"
81 #define MUSE_TAG_PIXTABLE_REDUCED "PIXTABLE_REDUCED"
82 #define MUSE_TAG_OBJECT_RESAMPLED "OBJECT_RESAMPLED"
83 /* tags used by the muse_quick_image recipe */
84 #define MUSE_TAG_QUICK_IMAGE "QUICK_IMAGE"
85 #define MUSE_TAG_MASK_IMAGE "MASK_IMAGE"
86 
87 /* Reasons to exclude frames from a framelist */
88 #define MUSE_EXCLUDE_OK 0 /* frame not excluded */
89 #define MUSE_EXCLUDE_WRONG_IFU 1 /* frame is from different IFU */
90 #define MUSE_EXCLUDE_BINNING 2 /* frame has different binning */
91 #define MUSE_EXCLUDE_NOT_RAW 3 /* frame is not a raw input frame */
92 #define MUSE_EXCLUDE_NO_HEADER 4 /* frame header cannot be loaded */
93 #define MUSE_EXCLUDE_WARN_NO_TAG 5 /* frame does not have a tag at all, outputting a warning recommended */
94 #define MUSE_EXCLUDE_WRONG_TAG 6 /* frame does not have the tag that the recipe needs */
95 
96 /* Output OBJECT headers */
97 #define OBJECT_MASTER_BIAS "Master Bias"
98 #define OBJECT_MASTER_DARK "Master Dark"
99 #define OBJECT_MASTER_FLAT "Master Flat"
100 #define OBJECT_MASTER_SKYFLAT "Master SkyFlat"
101 #define OBJECT_MASTER_ARC "Master Arc"
102 #define OBJECT_TRACE "Trace Solution"
103 #define OBJECT_WAVECAL "Wavelength Solution"
104 
105 /* Table column names of tracing table *
106  * the single digit number gives the polynomial number *
107  * (see muse_tracing.h) */
108 #define MUSE_TRACE_TABLE_COL_SLICE_NO "SliceNo" /* number of slice */
109 #define MUSE_TRACE_TABLE_COL_WIDTH "Width" /* mean width of slice in pix */
110 #define MUSE_TRACE_TABLE_COL_COEFF "tc%1d_%02d" /* polynomial coefficient */
111 #define MUSE_TRACE_TABLE_COL_MSE "MSE%1d" /* mean squared error of fit */
112 
113 /* FITS headers of a LINE_CATALOG */
114 #define MUSE_HDR_LINE_CATALOG_VERSION "VERSION"
115 /* Table column names of a LINE_CATALOG *
116  * (the table that contains the arc lamp wavelenghts) */
117 #define MUSE_LINE_CATALOG_LAMBDA "lambda"
118 #define MUSE_LINE_CATALOG_FLUX "flux"
119 #define MUSE_LINE_CATALOG_ION "ion"
120 #define MUSE_LINE_CATALOG_QUALITY "quality"
121 /* Table column names of wavelength calibration table (WAVECAL_TABLE) */
122 #define MUSE_WAVECAL_TABLE_COL_SLICE_NO "SliceNo" /* number of slice */
123 #define MUSE_WAVECAL_TABLE_COL_COEFF "wlc%1hu%1hu" /* polynomial coefficient */
124 #define MUSE_WAVECAL_TABLE_COL_MSE "MSE" /* mean squared error of fit */
125 /* Table column names of a GEOMETRY_TABLE */
126 #define MUSE_GEOTABLE_FIELD "SubField"
127 #define MUSE_GEOTABLE_CCD "SliceCCD"
128 #define MUSE_GEOTABLE_SKY "SliceSky"
129 #define MUSE_GEOTABLE_X "x"
130 #define MUSE_GEOTABLE_Y "y"
131 #define MUSE_GEOTABLE_ANGLE "angle"
132 #define MUSE_GEOTABLE_WIDTH "width"
133 
134 /* temporary properties to be propagated within the MUSE pipeline */
135 #define MUSE_HDR_TMP_REGEXP "MUSE TMP( |[0-9]+ )(FILE|NSATURATED)$" /* for easy erasing */
136 /* input filename to be used for diagnostic messages; *
137  * should be temporary and never saved to disk! */
138 #define MUSE_HDR_TMP_FN "MUSE TMP FILE"
139 #define MUSE_HDR_TMP_NSAT "MUSE TMP NSATURATED" /* number of saturated pixels */
140 #define MUSE_HDR_TMPi_NSAT "MUSE TMP%d NSATURATED"
141 
142 /* FITS keywords to store overscan statistics */
143 #define MUSE_HDR_OVSC_REGEXP "^ESO DRS MUSE OVSC"
144 #define MUSE_HDR_OVSC_MEAN "ESO DRS MUSE OVSC%1hhu MEAN"
145 #define MUSE_HDR_OVSC_STDEV "ESO DRS MUSE OVSC%1hhu STDEV"
146 #define MUSE_HDR_OVSC_PNC "ESO DRS MUSE OVSC%1hhu POLY NCOEFF"
147 #define MUSE_HDR_OVSC_PY "ESO DRS MUSE OVSC%1hhu POLY Y%hhu"
148 
149 /* FITS keywords to exchange the nonlinearity polynomials */
150 #define MUSE_HDR_NONLINn_ORDER "MUSE DRS NONLIN%1hhu POLY ORDER"
151 #define MUSE_HDR_NONLINn_COEFFo "MUSE DRS NONLIN%1hhu POLY COEFF%hhu"
152 
153 /* FITS header keywords for the flat-field levels */
154 #define MUSE_HDR_FLAT_FLUX_LAMP "ESO DRS MUSE FLAT FLUX LAMP"
155 #define MUSE_HDR_FLAT_FLUX_SKY "ESO DRS MUSE FLAT FLUX SKY"
156 
157 /* FITS header keyword to list the filter *
158  * name in the collapsed images (IMAGE_FOV) */
159 #define MUSE_HDR_FILTER "ESO DRS MUSE FILTER NAME"
160 
161 /* Bias QC headers */
162 #define QC_BIAS_PREFIXi "ESO QC BIAS INPUT%d"
163 #define QC_BIAS_MASTER_PREFIX "ESO QC BIAS MASTER"
164 #define QC_BIAS_MASTERn_PREFIX QC_BIAS_MASTER_PREFIX"%1hhu"
165 #define QC_BIAS_MASTER_RON QC_BIAS_MASTERn_PREFIX" RON"
166 #define QC_BIAS_MASTER_RONERR QC_BIAS_MASTERn_PREFIX" RONERR"
167 #define QC_BIAS_MASTER_SLOPEX QC_BIAS_MASTERn_PREFIX" SLOPE X"
168 #define QC_BIAS_MASTER_SLOPEY QC_BIAS_MASTERn_PREFIX" SLOPE Y"
169 #define QC_BIAS_MASTER_NBADPIX QC_BIAS_MASTER_PREFIX" NBADPIX"
170 
171 /* Dark QC headers */
172 #define QC_DARK_PREFIXi "ESO QC DARK INPUT%d"
173 #define QC_DARK_MASTER_PREFIX "ESO QC DARK MASTER"
174 #define QC_DARK_MASTER_NBADPIX QC_DARK_MASTER_PREFIX" NBADPIX"
175 #define QC_DARK_MASTER_DARKVALUE QC_DARK_MASTER_PREFIX" DC"
176 #define QC_DARK_MASTER_DARKERROR QC_DARK_MASTER_PREFIX" DCERR"
177 
178 /* Flat QC headers */
179 #define QC_FLAT_PREFIXi "ESO QC FLAT INPUT%d"
180 #define QC_FLAT_MASTER_PREFIX "ESO QC FLAT MASTER"
181 #define QC_FLAT_MASTER_INTFLUX QC_FLAT_MASTER_PREFIX" INTFLUX"
182 #define QC_FLAT_MASTER_THRUPUT QC_FLAT_MASTER_PREFIX" THRUPUT"
183 #define QC_FLAT_MASTER_SLICEj_MEAN QC_FLAT_MASTER_PREFIX" SLICE%d MEAN"
184 #define QC_FLAT_MASTER_SLICEj_STDEV QC_FLAT_MASTER_PREFIX" SLICE%d STDEV"
185 /* Tracing QC headers (also produced by flat recipe) */
186 #define QC_TRACE_PREFIX "ESO QC TRACE"
187 #define QC_TRACE_L_XPOS QC_TRACE_PREFIX" SLICE_L XPOS"
188 #define QC_TRACE_L_TILT QC_TRACE_PREFIX" SLICE_L TILT"
189 #define QC_TRACE_R_XPOS QC_TRACE_PREFIX" SLICE_R XPOS"
190 #define QC_TRACE_R_TILT QC_TRACE_PREFIX" SLICE_R TILT"
191 #define QC_TRACE_WIDTHS_MEDIAN QC_TRACE_PREFIX" WIDTHS MEDIAN"
192 #define QC_TRACE_WIDTHS_MEAN QC_TRACE_PREFIX" WIDTHS MEAN"
193 #define QC_TRACE_WIDTHS_STDEV QC_TRACE_PREFIX" WIDTHS STDEV"
194 #define QC_TRACE_WIDTHS_MIN QC_TRACE_PREFIX" WIDTHS MIN"
195 #define QC_TRACE_WIDTHS_MAX QC_TRACE_PREFIX" WIDTHS MAX"
196 #define QC_TRACE_GAPS_MEDIAN QC_TRACE_PREFIX" GAPS MEDIAN"
197 #define QC_TRACE_GAPS_MEAN QC_TRACE_PREFIX" GAPS MEAN"
198 #define QC_TRACE_GAPS_STDEV QC_TRACE_PREFIX" GAPS STDEV"
199 #define QC_TRACE_GAPS_MIN QC_TRACE_PREFIX" GAPS MIN"
200 #define QC_TRACE_GAPS_MAX QC_TRACE_PREFIX" GAPS MAX"
201 #define QC_TRACE_SLICE_MAXSLOPE QC_TRACE_PREFIX" SLICE%d MAXSLOPE"
202 /* Skyflat QC headers */
203 #define QC_SKYFLAT_PREFIXi "ESO QC SKYFLAT INPUT%d"
204 #define QC_SKYFLAT_MASTER_PREFIX "ESO QC SKYFLAT MASTER"
205 #define QC_SKYFLAT_MASTER_INTFLUX QC_SKYFLAT_MASTER_PREFIX" INTFLUX"
206 #define QC_SKYFLAT_MASTER_SLICEj_INTFLUX QC_SKYFLAT_MASTER_PREFIX" SLICE%d INTFLUX"
207 
208 /* Arc QC headers */
209 #define QC_WAVECAL_PREFIX "ESO QC WAVECAL"
210 #define QC_WAVECAL_PREFIXi QC_WAVECAL_PREFIX" INPUT%u"
211 #define QC_WAVECAL_PREFIXli QC_WAVECAL_PREFIX" LAMP%u INPUT%u"
212 #define QC_WAVECAL_SLICEj_PREFIX QC_WAVECAL_PREFIX" SLICE%hu"
213 #define QC_WAVECAL_SLICEj_LINES_NDET QC_WAVECAL_SLICEj_PREFIX" LINES NDET"
214 #define QC_WAVECAL_SLICEj_LINES_NID QC_WAVECAL_SLICEj_PREFIX" LINES NID"
215 #define QC_WAVECAL_SLICEj_LINES_PEAK_MEAN QC_WAVECAL_SLICEj_PREFIX" LINES PEAK MEAN"
216 #define QC_WAVECAL_SLICEj_LINES_PEAK_STDEV QC_WAVECAL_SLICEj_PREFIX" LINES PEAK STDEV"
217 #define QC_WAVECAL_SLICEj_LINES_PEAK_MIN QC_WAVECAL_SLICEj_PREFIX" LINES PEAK MIN"
218 #define QC_WAVECAL_SLICEj_LINES_PEAK_MAX QC_WAVECAL_SLICEj_PREFIX" LINES PEAK MAX"
219 #define QC_WAVECAL_SLICEj_LAMPl_LINES_PEAK_MEAN \
220  QC_WAVECAL_SLICEj_PREFIX" LAMP%d LINES PEAK MEAN"
221 #define QC_WAVECAL_SLICEj_LAMPl_LINES_PEAK_STDEV \
222  QC_WAVECAL_SLICEj_PREFIX" LAMP%d LINES PEAK STDEV"
223 #define QC_WAVECAL_SLICEj_LAMPl_LINES_PEAK_MAX \
224  QC_WAVECAL_SLICEj_PREFIX" LAMP%d LINES PEAK MAX"
225 #define QC_WAVECAL_SLICEj_LINES_FWHM_MEAN QC_WAVECAL_SLICEj_PREFIX" LINES FWHM MEAN"
226 #define QC_WAVECAL_SLICEj_LINES_FWHM_STDEV QC_WAVECAL_SLICEj_PREFIX" LINES FWHM STDEV"
227 #define QC_WAVECAL_SLICEj_LINES_FWHM_MIN QC_WAVECAL_SLICEj_PREFIX" LINES FWHM MIN"
228 #define QC_WAVECAL_SLICEj_LINES_FWHM_MAX QC_WAVECAL_SLICEj_PREFIX" LINES FWHM MAX"
229 #define QC_WAVECAL_SLICEj_RESOL QC_WAVECAL_SLICEj_PREFIX" RESOL"
230 #define QC_WAVECAL_SLICEj_FIT_NLINES QC_WAVECAL_SLICEj_PREFIX" FIT NLINES"
231 #define QC_WAVECAL_SLICEj_FIT_RMS QC_WAVECAL_SLICEj_PREFIX" FIT RMS"
232 #define QC_WAVECAL_SLICEj_DWLEN_BOT QC_WAVECAL_SLICEj_PREFIX" DWLEN BOTTOM"
233 #define QC_WAVECAL_SLICEj_DWLEN_TOP QC_WAVECAL_SLICEj_PREFIX" DWLEN TOP"
234 #define QC_WAVECAL_SLICEj_WLPOS QC_WAVECAL_SLICEj_PREFIX" WLPOS"
235 #define QC_WAVECAL_SLICEj_WLEN QC_WAVECAL_SLICEj_PREFIX" WLEN"
236 
237 /* Geometry QC headers */
238 #define QC_GEO_PREFIX "ESO QC GEO "
239 #define QC_GEO_EXPk_MEAN QC_GEO_PREFIX"EXP%d FWHM MEAN"
240 #define QC_GEO_EXPk_MEDIAN QC_GEO_PREFIX"EXP%d FWHM MEDIAN"
241 #define QC_GEO_EXPk_STDEV QC_GEO_PREFIX"EXP%d FWHM STDEV"
242 #define QC_GEO_IFUi_ANGLE QC_GEO_PREFIX"IFU%hhu ANGLE"
243 #define QC_GEO_IFUi_WLENj QC_GEO_PREFIX"IFU%hhu WLEN%d"
244 #define QC_GEO_IFUi_MEANj QC_GEO_PREFIX"IFU%hhu WLEN%d FLUX MEAN"
245 #define QC_GEO_IFUi_MEDIANj QC_GEO_PREFIX"IFU%hhu WLEN%d FLUX MEDIAN"
246 #define QC_GEO_IFUi_STDEVj QC_GEO_PREFIX"IFU%hhu WLEN%d FLUX STDEV"
247 #define QC_GEO_MASK_ANGLE QC_GEO_PREFIX"MASK ANGLE"
248 
249 /* SciBasic QC headers */
250 #define QC_SCIBASIC_PREFIX "ESO QC SCIBASIC "
251 #define QC_SCIBASIC_SHIFT QC_SCIBASIC_PREFIX"LAMBDA SHIFT"
252 
253 /* general basic reduction QC headers */
254 #define QC_BASIC_NSATURATED "NSATURATED" /* postfix! */
255 
256 /* SciPost QC headers */
257 /* header prefixes for the FWHMi.X and FWHMi.Y keywords, depending on recipe */
258 #define QC_POST_PREFIX_SCIPOST "ESO QC SCIPOST"
259 #define QC_POST_PREFIX_EXPCOMBINE "ESO QC EXPCOMB"
260 #define QC_POST_PREFIX_STANDARD "ESO QC STANDARD"
261 #define QC_POST_PREFIX_ASTROMETRY "ESO QC ASTRO"
262 /* end of the FWHMi.X and FWHMi.Y keywords, depending on recipe */
263 #define QC_POST_POSX "%s POS%d X"
264 #define QC_POST_POSY "%s POS%d Y"
265 #define QC_POST_FWHMX "%s FWHM%d X"
266 #define QC_POST_FWHMY "%s FWHM%d Y"
267 
268 /* Astrometric solution QC headers */
269 #define QC_ASTROMETRY_NSTARS "ESO QC ASTRO NSTARS"
270 #define QC_ASTROMETRY_SCX "ESO QC ASTRO SCALE X"
271 #define QC_ASTROMETRY_SCY "ESO QC ASTRO SCALE Y"
272 #define QC_ASTROMETRY_ANGX "ESO QC ASTRO ANGLE X"
273 #define QC_ASTROMETRY_ANGY "ESO QC ASTRO ANGLE Y"
274 #define QC_ASTROMETRY_RESX "ESO QC ASTRO MEDRES X"
275 #define QC_ASTROMETRY_RESY "ESO QC ASTRO MEDRES Y"
276 
277 #endif /* MUSE_DFS_H */