==== Science imaging template METIS_img_lm_obs_AutoJitter ====

=== Procedure for METIS_img_lm_obs_AutoJitter ===
 
++++
Setup imager|
  * Move ''IMG-LM PP1 FILT'' to selected filter
  * Move ''IMG-LM PP1 ND'' to selected neutral density filter 
  * Set detector parameters (DIT, NDIT, readout mode, cube mode T/F)
++++
++++
Start science exposures|

  * This template offsets the telescope between exposures according to a random pattern automatically determined by the template. The offsets are distributed randomly within a box whose size is defined by the parameter ''Jitter Box Width'' (in arc seconds). The distance between any two points in a series of 10 values is greater than a system-determined minimum. This is intentionally done to ensure that the 5 frames before and after any frame are spatially not too close and can be safely used for creating a background model for subtraction.
  * Dithering is performed using CFO-PP2 chopper or telescope offsets.
  * Offset the chosen actuator (telescope or chopper)
  * At each offset position start science exposures with DIT/NDIT. 
  * At each offset position perform ''Nexp'' number of exposures.
  * Read-out and save individual exposures, or co-added frames, depending on the ''cube mode'' T/F keyword.

++++
++++
End science exposures|
  * Return telescope or chopper (depending on which actuator is used for offsetting) back to the initial position. 
  * Collect headers
  * Merge into one or more data cubes
  * Send cube to ESO Archive
  * Send cube to Pipeline machine or ICS storage (tbd)
  * Go back to Setup Imager until target observations are finished (single OB). For example, to observe in a different filter.

At the end of the OB:
  * Stop chopper
  * Stop CFO pupil stabilization
  * Stop AO
    * open loop
    * stop field stabilization
    * stop registration
    * stop modulation
  * Select "DARK" position in CFO-PP1
  * [comment] as per recommendation by ELT WG on persistence (May 2022)
  * Stop derotator
  * Handover to telescope
    * CCS takes control of M4 and M5
    * Telescope gets ready for next preset
++++

===Parameters for METIS_img_lm_obs_AutoJitter ===


^Parameter             ^Hidden     ^Range (default)            ^Label^  
|DPR CATG              |yes        |SCIENCE TEST (SCIENCE) |Data product category|
|DPR TECH              |yes        |IMAGE (IMAGE)                 |Data product technique|
|DPR TYPE              |yes        |OBJECT STD (OBJECT)|Data product type|                      
|DET1 DIT               |yes         |0..TBD (NODEFAULT)         |IMG-LM Detector integration time (DIT)|
|DET1 NDIT              |yes         |1..TBD (NODEFAULT)         |IMG-LM Number of Integrations (NDIT)|
|DET1 NCORRS NAME       |no         |TBD                         |IMG-LM Readout mode|
|DET1 CUBE MODE        |yes         |T F (T)                    |Toggle cube mode| 
|INS OPTI10 NAME         |no         |L' H2Oice shortL IB4.05 PAH3.3 PAH3.3ref Br-alpha Br-alpharef M' CO(1-0)/ice COref HCIL-short HCIL-long (L')                |IMG-LM Filter name|
|INS OPTI11 NAME         |no         |OPEN ND1 ND2 ND3 ND4 ND5 (NODEFAULT)                  |IMG-LM Neutral density filter|
|SEQ TIME              |no         |0..TBD (NODEFAULT)         |Total integration time (sec)|
|SEQ JITTER WIDTH      |no         |0..5 (NODEFAULT)           |Jitter Box Width (arcsec)|
|SEQ NEXPO             |no         |0..1000 (NODEFAULT)        |Number of exposures per offset|
|SEQ NOFFSETS          |no         |0...1000 (NODEFAULT)       |Total number of offsets|
|SEQ POISSON           |yes        |1..100 (10)                |Random throw generator|
|SEQ RETURN            |no         |T F (T)                    |Return to origin?|

  
Notes:
  * System should automatically calculate the offset parameters as a result from the list of random jittering offsets (offsets are done either with the chopper or with the telescope)