-
Notifications
You must be signed in to change notification settings - Fork 0
/
Recipes_Imaging_LM.tex
603 lines (551 loc) · 35.3 KB
/
Recipes_Imaging_LM.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
\subsection{LM-band imaging recipes}
\label{ssec:recipes_img_lm}
%------------------------------------------------------------------------------------------------------------------
\subsubsection{\REC*{metis_lm_img_flat}: Flatfielding}
\label{lm_img_flatfield}
\label{rec:lm_img_flatfield}
\label{sssec:lm_img_flatfield}
\label{metis_lm_img_flat}
\label{rec:metis_lm_img_flat}
\label{sssec:metis_lm_img_flat}
The purpose of the flat-field calibration is to determine
pixel-to-pixel gain variations and large scale illumination variations
(due to inhomogeneities of optical elements in the telescope or
instrument). Calibration frames are obtained either during day time
using the black-body lamp of the \ac{WCU} (internal flats) or by taken
images of the twilight sky (twilight flats). Advantages and
disadvantages of the two types of flat are discussed in
\cite{METIS-calibration_plan}. Since the operational concept for
twilight flats needs to be refined during commissioning at the
telescope, the current recipe design is primarily valid for internal
flats.
This recipe creates a master flat for the HAWAII2RG detector (LM-band
imaging) from lamp or sky images matched by various setup parameters
as detailed below. A set of internal flats includes a number of
exposures with \CODE{LAMP OFF}, which will be used for dark
subtraction. For twilight flats a master dark will be subtracted. The
master flat is obtained by the slope of a linear fit of the pixel
values against the illumination level of the exposures.
The quality control parameters give various statistics for each input
frame (mean, standard deviation, etc.), the standard deviation of the
normalised master flat and the number of bad pixels identified by the
recipe. If a bad-pixel map is provided on input, it is updated,
otherwise a new one is created.
\begin{recipedef}
Name: & \REC{metis_lm_img_flat} \\
Purpose: & Create master flat field for the LM-band imaging detector. \\
Requirements: & \REQ{METIS-6096} \\
Type: & Calibration \\
Templates: & \TPL{METIS_img_lm_cal_InternalFlat} \\
& \TPL{METIS_img_lm_cal_TwilightFlat} \\
Input data: & \RAW{LM_FLAT_LAMP_RAW} \\
& or \RAW{LM_FLAT_TWILIGHT_RAW} \\
& \EXTCALIB{BADPIX_MAP_2RG} (optional) \\
& \STATCALIB{LINEARITY_2RG} \\
& \STATCALIB{GAIN_MAP_2RG} \\
& \EXTCALIB{PERSISTENCE_MAP} \\
& \PROD{MASTER_DARK_2RG} (for twilight flats) \\
% & \EXTCALIB{BADPIX_MAP_2RG} \\
% & \STATCALIB{GAIN_MAP_2RG}\\
Matched keywords: & \FITS{DET.DIT} \\
& \FITS{DET.NDIT} \\
& \FITS{DRS.FILTER} \\
Parameters: & Combination method (\texttt{mean}, \texttt{median},
\texttt{sigclip}, \dots) \\
& Parameters for combination methods \\
& Threshold(s) for deviant-pixel identification \\
Algorithm: % & Call \DRL{metis_apply_persistence_correction} to apply the persistence correction \\
& For internal flats: call \REC{metis_det_dark} with \CODE{LAMP OFF} images to create dark frame. \\
& Subtract internal dark or master dark from flat exposures. \\
& call \REC{metis_lm_img_flat} to fit slope of pixel values against illumination level. Frames
with the same exposure time will be averaged.\\
& Compute median or average of input frames to improve statistics.\\
& Call \DRL{metis_update_lm_flat_mask} to flag deviant pixels. \\
Output data: & \PROD{MASTER_IMG_FLAT_LAMP_LM} \\
& or \PROD{MASTER_IMG_FLAT_TWILIGHT_LM} \\
& \EXTCALIB{BADPIX_MAP_2RG} \\
Expected accuracies: & 0.5\% (cf.~\cite{METIS_calerrbudget}) \\
QC1 parameters: & \QC{QC LM MFLAT RMS} \\
& \QC{QC LM MFLAT NBADPIX} \\
& \QC{QC LM FLAT MEAN} \\
& \QC{QC LM FLAT RMS} \\
& \QC{QC LM FLAT MEDIAN MIN} \\
& \QC{QC LM FLAT MEDIAN MAX} \\
& \QC{QC LM FLAT MEDIAN RMS} \\
hdrl functions: & \CODE{hdrl_bpm_fit_compute} \\
& \CODE{hdrl_imagelist_collapse} \\
& \CODE{hdrl_imagelist_sub_image} \\
\end{recipedef}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_flat}
\caption[Recipe: \REC*{metis_lm_img_flat}]{\REC*{metis_lm_img_flat} --
creation of \CODE{IMG_LM} master flatfield.}
\label{fig:metis_lm_img_flat}
\end{figure}
% \TODO{Include averaging of frames at same illumination in figure}
%------------------------------------------------------------------------------------------------------------------
\clearpage
\subsubsection{\REC*{metis_lm_img_basic_reduce}: Basic reduction}
\label{lm_img_basic}
\label{rec:lm_img_basic}
\label{sssec:lm_img_basic}
\label{metis_lm_img_basic_reduce}
\label{rec:metis_lm_img_basic_reduce}
\label{sssec:metis_lm_img_basic_reduce}
%\TODO{New recipe -- this may be too basic and could be joined with the background subtraction.}
This recipe performs the basic reduction of raw exposures from the
LM-band imager, i.e.\ dark subtraction, flat fielding and other removing
instrumental signals. It is used for both standard and science exposures.
This recipe analyses the masked detector regions for channel offset correction, crosstalk (Section~\ref{ssec:criticaldetetctormasks}) and removal of detector artefacts (electronic ghosts).
In the horizontal dimension, the masked pixels are used to correct for each channel offset.
In the vertical dimension, the masked pixels are used to correct for cross-talk.
% From Rof https://polarion.astron.nl/polarion/#/project/METIS/workitem?id=METIS-6089
% I am not sure whether the masked region should be removed from pipeline products (at least not as in this very general statement). For some products, it can be useful to inspect the masked regions and that would be much more cumbersome if they were removed from products that have undergone any form or processing. I would remove the last sentence from the requirement, or at least rephrase it. For some or even most of the high-level products, the masked region would be a nuisance if present so for most pipeline products one would indeed like to have it removed
Basic statistics of the images can be used to screen for saturation.
\begin{recipedef}
Name: & \REC{metis_lm_img_basic_reduce} \\
Purpose: & apply basic reduction of images \\
Requirements: & \REQ{METIS-6090} \\
Type: & Calibration, Science \\
Templates: & \TPL{METIS_img_lm_cal_standard} \\
% & \TPL{METIS_img_lm_*_obs_*} \\
& \TPL{METIS_img_lm_obs_AutoJitter} \\
& \TPL{METIS_img_lm_obs_GenericOffset} \\
& \TPL{METIS_img_lm_obs_FixedSkyOffset} \\
& \TPL{METIS_img_lm_app_obs_FixedOffset} \\
& \TPL{METIS_img_lm_vc_obs_FixedSkyOffset} \\
& \TPL{METIS_img_lm_cal_psf} \\
% LMN combined templates:
& \TPL{METIS_img_lmn_obs_AutoChopNod} \\
& \TPL{METIS_img_lmn_obs_GenericChopNod} \\
% All IFU templates also create an LM image:
& \TPL{METIS_ifu_obs_FixedSkyOffset} \\
& \TPL{METIS_ifu_obs_GenericOffset} \\
& \TPL{METIS_ifu_ext_obs_FixedSkyOffset} \\
& \TPL{METIS_ifu_ext_obs_GenericOffset} \\
& \TPL{METIS_ifu_vc_obs_FixedSkyOffset} \\
& \TPL{METIS_ifu_ext_vc_obs_FixedSkyOffset} \\
& \TPL{METIS_ifu_app_obs_Stare} \\
& \TPL{METIS_ifu_ext_app_obs_Stare} \\
& \TPL{METIS_ifu_cal_psf} \\
Input data: & \RAW{LM_IMAGE_SCI_RAW} or \RAW{LM_IMAGE_STD_RAW} \\
& \EXTCALIB{BADPIX_MAP_2RG} (optional) \\
% & \RAW{IFU_SKY_RAW} (Blank sky images, if available.) \\
% & \EXTCALIB{LM_DETECTOR_MASK} (if available) \\
& \STATCALIB{LINEARITY_2RG} \\
& \STATCALIB{GAIN_MAP_2RG} \\
& \EXTCALIB{PERSISTENCE_MAP} \\
& \PROD{MASTER_DARK_2RG} \\
& \PROD{MASTER_IMG_FLAT_LAMP_LM} \\
& \STATCALIB{GAIN_MAP_2RG}\\
& or \PROD{MASTER_IMG_FLAT_TWILIGHT_LM} \\
Matched keywords: & \FITS{DET.DIT} \\
& \FITS{DET.NDIT} \\
& \FITS{DRS.FILTER} \\
Algorithm: & Remove crosstalk, correct non-linearity \\
& Analyse and optionally remove masked regions \\
& Subtract dark, divide by flat \\
& Remove blank sky pattern \\
Output data: & \PROD{LM_SCI_BASIC_REDUCED} \\
& \PROD{LM_STD_BASIC_REDUCED} \\
QC1 parameters: & \QC{QC LM IMG MEDIAN} \\
& \QC{QC LM IMG STANDARD DEVIATION} \\
& \QC{QC LM IMG PEAK} \\
hdrl functions: & \CODE{hdrl_imagelist_sub_image} \\
& \CODE{hdrl_imagelist_div_image} \\
\end{recipedef}
\newgeometry{bottom=0.1cm, right=0.1cm, left=0.1cm, top=0.1cm}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_basic_reduce}
\caption[Recipe: \REC*{metis_lm_img_basic_reduce}]{\REC*{metis_lm_img_basic_reduce} --
basic reduction of \CODE{IMG_LM} data.}
\label{fig:metis_lm_img_basic_reduce}
\end{figure}
\restoregeometry
%------------------------------------------------------------------------------------------------------------------
\clearpage
\subsubsection{\REC*{metis_lm_img_background}: Background subtraction}
\label{lm_img_background}
\label{rec:lm_img_background}
\label{sssec:lm_img_background}
\label{metis_lm_img_background}
\label{rec:metis_lm_img_background}
\label{sssec:metis_lm_img_background}
This recipe estimates and subtracts the background from LM-band
imaging data. Thermal background emission from the atmosphere,
telescope and warm parts of the instrument dominate the photon count
in mid-infrared observations. Accurate determination and removal of
background counts is therefore crucial to make MIR data scientifically
usable.
A set of observations will consist of a number of exposures
of the field, where the offsets are achieved by either using the internal
chopper of METIS or by telescope nodding. For extended objects, the
telescope will be used to perform ``out-of-field nodding'', i.e.\
observe nearby blank patches of sky interlaced with the target
observations. Imaging observations are performed in pupil-tracking
mode, hence angular offsetting of the field is automatic.
For in-field-offset exposures, all offset exposures will be
averaged to obtain the background estimate. In order to only average
the background contribution, an iterative procedure of object
detection and masking will be employed. Averaging will be done using a
robust estimator of the mean (e.g.\ median).
For extended objects, all out-of-field exposures will be averaged
(with object rejection) and subtracted off the in-field exposures.
For more information see Section~\ref{sssec:lmbandsbackgroundsubtracion}.
% Moved to https://github.com/AstarVienna/METIS_DRLD/issues/99
% \TODO{Object catalogues of the target exposures could be created within this
% recipe or in a separate recipe. The catalogue should contain for each
% object: pixel coordinates ($x$, $y$), world coordinates ($\alpha$,
% $\delta$) based on telescope pointing and derotator information, total
% counts within an aperture.}
%
% \TODO{Is this good enough for HCI images or do we need more?}
\begin{recipedef}
Name: & \REC{metis_lm_img_background} \\
Purpose: & estimate and subtract background \\
Requirements: & \REQ{METIS-6085} and \REQ{METIS-6086} \\
Type: & Calibration \\
% HB 20230710: I've commented these all out because this recipe is not triggered directly by a template.
% Templates: & \TPL{METIS_img_lm_cal_standard} \\
%% & \TPL{METIS_img_lm_*_obs_*} \\
% & \TPL{METIS_img_lm_obs_AutoJitter} \\
% & \TPL{METIS_img_lm_obs_GenericOffset} \\
% & \TPL{METIS_img_lm_obs_FixedSkyOffset} \\
% & \TPL{METIS_img_lm_app_obs_FixedOffset} \\
% & \TPL{METIS_img_lm_vc_obs_FixedSkyOffset} \\
% & \TPL{METIS_img_lmn_obs_AutoChopNod} \\
% & \TPL{METIS_img_lmn_obs_GenericChopNod} \\
Input data: & \PROD{LM_SCI_BASIC_REDUCED} \\
& \PROD{LM_STD_BASIC_REDUCED} \\
Matched keywords: & \FITS{DRS.FILTER} \\
Algorithm: & Average all or \CODE{SKY} exposures with object rejection \\
& Subtract background \\
Output data: & \PROD{LM_SCI_BKG} \\
& \PROD{LM_STD_BKG} \\
& \PROD{LM_SCI_BKG_SUBTRACTED} \\
& \PROD{LM_STD_BKG_SUBTRACTED} \\
& \PROD{LM_SCI_OBJECT_CAT} \\
& \PROD{LM_STD_OBJECT_CAT} \\
QC1 parameters: & \QC{QC LM IMG BKG MEDIAN} \\
& \QC{QC LM IMG BKG MEDIAN DEVIATION} \\
hdrl functions: & \CODE{hdrl_imagelist_sub_image} \\
& \CODE{hdrl_imagelist_div_image} \\
& \CODE{hdrl_catalogue_compute} \\
\end{recipedef}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_background}
\caption[Recipe: \REC*{metis_lm_img_background}]{\REC*{metis_lm_img_background} --
background estimation and subtraction of offset \CODE{IMG_LM} exposures.}
\label{fig:metis_lm_img_background}
\end{figure}
%------------------------------------------------------------------------------------------------------------------
\clearpage
% \subsubsection{LM-band imaging astrometry calibration}
%
% HB: I've commented the lm_img_astrometry_calib recipe out as it seems
% not necessary. The two outputs as defined are:
% - LM_STD_AST_CALIB: this is raw data produced by the
% template METIS_img_lm_cal_standard, and thus should not be the
% output of a recipe.
% - ASTROMETRY_TAB: this seems equivalent to LM_DISTORTION_TABLE, or
% at least very similar.
% \REC replaced with \CODE to placate test scripts.
%
% \label{lm_img_astrometry_calib}
% \label{rec:lm_img_astrometry_calib}
% \label{sssec:lm_img_astrometry_calib}
% \label{metis_lm_img_astrometry_process}
% \label{rec:metis_lm_img_astrometry_process}
% \label{sssec:metis_lm_img_astrometry_process}
% This recipe is the conversion of the pixel coordinates (X,Y) of objects in an image
% into their corresponding celestial coordinates of right ascension (RA) and
% declination (Dec). The recipe for astrometry calibration involves several
% steps that must be carried out precisely to achieve accurate results.
%
% The first step of the recipe involves identifying a set of reference stars
% in the image, whose coordinates are well known and can be obtained from a
% catalog. This requires careful selection and verification of the reference stars,
% as their accuracy determines the accuracy of the final calibration.
%
% The next step is to use these reference stars to establish a mapping between
% the image's pixel coordinates and their corresponding celestial coordinates. This
% is achieved through a process called plate solving, which involves solving a set
% of mathematical equations to determine the transformation between pixel and celestial
% coordinates. This process requires careful selection of the appropriate transform function
% and calibration parameters.
%
% \begin{recipedef}
% Name: & \REC*{metis_lm_img_astrometry_process} \\
% Purpose: & Determine conversion factor between pixel and world coordinates \\
% Type: & Calibration \\
% Templates: & \TPL{METIS_img_lm_cal_standard} \\
% Input data: & \PROD{LM_STD_BKG_SUBTRACTED} \\
% & photometric standard catalogue \\
% Matched keywords: & OBJECT ID \\
% & FILTER ID \\
% Parameters: & Distortion correction functions \\
% Algorithm: & Measure position of stars in pixel coordinates \\
% & Compute conversion factor to world coordinates \\
% & Measure and evaluate the error. \\
% Output data: & \PROD{LM_STD_AST_CALIB} \\
% & \PROD{ASTROMETRY_TAB} \\
% Expected accuracies: & $>$0.1$\arcsec$ \\
% QC1 parameters: & \QC{QC LM AST X POS ERR} \\
% & \QC{QC LM AST Y POS ERR} \\
% & \QC{QC LM AST RA POS ERR} \\
% & \QC{QC LM AST DEC POS ERR} \\
% hdrl function: & \CODE{hdrl_strehl_compute} \\
% & \CODE{hdrl_catalogue_compute} \\
% & \CODE{hdrl_efficiency_compute} \\
% & \CODE{hdrl_imagelist_collapse} \\
% \end{recipedef}
%
% \begin{figure}[hb]
% \centering
% \includegraphics[width=1.0\textwidth]{metis_lm_img_astrometry_process}
% %\resizebox{0.6\textwidth}{0.1\textwidth}{\TODO{\fbox{Figure to be done}}}
% \caption[Recipe: \CODE{metis_lm_img_astrometry_process}]{\CODE{metis_lm_img_astrometry_process} --
% compute conversion between pixel and sky coordinate}
% \label{fig:metis_lm_img_astrometry_process}
% \end{figure}
%
%
% \clearpage
\subsubsection{\REC*{metis_lm_img_std_process}: Photometric standard analysis}
\label{lm_img_photstd}
\label{rec:lm_img_photstd}
\label{sssec:lm_img_photstd}
\label{rec:metis_lm_img_std_process}
This recipe determines the conversion from ADU to physical units from
a set of reduced exposures of a photometric standard star. The flux of
the star is measured in each exposure in ADU, normalised to an
exposure time of 1~second and averaged over all exposures. In
addition, the exposures are stacked (after recentering on the standard
star, but without derotation) and the flux is measured in the combined
image. Comparison to the tabulated brightness of the star in the
observing filter yields the conversion factor from
$\mathrm{ADU\,s^{-1}}$ to $\mathrm{photons\,\,s^{-1}\,cm^{-2}}$.
QC parameter will include estimates of the sensitivity for the
detection of point sources and surface brightness sensitivity
following~\cite{visir_manual}.
\begin{recipedef}
Name: & \REC{metis_lm_img_std_process} \\
Purpose: & Determine conversion factor between detector counts and physical source flux \\
Type: & Calibration \\
% HB 20230710: I've commented the template out because this recipe is not triggered directly by a template.
% Templates: & \TPL{METIS_img_lm_cal_standard} \\
Input data: & \PROD{LM_STD_BKG_SUBTRACTED} \\
& \EXTCALIB{FLUXSTD_CATALOG} (photometric standard catalogue) \\
Matched keywords: & \FITS{DRS.FILTER} \\
Parameters: & None \\
Algorithm: & Call \DRL{metis_lm_calculate_std_flux} to measure flux in input images \\
% & call \DRL{recentre_img} to recentre and stack images \\
& call \CODE{hdrl_resample_compute} to recenter the images \\
& call \CODE{hdrl_imagelist_collapse} to stack the images \\
& call \DRL{metis_lm_calculate_std_flux} on the stacked image to get flux of the star in detector units\\
& call \DRL{metis_calculate_std_fluxcal} to calculate the conversion factor to physical units \\
& call \DRL{metis_calculate_detection_limits} to compute measure background noise (std,rms) and compute detection limits \\
Output data: & \PROD{LM_STD_COMBINED} \\
& \PROD{FLUXCAL_TAB} \\
Expected accuracies: & 3\% (cf.~\cite{METIS_calerrbudget}) \\
QC1 parameters: & \QC{QC LM IMG STD BACKGD RMS} \\
& \QC{QC LM STD PEAK CNTS} \\
& \QC{QC LM STD APERTURE CNTS} \\
& \QC{QC LM STD STREHL} \\
& \QC{QC LM STD FLUXCONV} \\
& \QC{QC LM STD AIRMASS} \\
& \QC{QC LM SENS} \\
& \QC{QC LM AREA SENS} \\
hdrl functions: & \CODE{hdrl_strehl_compute} \\
& \CODE{hdrl_catalogue_compute} \\
& \CODE{hdrl_efficiency_compute} \\
& \CODE{hdrl_imagelist_collapse} \\
\end{recipedef}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_std_process}
\caption[Recipe: \REC*{metis_lm_img_std_process}]{\REC*{metis_lm_img_std_process} --
compute conversion between ADU and physical flux units}
\label{fig:metis_lm_img_std_process}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------------------------------------------------------------------------------------------------------
\clearpage
\subsubsection{\REC*{metis_lm_img_calibrate}: Image calibration}
\label{lm_img_calibrate}
\label{rec:metis_lm_img_calibrate}
\label{rec:lm_img_calibrate}
\label{sssec:lm_img_calibrate}
This recipe applies the flux calibration to the reduced science
images and adds geometric calibration data to the FITS header. The
products of this recipe are fully calibrated individual exposures.
Each image is multiplied by the conversion factor such that pixel
values are in units of photons per second per centimetre squared. The
header of each file receives keyword \FITS*{BUNIT} with value %
\CODE{'photon.s**(-1).cm**(-2)'}.
% Moved to https://github.com/AstarVienna/METIS_DRLD/issues/98
% \TODO{Other units may be possible, although additional information is
% needed. For instance,\\ \CODE{photon.s**(-1).cm**(-2).arcsec**(-2)} makes
% values independent of the pixel scale, but requires a distortion map
% (variation of pixel scale across the detector). Energy units (erg
% instead of photons) require knowledge of the spectral energy
% distribution of the sources, in particular for broad-band filters.}
LM-band imaging observations will be performed in pupil-tracking mode
\cite{METIS-operational_concept}, which means that the field rotates
from exposure to exposure. The information about the field
orientation along with target coordinates, pixel scale and
higher-order polynomial distortion coefficients is written to the FITS
header. The images are not resampled by this recipe, this is left to
\REC{metis_lm_img_sci_postprocess}.
\begin{recipedef}
Name: & \REC{metis_lm_img_calibrate} \\
Purpose: & Convert science images to physical units \\
& Add distortion information \\
Type: & Calibration \\
Templates & None \\
Input data: & \PROD{LM_SCI_BKG_SUBTRACTED} \\
& \PROD{FLUXCAL_TAB} \\
& \PROD{LM_DISTORTION_TABLE} \\
Matched keywords: & \FITS{DRS.FILTER} \\
Parameters: & None \\
Algorithm: & call \DRL{metis_lm_scale_image_flux} to Scale image data to ph/s \\
& add header information (\FITS*{BUNIT}, WCS, etc.) \\
Output data: & \PROD{LM_SCI_CALIBRATED} \\
QC1 parameters: & None \\
hdrl functions: & \CODE{hdrl_imagelist_mult_scalar} \\
\end{recipedef}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_calibrate}
\caption[Recipe: \REC*{metis_lm_img_calibrate}]{\REC*{metis_lm_img_calibrate} --
Convert images to physical flux units and update FITS header}
\label{fig:metis_lm_img_calibrate}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------------------------------------------------------------------------------------------------------
\clearpage
\subsubsection{\REC*{metis_lm_img_sci_postprocess}: Image post-processing}
\label{lm_img_postprocess}
\label{rec:lm_img_postprocess}
\label{sssec:lm_img_postprocess}
\label{rec:metis_lm_img_sci_postprocess}
This recipe coadds a sequence of flux-calibrated,
background-subtracted images (possibly from several observing blocks)
after resampling the images on a common pixel grid defined by a
standard sky projection.
% The alignment of the images (\FITS{CRVAL} keywords, rotation) may have to be checked and refined through cross-correlation of the overlapping images (TBC).
The alignment of the images is done through by using the position of the \ac{WFS-FS} mirror.
% TODO: Decide how the WFS-FS data is stored in the raw data.
% See https://github.com/AstarVienna/METIS_DRLD/issues/162
The number of input
images contributing to any pixel in the output image (variable due to
offsets and bad pixels) will be documented in a contribution
map.
The output files fulfill the \ac{SDP} criteria and are compliant with \REQ{METIS-6104}.
\begin{recipedef}
Name: & \REC{metis_lm_img_sci_postprocess} \\
Purpose: & Coadd reduced images. \\
Requirements: & \REQ{METIS-6104} \\
Templates: & None \\
Type: & Science \\
Input data: & \PROD{LM_SCI_CALIBRATED} (Calibrated science images) \\
% & \EXTCALIB{BADPIX_MAP_2RG} (Associated bad-pixel maps) \\
Matched keywords: & \FITS{DRS.FILTER} \\
Parameters: & None \\
Algorithm: & Check and refine WCS of input images by using the \ac{WFS-FS} data. \\
& Determine output pixel grid encompassing all input images. \\
& Call \CODE{hdrl_resample_compute} to recenter the images. \\
& Call \CODE{hdrl_imagelist_collapse} to stack the images. \\
Output data: & \PROD{LM_SCI_COADD} (coadded, mosaiced image) \\
% TheLM_SCI_COADD_ERROR and LM_SCI_COADD_CONTRIB can be layers in LM_SCI_COADD
% & \PROD{LM_SCI_COADD_ERROR} (coadded, mosaiced error image) \\
% & \PROD{LM_SCI_COADD_CONTRIB} (contribution map) \\
Expected accuracies: & n/a \\
QC1 parameters: & \QC{QC LM SCI NEXP} \\
& \QC{QC LM SCI POSTPROC GRIDRNG} \\
& \QC{QC LM SCI POSTPROC MEDMEAN} \\
& \QC{QC LM SCI POSTPROC MEDRMS} \\
& \QC{QC LM SCI POSTPROC MEDMED} \\
& \QC{QC LM SCI POSTPROC DELTAC} \\
\end{recipedef}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_sci_postprocess}
\caption[Recipe: \REC*{metis_lm_img_sci_postprocess}]{%
\REC{metis_lm_img_sci_postprocess} -- post-processing (coaddition)
of reduced \CODE{IMG_LM} science frames.}
\label{fig:metis_lm_img_sci_postprocess}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%------------------------------------------------------------------------------------------------------------------
\clearpage
\subsubsection{\REC*{metis_lm_img_distortion}: Distortion calibration}
\label{rec:metis_lm_img_distortion}
\label{lm_img_distortion}
\label{rec:lm_img_distortion}
\label{sssec:lm_img_distortion}
Calibration of the imaging distortion is done on an image of a
pin-hole grid mask located in the \ac{WCU}. The
distortion is described in terms of a polynomial model whose
coefficients can be transformed to WCS keywords and applied to any
other pipeline product. In addition to the distortion table, a map of
pixel scale across the detector will be created.
\begin{recipedef}
Name: & \REC{metis_lm_img_distortion} \\
Purpose: & Determine optical distortion coefficients for the LM imager. \\
Requirements: & \REQ{METIS-6087} \\
Templates: & \TPL{METIS_img_lm_cal_distortion} \\
Type: & Calibration \\
Input data: & \RAW{LM_DISTORTION_RAW} (Images of grid mask in WCU-FP2 or CFO-FP2.)\\
& \RAW{LM_WCU_OFF_RAW} \\
& \EXTCALIB{BADPIX_MAP_2RG} (optional) \\
& \EXTCALIB{PERSISTENCE_MAP} \\
& \STATCALIB{LINEARITY_2RG} \\
& \STATCALIB{GAIN_MAP_2RG} \\
& \EXTCALIB{PINHOLE_TABLE} (Grid of pinhole mask positions) \\
Matched keywords: & \FITS{DRS.FILTER} \\
% & \EXTCALIB{BADPIX_MAP_2RG} \\
Parameters: & Parameters for fitting routine \\
% & \TBD \\
Algorithm: & Subtract background image. (\CODE{hdrl_imagelist_sub_image}) \\
& Measure location of point source images in frames (\CODE{hdrl_catalogue_create}) \\
& call \DRL{metis_fit_distortion} to fit polynomial coefficients to deviations from grid positions. \\
Output data: & \PROD{LM_DISTORTION_TABLE} \\
& \PROD{LM_DISTORTION_MAP} \\
& \PROD{LM_DIST_REDUCED} \\
Expected accuracies: & $10^{-3}$ (cf.~\cite{METIS_calerrbudget}) \\
QC1 parameters: & \QC{QC LM DISTORT RMS} \\
& \QC{QC LM DISTORT NSOURCE} \\
hdrl functions: & \CODE{hdrl_catalogue_create} \\
& \CODE{hdrl_imagelist_sub_image} \\
\end{recipedef}
\newgeometry{bottom=0.5cm, right=0.5cm, left=0.5cm}
\begin{figure}[hb]
\centering
\def \globalscale {0.700000}
\fontsize{10}{12}\selectfont
\input{tikz/metis_lm_img_distortion}
\caption[Recipe: \REC*{metis_lm_img_distortion}]{%
\REC{metis_lm_img_distortion} -- LM IMG distortion calibration}
\label{fig:metis_lm_img_distortion}
\end{figure}
\restoregeometry
\FloatBarrier
%%% Local Variables:
%%% TeX-master: "METIS_DRLD"
%%% End: