===Procedure for METIS_img_n_cal_InternalFlat ===

Internal flat field templates take flat field exposures for a given illumination level, and relevant instrument settings matching the observations (e.g. camera, filter, coronagraphic masks etc.). The illumination source is the WCU BB that needs to be heated up to a pre-defined temperature.  Before the science observations are taken, the integrating sphere exit aperture wheel is set to the DARK position and a series of WCU off frames is taken.
 
++++
Setup WCU|
  * Move periscopic arm to IN
  * Set temperature of the blackbody to specified temperature
  * Wait for about 45 minutes (warming up time, depends on the BB temperature selection)
  * Set ''WCU-BB-aperture-mask'' to OPEN
  * Set ''WCU-FP2.1'' to flat-field mask (open position)
  * Set ''WCU-PP1'' to ELT mask
  * Check the power readout. If the power is detectable, continue. 
  * Set ''WCU-BB-aperture-mask'' to CLOSE
  * take background measurement
  * Set ''WCU-BB-aperture-mask'' to OPEN
++++

++++
Setup CFO and subsystems|
  * Set ''CFO-PP1'' to PPS-CFO1
  * Set ''CFO-FP2'' to FIELD-14
  * Set LMS beamsplitter pickoff wheel to OUT
  * Set ''IMG-LM-PP1'' to CLOSED
  * Set the IMG-N PP1 mask to SPM-N
  * Set the IMG-N science filter to the specified filter
  * Set the IMG-N neutral density filter to the specified filter
++++

++++
Start Exposure|
  * Start exposures with the IMG-N with the requested DIT and NDIT
++++

++++
End Exposure|
  * Collect headers
  * Send file to ESO Archive
++++


===Parameters for METIS_img_n_cal_InternalFlat ===

^Parameter             ^Hidden     ^Range (default)            ^Label^
|DPR CATG              |yes        |CALIB TEST (CALIB) |Data product category|
|DPR TECH              |yes        |IMAGE IMAGE,CVC (NODEFAULT)    |Data product technique|
|DPR TYPE              |yes        |FLAT,LAMP (FLAT,LAMP)|Data product type| 
|DET2 DIT               |yes         |0..TBD (NODEFAULT)         |IMG-N Detector integration time (DIT)|
|DET2 NDIT              |yes         |1..TBD (NODEFAULT)         |IMG-N Number of Integrations (NDIT)|
|DET2 NCORRS NAME       |no         |TBD                         |IMG-N Readout mode|
|SEQ NEXPO             |no         |0..TBD (1)                 |Number of exposures|
|SEQ TIME              |no         |0..TBD (NODEFAULT)         |Total integration time (sec)|
|SEQ WCU_BB_TEMP       |yes        |TEMP-N                        |WCU BB temperature for specific filter|
|SEQ WCU_OFF_NFRAMES   |yes        |TBD                        |Number of WCU off frames to take |
|INS OPTI1 NAME         |yes        | PPS-CFO1 RAP-LM (PPS-CFO1)                |CFO-PP1 mask wheel|
|INS OPTI2 NAME         |yes        | TBD (TBD)                |CFO-FP2 ADC wheel|
|INS OPTI3 NAME   	|yes        | FIELD-11 FIELD-14 FIELD-3 VPM-L VPM-M PI-MASK PNH-1 (FIELD-14)                              |CFO FP2 mask/slit wheel |
|INS OPTI4 NAME         |yes        |OUT IN (OUT)                  |LMS beamsplitter pickoff wheel|
|INS OPTI12 NAME         |no         |open PPS-N SPM-N CLS-N (SPM-N)                  |IMG-N Mask/Grism name|
|INS OPTI13 NAME         |no         |N1 N2 PAH8.6 PAH8.6_ref PAH11.25 PAH11.25_ref [NeII] [NeII]_ref [SIV] [SIV]_ref N3 (N1)                |IMG-N Filter name|
|INS OPTI14 NAME         |no         |OPEN ND1 ND2 ND3 ND4 (NODEFAULT)                  |IMG-N Neutral density filter|
|INS OPTI16 NAME         |yes        |OUT IN (OUT)                    | IMG-N pupil imaging lens|
|INS OPTI17 NAME         |yes        |IN (IN)                    | WCU periscope arm|
|INS OPTI18 NAME	|yes                |WCU_mask AIV_mask ELT_mask (ELT_mask)             |WCU PP1 masks|
|INS OPTI19 NAME	|yes                |OPEN (OPEN)                              |WCU BB exit aperture masks|
|INS OPTI20 NAME        |yes         |flatfield (flatfield) |WCU FP2.1 mask wheel|