MAJIS ITL reader and exporter#

from majis import read_itl, save_itl

Juice instrument timeline files (ITL) come with two flavors, one in plain text file (a.k.a. EPS) and one in JSON format. Both files should contains the same logic, a description on of the observation blocks, however they are not strictly the same.

In this package we try to simplify as much as possible the reader and writer of these files.

Load absolute time ITL as EventsDict#

Load of an ITL file (either EPS or JSON) will regenerate a EventsDict object that will group the observations based on their name:

itl_abs = read_itl('ITL_absolute_time.json')

itl_abs
event#t_startt_stop
0MAJ_JUP_DISK_SCAN22032-09-232032-09-23
itl_abs['MAJ_JUP_DISK_SCAN']
OBS_KEYOBS_NAMEINSTRUMENTTYPEOBSERVATION_TYPETARGETPOINTINGPOINTING_DESIGNERt_startt_endSCENARIOCU_TREPCU_FRAMEBINNINGPPESTART_ROW_VISMIRROR_FLAGSTART_ANGLESTOP_ANGLETICK_FREQSYNCHRONOUSSTART_SCAN_SPEEDSTOP_SCAN_SPEEDPRIMEITLCOMMENTS
0MAJ_JUP_DISK_SCANMAJ_JUP_DISK_SCAN_001MAJISOBSERVATIONPRIMEJUPITERMAJISTrue2032-09-23T05:15:45.000Z2032-09-23T05:26:15.000ZS007_015003001400100ENABLE-1.310510.102021MHz00.00224210780.0022421078TrueITL_absolute_time.jsonThis comment will be included in the exported ITL file.
1MAJ_JUP_DISK_SCANMAJ_JUP_DISK_SCAN_002MAJISOBSERVATIONRIDERJUPITERFalse2032-09-23T06:09:45.000Z2032-09-23T06:20:15.000ZS007_0121003002400372ENABLE1.32935-0.083188MHz3-0.0022421078-0.0022421078FalseITL_absolute_time.json

It is also possible to load the same file in text/EPS format:

itl_abs_eps = read_itl('absolute_time.itl')

itl_abs_eps
event#t_startt_stop
0MAJ_JUP_DISK_SCAN22032-09-232032-09-23
itl_abs_eps['MAJ_JUP_DISK_SCAN']
t_startt_endINSTRUMENTSCENARIOOBS_NAMETARGETCU_TREPCU_FRAMEBINNINGPPESTART_ROW_VISSTART_ANGLESTOP_ANGLESYNCHRONOUSSTART_SCAN_SPEEDSTOP_SCAN_SPEEDPRIMECOMMENTSITL
02032-09-23T05:15:452032-09-23T05:26:15MAJISS007_01MAJ_JUP_DISK_SCAN_001JUPITER500ms3001400100-1.31051+0.102020+0.0022421078+0.0022421078TrueMULTI WORDS COMMENT with , and ; / MULTI LINES COMMENTabsolute_time.itl
12032-09-23T06:09:452032-09-23T06:20:15MAJISS007_01MAJ_JUP_DISK_SCAN_002JUPITER2100ms3002400372+1.32935-0.08318+3-0.0022421078-0.0022421078Trueabsolute_time.itl

Load relative time ITL as EventsList (as a flat list)#

Note

At the moment, only EPS file supports relative time input.

itl_rel = read_itl('relative_time.itl', refs='events.evf', flat=True)

itl_rel
t_startt_endINSTRUMENTSCENARIOOBS_NAMETARGETCU_TREPCU_FRAMEBINNINGPPESTART_ROW_VISSTART_ANGLESTOP_ANGLESYNCHRONOUSSTART_SCAN_SPEEDSTOP_SCAN_SPEEDPRIMECOMMENTSITL
02032-09-23T02:58:11.0002032-09-23T03:01:59.900MAJISS007_01MAJ_JUP_DISK_SCAN_101JUPITER100ms109164436-0.27937+0.23385+3+0.0022421078+0.0022421078Falserelative_time.itl
12032-09-23T03:04:34.0002032-09-23T03:08:22.900MAJISS007_01MAJ_JUP_DISK_SCAN_102JUPITER200ms109464802-0.37981+0.13341+3+0.0022421078+0.0022421078Falserelative_time.itl

Concatenate ITL files into a single file#

save_itl('output.itl', itl_abs, itl_rel)
# MAJIS - SCENARIO=S007_01 OBS_NAME=MAJ_JUP_DISK_SCAN_101 TARGET=JUPITER CU_TREP=100ms
# MAJIS - CU_FRAME=109 BINNING=1 PPE=64 START_ROW_VIS=436 START_ANGLE=-0.27937
# MAJIS - STOP_ANGLE=+0.23385 SYNCHRONOUS=+3 START_SCAN_SPEED=+0.0022421078
# MAJIS - STOP_SCAN_SPEED=+0.0022421078
2032-09-23T02:58:11Z  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN
2032-09-23T03:01:59.900Z  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

# MAJIS - SCENARIO=S007_01 OBS_NAME=MAJ_JUP_DISK_SCAN_102 TARGET=JUPITER CU_TREP=200ms
# MAJIS - CU_FRAME=109 BINNING=4 PPE=64 START_ROW_VIS=802 START_ANGLE=-0.37981
# MAJIS - STOP_ANGLE=+0.13341 SYNCHRONOUS=+3 START_SCAN_SPEED=+0.0022421078
# MAJIS - STOP_SCAN_SPEED=+0.0022421078
2032-09-23T03:04:34Z  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN
2032-09-23T03:08:22.900Z  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

# MAJIS - OBS_KEY=MAJ_JUP_DISK_SCAN OBS_NAME=MAJ_JUP_DISK_SCAN_001 TYPE=OBSERVATION
# MAJIS - OBSERVATION_TYPE=PRIME TARGET=JUPITER POINTING=MAJIS POINTING_DESIGNER=True
# MAJIS - SCENARIO=S007_01 CU_TREP=500 CU_FRAME=300 BINNING=1 PPE=400 START_ROW_VIS=100
# MAJIS - MIRROR_FLAG=ENABLE START_ANGLE=-1.31051 STOP_ANGLE=0.10202 TICK_FREQ=1MHz
# MAJIS - SYNCHRONOUS=0 START_SCAN_SPEED=0.0022421078 STOP_SCAN_SPEED=0.0022421078
# MAJIS - COMMENT: This comment will be included in the exported ITL file.
2032-09-23T05:15:45Z  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN (PRIME=TRUE)
2032-09-23T05:26:15Z  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

# MAJIS - OBS_KEY=MAJ_JUP_DISK_SCAN OBS_NAME=MAJ_JUP_DISK_SCAN_002 TYPE=OBSERVATION
# MAJIS - OBSERVATION_TYPE=RIDER TARGET=JUPITER POINTING=None POINTING_DESIGNER=False
# MAJIS - SCENARIO=S007_01 CU_TREP=2100 CU_FRAME=300 BINNING=2 PPE=400 START_ROW_VIS=372
# MAJIS - MIRROR_FLAG=ENABLE START_ANGLE=1.32935 STOP_ANGLE=-0.08318 TICK_FREQ=8MHz
# MAJIS - SYNCHRONOUS=3 START_SCAN_SPEED=-0.0022421078 STOP_SCAN_SPEED=-0.0022421078
2032-09-23T06:09:45Z  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN
2032-09-23T06:20:15Z  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

Note

  • When multiple ITL are provided, they will be concatenate and ordered by increasing time.

  • Absolute and relative ITL are compatible.

  • Observation block must not overlap (can be by-pass with overlap=True)

  • If no relative reference is provided, the output will be in absolute time (see below for relative time).

Export ITL in JSON format#

save_itl('ITL_output.json', itl_abs)
{
  "header": {
    "filename": "ITL_output.json",
    "creation_date": "2026-04-29T16:29:52.481Z",
    "author": "docs"
  },
  "timeline": [
    {
      "name": "MAJ_JUP_DISK_SCAN",
      "unique_id": "MAJ_JUP_DISK_SCAN_001",
      "instrument": "MAJIS",
      "type": "OBSERVATION",
      "observation_type": "PRIME",
      "target": "JUPITER",
      "pointing": "MAJIS",
      "pointing_designer": true,
      "start_time": "2032-09-23T05:15:45Z",
      "end_time": "2032-09-23T05:26:15Z",
      "parameters": {
        "scenario_id": "S007_01",
        "cu_trep_ms": 500,
        "nb_cu_frames_tot": 300,
        "spatial_binning": 1,
        "ppe": 400,
        "start_row_vi": 100,
        "mirror_flag": "ENABLE",
        "start_angle": -1.31051,
        "stop_angle": 0.10202,
        "tick_freq": "1MHz",
        "scanner_step_per_frame": 0,
        "start_scan_speed": 0.0022421078,
        "stop_scan_speed": 0.0022421078
      },
      "comment": "This comment will be included in the exported ITL file."
    },
    {
      "name": "MAJ_JUP_DISK_SCAN",
      "unique_id": "MAJ_JUP_DISK_SCAN_002",
      "instrument": "MAJIS",
      "type": "OBSERVATION",
      "observation_type": "RIDER",
      "target": "JUPITER",
      "pointing": null,
      "pointing_designer": false,
      "start_time": "2032-09-23T06:09:45Z",
      "end_time": "2032-09-23T06:20:15Z",
      "parameters": {
        "scenario_id": "S007_01",
        "cu_trep_ms": 2100,
        "nb_cu_frames_tot": 300,
        "spatial_binning": 2,
        "ppe": 400,
        "start_row_vi": 372,
        "mirror_flag": "ENABLE",
        "start_angle": 1.32935,
        "stop_angle": -0.08318,
        "tick_freq": "8MHz",
        "scanner_step_per_frame": 3,
        "start_scan_speed": -0.0022421078,
        "stop_scan_speed": -0.0022421078
      },
      "comment": ""
    }
  ]
}

In the case of JSON export, the content of the ITL is checked against the SOC and MAJIS ITL schemas. For example, here, the itl_rel is missing the MIRROR_FLAG required parameter to be exported as a JSON ITL:

save_itl('ITL_output.json', itl_rel)
---------------------------------------------------------------------------
ValidationError                           Traceback (most recent call last)
Cell In[11], line 1
----> 1 save_itl('ITL_output.json', itl_rel)

File ~/checkouts/readthedocs.org/user_builds/majis-ops/envs/stable/lib/python3.10/site-packages/majis/itl/export.py:40, in save_itl(fout, ref, overlap, *events, **kwargs)
     32     return save_itl_eps(
     33         fout,
     34         *events,
   (...)
     37         **kwargs,
     38     )
     39 case '.json':
---> 40     return save_itl_json(
     41         fout,
     42         *events,
     43         ref=ref,
     44         overlap=overlap,
     45         **kwargs,
     46     )
     47 case '.csv':
     48     return save_itl_csv(
     49         fout,
     50         *events,
   (...)
     53         **kwargs,
     54     )

File ~/checkouts/readthedocs.org/user_builds/majis-ops/envs/stable/lib/python3.10/site-packages/majis/misc/events.py:85, in flatten_events.<locals>.wrapper(fout, overlap, *events, **kwargs)
     83 """Concatenate events blocks before the calling the main function."""
     84 blocks = concatenate(*events, flat=True, overlap=overlap)
---> 85 return func(fout, *blocks, **kwargs)

File ~/checkouts/readthedocs.org/user_builds/majis-ops/envs/stable/lib/python3.10/site-packages/majis/itl/json/export.py:41, in save_itl_json(fout, ref, overlap, fmt, *events)
     35 content = {
     36     'header': get_header(fout, fmt=fmt),
     37     'timeline': [fmt_json(event) for event in events],
     38 }
     40 for schema in MAJIS_SCHEMAS[fmt]:
---> 41     schema.validate(content)
     43 return save_file(fout, content, suffix='.json')

File ~/checkouts/readthedocs.org/user_builds/majis-ops/envs/stable/lib/python3.10/site-packages/majis/schema/schema.py:67, in JsonSchema.validate(self, content, raises_error)
     65 except ValidationError as err:
     66     if raises_error:
---> 67         raise err from None
     69     warn(f'{self}: {err}', category=ValidationWarning, stacklevel=2)

File ~/checkouts/readthedocs.org/user_builds/majis-ops/envs/stable/lib/python3.10/site-packages/majis/schema/schema.py:64, in JsonSchema.validate(self, content, raises_error)
     58 """Validate content against the JSON schema.
     59 
     60 If ``raises_error`` is set to ``False``, a ``ValidationWarning``
     61 can be reported instead of a ``ValidationError``.
     62 """
     63 try:
---> 64     validate(instance=content, schema=self.data)
     65 except ValidationError as err:
     66     if raises_error:

File ~/checkouts/readthedocs.org/user_builds/majis-ops/envs/stable/lib/python3.10/site-packages/jsonschema/validators.py:1332, in validate(instance, schema, cls, *args, **kwargs)
   1330 error = exceptions.best_match(validator.iter_errors(instance))
   1331 if error is not None:
-> 1332     raise error

ValidationError: 'mirror_flag' is a required property

Failed validating 'required' in schema['properties']['timeline']['items']['properties']['parameters']:
    {'type': 'object',
     'required': ['scenario_id',
                  'cu_trep_ms',
                  'nb_cu_frames_tot',
                  'spatial_binning',
                  'ppe',
                  'start_row_vi',
                  'mirror_flag',
                  'start_angle',
                  'stop_angle',
                  'tick_freq',
                  'scanner_step_per_frame',
                  'start_scan_speed',
                  'stop_scan_speed'],
     'properties': {'mission_phase': {'type': 'string',
                                      'description': 'JUICE mission phase '
                                                     'name (TODO: ask SOC '
                                                     'to provide '
                                                     'allowed/standard '
                                                     'names)'},
                    'scenario_id': {'type': 'string',
                                    'description': 'New: scenario_id or '
                                                   "mtp, eg: 'S008_01' or "
                                                   "'ORB17' (TODO: ask SOC "
                                                   'if that will be '
                                                   'standardised)'},
                    'mirror_flag': {'type': 'string',
                                    'enum': ['ENABLE', 'DISABLE'],
                                    'description': 'If mirror '
                                                   "flag='DISABLE' (i.e. "
                                                   'no scan movement) then '
                                                   'please indicate the '
                                                   'requested fixed mirror '
                                                   'position in '
                                                   'start_angle parameter '
                                                   '(0° corresponds to '
                                                   'boresight). All other '
                                                   'scan parameters shall '
                                                   'be 0.'},
                    'start_angle': {'type': 'number',
                                    'description': 'Start angle in '
                                                   'degrees'},
                    'start_scan_speed': {'type': 'number',
                                         'description': ''},
                    'stop_scan_speed': {'type': 'number',
                                        'description': ''},
                    'stop_angle': {'type': 'number',
                                   'description': 'Stop angle in degrees'},
                    'tick_freq': {'type': 'string',
                                  'enum': ['8MHz', '1MHz'],
                                  'description': ''},
                    'scanner_step_per_frame': {'type': 'integer',
                                               'enum': [-3, 0, 3],
                                               'description': 'Scanner '
                                                              'step per '
                                                              'frame '
                                                              '(synchronous '
                                                              'flag).'},
                    'scanner_timetot': {'type': 'number',
                                        'description': 'Scanner total '
                                                       'time'},
                    'first_cu_frame_start_rel_ca': {'type': 'string',
                                                    'description': 'First '
                                                                   'CU_frame '
                                                                   'start '
                                                                   'wrt '
                                                                   'C/A. '
                                                                   '(-/+)hh:mm:ss,000. '
                                                                   'Scientific '
                                                                   'need '
                                                                   'wrt '
                                                                   'C/A. '
                                                                   'Parameter '
                                                                   'only '
                                                                   'required '
                                                                   'in '
                                                                   'case '
                                                                   'of '
                                                                   'continuous '
                                                                   'acquisition '
                                                                   '(nb_cu_frames_tot=65535). '
                                                                   'Note: '
                                                                   'use '
                                                                   'the '
                                                                   'decimal '
                                                                   'separator '
                                                                   '(either '
                                                                   "',' or "
                                                                   "'.') "
                                                                   'defined '
                                                                   'in '
                                                                   'your '
                                                                   'Excel '
                                                                   'for '
                                                                   'the '
                                                                   'milliseconds.'},
                    'last_cu_frame_stop_rel_ca': {'type': 'string',
                                                  'description': 'First '
                                                                 'CU_frame '
                                                                 'stop wrt '
                                                                 'C/A. '
                                                                 '(-/+)hh:mm:ss,000. '
                                                                 'Scientific '
                                                                 'need wrt '
                                                                 'C/A. '
                                                                 'Parameter '
                                                                 'only '
                                                                 'required '
                                                                 'in case '
                                                                 'of '
                                                                 'continuous '
                                                                 'acquisition '
                                                                 '(nb_cu_frames_tot=65535). '
                                                                 'Note: '
                                                                 'use the '
                                                                 'decimal '
                                                                 'separator '
                                                                 '(either '
                                                                 "',' or "
                                                                 "'.') "
                                                                 'defined '
                                                                 'in your '
                                                                 'Excel '
                                                                 'for the '
                                                                 'milliseconds.'},
                    'first_cu_frame_start_utc': {'type': 'string',
                                                 'description': 'First '
                                                                'CU_frame '
                                                                'start UTC '
                                                                'time.'},
                    'last_cu_frame_stop_utc': {'type': 'string',
                                               'description': 'First '
                                                              'CU_frame '
                                                              'start UTC '
                                                              'stop.'},
                    'cu_trep_ms': {'type': 'number', 'description': ''},
                    'spatial_binning': {'type': 'integer',
                                        'enum': [1, 2, 4],
                                        'description': 'Spatial binning '
                                                       'for the CU frame: '
                                                       '1, 2 or 4.'},
                    'obs_duration': {'type': 'number',
                                     'description': 'Observation duration '
                                                    'in seconds.'},
                    'nb_cu_frames_tot': {'type': 'integer',
                                         'minimum': 1,
                                         'description': 'The number of '
                                                        'Frame is '
                                                        'automatically '
                                                        're-computed by '
                                                        "'timeline2config' "
                                                        'when the Scanner '
                                                        'is used in '
                                                        'asynchronous mode '
                                                        '(Mirror '
                                                        'Flag=ENABLE and '
                                                        'Scanner step per '
                                                        'frame=0). Here '
                                                        "'nb_cu_frames_tot' "
                                                        'is used to '
                                                        'compute the data '
                                                        "volume in the 'DV "
                                                        "(Mbits)' column. "
                                                        "Put '65535' for "
                                                        'continuous '
                                                        'acquisition '
                                                        'mode.'},
                    'nb_cu_frames_totcomp': {'type': 'integer',
                                             'minimum': 1,
                                             'description': 'Re-computed '
                                                            'value as '
                                                            "'timeline2config' "
                                                            'will do in '
                                                            'case of '
                                                            'Scanner used '
                                                            'in '
                                                            'asynchronous '
                                                            'mode. Shall '
                                                            'be equal to '
                                                            "'nb_cu_frames_tot' "
                                                            'for checking '
                                                            'purpose.'},
                    'ppe': {'type': 'integer',
                            'minimum': 1,
                            'description': 'Pixels Per Element'},
                    'spectral_mapping': {'type': 'string',
                                         'description': ' the spectral '
                                                        'mask is a part of '
                                                        'a database that '
                                                        'contains spectral '
                                                        'masks associated '
                                                        'to each type of '
                                                        'MAJIS '
                                                        'observations, '
                                                        'comment '
                                                        'récupère-t-on ce '
                                                        'fichier ? '},
                    'data_volume_mbits': {'type': 'number',
                                          'minimum': 0,
                                          'description': 'Data volume in '
                                                         'Mbits '
                                                         '(Mbits=1024*1024bits)'},
                    'data_rate_bit_per_sec': {'type': 'number',
                                              'minimum': 0,
                                              'description': 'Data rate in '
                                                             'bits per '
                                                             'second'},
                    'nb_binned_spectels': {'type': 'integer',
                                           'minimum': 1,
                                           'description': 'Number of '
                                                          'binned spectral '
                                                          'elements'},
                    'nb_binned_spectels_after_comp': {'type': 'integer',
                                                      'minimum': 1,
                                                      'description': 'Equivalent '
                                                                     'compression '
                                                                     'factor '
                                                                     'for '
                                                                     'all '
                                                                     'the '
                                                                     'bands'},
                    'browse_parameters': {'type': 'string',
                                          'description': 'Browse '
                                                         'parameters file '
                                                         'name. This file '
                                                         'is a part of a '
                                                         'database that '
                                                         'contains browse '
                                                         'parameters '
                                                         'associated to '
                                                         'each type of '
                                                         'MAJIS '
                                                         'observations, '
                                                         'comment '
                                                         'récupère-t-on ce '
                                                         'fichier.'},
                    'image_mode': {'type': 'string',
                                   'enum': ['Nominal', 'No process'],
                                   'description': 'Nominal or No process'},
                    'dark_strategy': {'type': 'integer',
                                      'enum': [0, 1, 2, 3],
                                      'description': 'Dark Strategy; 0:No '
                                                     'Dark, 1: Dark '
                                                     'Before, 2: Dark '
                                                     'After, 3: Dark '
                                                     'Before + After'},
                    'dark_subtraction': {'type': 'string',
                                         'enum': ['Subtracted',
                                                  'Not Subtracted'],
                                         'description': 'Dark Subtraction; '
                                                        'Subtracted, Not '
                                                        'Subtracted'},
                    'cds_flag': {'type': 'string',
                                 'enum': ['ReadReset'],
                                 'description': 'CDS flag; ReadReset'},
                    'vi_flag': {'type': 'string',
                                'enum': ['ON', 'OFF'],
                                'description': 'VI flag; ON,OFF'},
                    'ir_flag': {'type': 'string',
                                'enum': ['ON', 'OFF'],
                                'description': 'IR flag; ON,OFF'},
                    'ir_readout': {'type': 'string',
                                   'enum': ['1MHz', '100kHz'],
                                   'description': 'IR Readout; '
                                                  '1MHz,100kHz'},
                    'start_row_vi': {'type': 'integer',
                                     'default': 100,
                                     'description': 'Start Row VI; Nominal '
                                                    'values (in physical '
                                                    'pixels): 100 for VI '
                                                    'from calibration '
                                                    'data'},
                    'start_row_ir': {'type': 'integer',
                                     'default': 87,
                                     'description': 'Start Row IR; Nominal '
                                                    'values (in physical '
                                                    'pixels): 87 for IR '
                                                    'from calibration '
                                                    'data'},
                    'vi_despiking_m': {'type': 'integer',
                                       'minimum': 1,
                                       'maximum': 12,
                                       'description': 'Despiking strategy '
                                                      'VI (M),integer '
                                                      'between 1 and 12'},
                    'vi_despiking_k': {'type': 'string',
                                       'enum': ['Lowest', 'Low'],
                                       'description': 'VI Despiking K; '
                                                      'Despiking strategy '
                                                      'VI (K) with '
                                                      'K=Lowest or Low'},
                    'vi_despiking_n': {'type': 'integer',
                                       'minimum': 1,
                                       'maximum': 8,
                                       'description': 'IR Despiking N; '
                                                      'Despiking strategy '
                                                      'VI (N sub), integer '
                                                      'between 1 and 8'},
                    'vi_tint': {'type': 'number',
                                'minimum': 0,
                                'description': 'VI Tint; VI integration '
                                               'time (ms)'},
                    'vi_gain': {'type': 'integer',
                                'minimum': 8,
                                'maximum': 13,
                                'default': 10,
                                'description': 'VI Gain; VI '
                                               'preamplification Gain, '
                                               'Default value 10, Value '
                                               'between 8 and 13'},
                    'vi_offset': {'type': 'integer',
                                  'minimum': 0,
                                  'maximum': 3,
                                  'default': 1,
                                  'description': 'VI Offset; VI detector '
                                                 'reference voltage '
                                                 'offset, Default value 1, '
                                                 'value between 0 and 3'},
                    'vi_npe': {'type': 'integer',
                               'minimum': 1,
                               'maximum': 16,
                               'description': 'VI NPE; VI PE Frame '
                                              'binning, value between 1 '
                                              'and 16'},
                    'ir_despiking_n': {'type': 'integer',
                                       'minimum': 1,
                                       'maximum': 8,
                                       'description': 'IR Despiking N; '
                                                      'Despiking strategy '
                                                      'VI (N sub), integer '
                                                      'between 1 and 8'},
                    'ir_despiking_m': {'type': 'integer',
                                       'minimum': 1,
                                       'maximum': 12,
                                       'description': 'IR Despiking M; '
                                                      'Despiking strategy '
                                                      'VI (M),integer '
                                                      'between 1 and 12'},
                    'ir_despiking_k': {'type': 'string',
                                       'enum': ['Lowest', 'Low'],
                                       'description': 'IR Despiking K; '
                                                      'Despiking strategy '
                                                      'VI (K) with '
                                                      'K=Lowest or Low'},
                    'ir_tint': {'type': 'number',
                                'minimum': 0,
                                'description': 'IR Tint; VI integration '
                                               'time (ms)'},
                    'ir_gain': {'type': 'integer',
                                'minimum': 8,
                                'maximum': 13,
                                'default': 10,
                                'description': 'IR Gain; VI '
                                               'preamplification Gain, '
                                               'Default value 10, Value '
                                               'between 8 and 13'},
                    'ir_offset': {'type': 'integer',
                                  'minimum': 0,
                                  'maximum': 3,
                                  'default': 1,
                                  'description': 'IR Offset; VI detector '
                                                 'reference voltage '
                                                 'offset, Default value 1, '
                                                 'value between 0 and 3'},
                    'ir_npe': {'type': 'integer',
                               'minimum': 1,
                               'maximum': 16,
                               'description': 'IR NPE; VI PE Frame '
                                              'binning, value between 1 '
                                              'and 16'}}}

On instance['timeline'][1]['parameters']:
    {'scenario_id': 'S007_01',
     'cu_trep_ms': 200,
     'nb_cu_frames_tot': 109,
     'spatial_binning': 4,
     'ppe': 64,
     'start_row_vi': 802,
     'start_angle': -0.37981,
     'stop_angle': 0.13341,
     'scanner_step_per_frame': 3,
     'start_scan_speed': 0.0022421078,
     'stop_scan_speed': 0.0022421078}

Export ITL with repesct to a relative time reference:#

save_itl(
    'output.itl', itl_abs, itl_rel, ref='23-SEP-2032_00:00:02 EVENT_NAME (COUNT = 1)'
)
# Relative time reference:
# 2032-09-23T00:00:02  EVENT_NAME (COUNT = 1)

# MAJIS - SCENARIO=S007_01 OBS_NAME=MAJ_JUP_DISK_SCAN_101 TARGET=JUPITER CU_TREP=100ms
# MAJIS - CU_FRAME=109 BINNING=1 PPE=64 START_ROW_VIS=436 START_ANGLE=-0.27937
# MAJIS - STOP_ANGLE=+0.23385 SYNCHRONOUS=+3 START_SCAN_SPEED=+0.0022421078
# MAJIS - STOP_SCAN_SPEED=+0.0022421078
EVENT_NAME (COUNT = 1)  +000.02:58:09.000  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN
EVENT_NAME (COUNT = 1)  +000.03:01:57.900  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

# MAJIS - SCENARIO=S007_01 OBS_NAME=MAJ_JUP_DISK_SCAN_102 TARGET=JUPITER CU_TREP=200ms
# MAJIS - CU_FRAME=109 BINNING=4 PPE=64 START_ROW_VIS=802 START_ANGLE=-0.37981
# MAJIS - STOP_ANGLE=+0.13341 SYNCHRONOUS=+3 START_SCAN_SPEED=+0.0022421078
# MAJIS - STOP_SCAN_SPEED=+0.0022421078
EVENT_NAME (COUNT = 1)  +000.03:04:32.000  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN
EVENT_NAME (COUNT = 1)  +000.03:08:20.900  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

# MAJIS - OBS_KEY=MAJ_JUP_DISK_SCAN OBS_NAME=MAJ_JUP_DISK_SCAN_001 TYPE=OBSERVATION
# MAJIS - OBSERVATION_TYPE=PRIME TARGET=JUPITER POINTING=MAJIS POINTING_DESIGNER=True
# MAJIS - SCENARIO=S007_01 CU_TREP=500 CU_FRAME=300 BINNING=1 PPE=400 START_ROW_VIS=100
# MAJIS - MIRROR_FLAG=ENABLE START_ANGLE=-1.31051 STOP_ANGLE=0.10202 TICK_FREQ=1MHz
# MAJIS - SYNCHRONOUS=0 START_SCAN_SPEED=0.0022421078 STOP_SCAN_SPEED=0.0022421078
# MAJIS - COMMENT: This comment will be included in the exported ITL file.
EVENT_NAME (COUNT = 1)  +000.05:15:43.000  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN (PRIME=TRUE)
EVENT_NAME (COUNT = 1)  +000.05:26:13.000  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

# MAJIS - OBS_KEY=MAJ_JUP_DISK_SCAN OBS_NAME=MAJ_JUP_DISK_SCAN_002 TYPE=OBSERVATION
# MAJIS - OBSERVATION_TYPE=RIDER TARGET=JUPITER POINTING=None POINTING_DESIGNER=False
# MAJIS - SCENARIO=S007_01 CU_TREP=2100 CU_FRAME=300 BINNING=2 PPE=400 START_ROW_VIS=372
# MAJIS - MIRROR_FLAG=ENABLE START_ANGLE=1.32935 STOP_ANGLE=-0.08318 TICK_FREQ=8MHz
# MAJIS - SYNCHRONOUS=3 START_SCAN_SPEED=-0.0022421078 STOP_SCAN_SPEED=-0.0022421078
EVENT_NAME (COUNT = 1)  +000.06:09:43.000  MAJIS  OBS_START  MAJ_JUP_DISK_SCAN
EVENT_NAME (COUNT = 1)  +000.06:20:13.000  MAJIS  OBS_END    MAJ_JUP_DISK_SCAN

Export ITL to CSV#

save_itl('output.csv', itl_abs)
#OBS_NAME;OBS_START;OBS_END;OBS_KEY;INSTRUMENT;TYPE;OBSERVATION_TYPE;TARGET;POINTING;POINTING_DESIGNER;SCENARIO;CU_TREP;CU_FRAME;BINNING;PPE;START_ROW_VIS;MIRROR_FLAG;START_ANGLE;STOP_ANGLE;TICK_FREQ;SYNCHRONOUS;START_SCAN_SPEED;STOP_SCAN_SPEED;PRIME;ITL;COMMENTS
MAJ_JUP_DISK_SCAN_001;2032-09-23T05:15:45Z;2032-09-23T05:26:15Z;MAJ_JUP_DISK_SCAN;MAJIS;OBSERVATION;PRIME;JUPITER;MAJIS;True;S007_01;500;300;1;400;100;ENABLE;-1.31051;0.10202;1MHz;0;0.0022421078;0.0022421078;True;ITL_absolute_time.json;"This comment will be included in the exported ITL file."
MAJ_JUP_DISK_SCAN_002;2032-09-23T06:09:45Z;2032-09-23T06:20:15Z;MAJ_JUP_DISK_SCAN;MAJIS;OBSERVATION;RIDER;JUPITER;None;False;S007_01;2100;300;2;400;372;ENABLE;1.32935;-0.08318;8MHz;3;-0.0022421078;-0.0022421078;False;ITL_absolute_time.json;""

Export ITL to XLSM timeline#

save_itl('output.xlsm', itl_abs, ref='23-SEP-2032_00:00:02 CA_REF (COUNT = 1)')
Event NamePhaseblockCommentsOBS_NAMEstart_time_relative_castop_time_relative_castart_time_utcstop_time_utcpointing descMAJIS resolprimeMAJIS ODF nameITL nameMirror Flagstart_anglestart_scan_speedstop_scan_speedScanner step per framestop_angletick_freqscanner_timetot (ms)First CU_frame start wrt C/ALast CU_frame stop wrt C/AFirst CU_frame start (UTC)Last CU_frame stop (UTC)cu_trep_msspatial_binningobs durat (sec) (w/o borders)nb_cu_frames_totnb_cu_frames_tot (computed)ppeSpectral MappingNumber of spectels after spectral binningNb of bits per spectel after compressiondatarate (bits/s)DV (Mbits)Browse ParametersNumber of browse spectelsNb of bits per browse spectel after compressionbrowse datarate (bits/s)browse DV (Mbits)Image ModeDark StrategyDark SubtractionCDS flagVI flagIR flagVI ReadoutIR ReadoutStart Row VIStart Row IRVI Despiking NVI Despiking MVI Despiking KVI TintVI GainVI OffsetVI NPEIR Despiking NIR Despiking MIR Despiking KIR TintIR GainIR OffsetIR NPEPower (W)Science mode (for power estimation)
This comment will be included in the exported ITL file.MAJ_JUP_DISK_SCAN_001MAJISITL_absolute_time.jsonENABLE-1.310510.00224210780.002242107800.10202=IF(AND(Mirror_Flag="ENABLE",ABS(Scanner_step_per_frame)<>3), IF(start_scan_speed=stop_scan_speed, ABS( (stop_angle - start_angle) / start_scan_speed ) *1000, ABS( (stop_angle - start_angle) / (stop_scan_speed - start_scan_speed) * LN( stop_scan_speed / start_scan_speed ) ) * 1000), "N/A")+000.05:15:43.000+000.05:26:13.0002032-09-23T05:15:45Z2032-09-23T05:26:15Z500No Binning300=IF(AND(Mirror_Flag="ENABLE",ABS(Scanner_step_per_frame)<>3), INT( (scanner_timetot__ms / cu_trep_ms) + 0.5), "N/A")400=(VI_flag="ON") * VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,2,FALSE) + (IR_flag="ON") * VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,4,FALSE)=((VI_flag="ON") * (VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,3,FALSE)*VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,2,FALSE)) + (IR_flag="ON") * (VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,5,FALSE)*VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,4,FALSE)) ) / Number_of_spectels_after_spectral_binning=DV__Mbits/cu_trep_ms/ IF(nb_cu_frames_tot=65535, DIFF_TIME_CA_ms(First_CU_frame_start_wrt_C_A, Last_CU_frame_stop_wrt_C_A)/cu_trep_ms,nb_cu_frames_tot)*(1024*1024)=IF(AND(nb_cu_frames_tot__computed<>"N/A",nb_cu_frames_tot<>nb_cu_frames_tot__computed), "ERROR: nb_cu_frames_tot and nb_cu_frames_tot (computed) are not equal", IF(nb_cu_frames_tot=65535, DIFF_TIME_CA_ms(First_CU_frame_start_wrt_C_A,Last_CU_frame_stop_wrt_C_A)/cu_trep_ms, nb_cu_frames_tot) * ( ppe / 2^(IF(spatial_binning="No Binning",0,IF(spatial_binning="Binning x2",1,IF(spatial_binning="Binning x4",2,"N/A")))) ) * Number_of_spectels_after_spectral_binning * Nb_of_bits_per_spectel_after_compression / (1024*1024) )=(VI_flag="ON") * VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,2,FALSE) + (IR_flag="ON") * VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,4,FALSE)=IF(Number_of_browse_spectels=0,0, ((VI_flag="ON") * (VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,3,FALSE)*VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,2,FALSE)) + (IR_flag="ON") * (VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,5,FALSE)*VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,4,FALSE)) ) / Number_of_browse_spectels)=browse_DV__Mbits / cu_trep_ms / nb_cu_frames_tot * (1024*1024)=IF(AND(nb_cu_frames_tot__computed<>"N/A",nb_cu_frames_tot<>nb_cu_frames_tot__computed), "ERROR: nb_cu_frames_tot and nb_cu_frames_tot (computed) are not equal", IF(nb_cu_frames_tot=65535, DIFF_TIME_CA_ms(First_CU_frame_start_wrt_C_A,Last_CU_frame_stop_wrt_C_A)/cu_trep_ms, nb_cu_frames_tot) * ( ppe / 2^(IF(spatial_binning="No Binning",0,IF(spatial_binning="Binning x2",1,IF(spatial_binning="Binning x4",2,"N/A")))) ) * Number_of_browse_spectels * Nb_of_bits_per_browse_spectel_after_compression / (1024*1024) )100=IF(AND(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_2ch_science_scanning, power_2ch_science_pointing), IF(OR(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_1ch_science_scanning, power_1ch_science_pointing), "N/A"))=IF(AND(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_2ch_science_scanning_description, power_2ch_science_pointing_description), IF(AND(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_1ch_science_scanning_description, power_1ch_science_pointing_description), "N/A"))
MAJ_JUP_DISK_SCAN_002otherITL_absolute_time.jsonENABLE1.32935-0.0022421078-0.00224210783-0.08318=IF(AND(Mirror_Flag="ENABLE",ABS(Scanner_step_per_frame)<>3), IF(start_scan_speed=stop_scan_speed, ABS( (stop_angle - start_angle) / start_scan_speed ) *1000, ABS( (stop_angle - start_angle) / (stop_scan_speed - start_scan_speed) * LN( stop_scan_speed / start_scan_speed ) ) * 1000), "N/A")+000.06:09:43.000+000.06:20:13.0002032-09-23T06:09:45Z2032-09-23T06:20:15Z2100Binning x2300=IF(AND(Mirror_Flag="ENABLE",ABS(Scanner_step_per_frame)<>3), INT( (scanner_timetot__ms / cu_trep_ms) + 0.5), "N/A")400=(VI_flag="ON") * VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,2,FALSE) + (IR_flag="ON") * VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,4,FALSE)=((VI_flag="ON") * (VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,3,FALSE)*VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,2,FALSE)) + (IR_flag="ON") * (VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,5,FALSE)*VLOOKUP(SPECTRAL_MASK,list_of_spectral_masks,4,FALSE)) ) / Number_of_spectels_after_spectral_binning=DV__Mbits/cu_trep_ms/ IF(nb_cu_frames_tot=65535, DIFF_TIME_CA_ms(First_CU_frame_start_wrt_C_A, Last_CU_frame_stop_wrt_C_A)/cu_trep_ms,nb_cu_frames_tot)*(1024*1024)=IF(AND(nb_cu_frames_tot__computed<>"N/A",nb_cu_frames_tot<>nb_cu_frames_tot__computed), "ERROR: nb_cu_frames_tot and nb_cu_frames_tot (computed) are not equal", IF(nb_cu_frames_tot=65535, DIFF_TIME_CA_ms(First_CU_frame_start_wrt_C_A,Last_CU_frame_stop_wrt_C_A)/cu_trep_ms, nb_cu_frames_tot) * ( ppe / 2^(IF(spatial_binning="No Binning",0,IF(spatial_binning="Binning x2",1,IF(spatial_binning="Binning x4",2,"N/A")))) ) * Number_of_spectels_after_spectral_binning * Nb_of_bits_per_spectel_after_compression / (1024*1024) )=(VI_flag="ON") * VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,2,FALSE) + (IR_flag="ON") * VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,4,FALSE)=IF(Number_of_browse_spectels=0,0, ((VI_flag="ON") * (VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,3,FALSE)*VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,2,FALSE)) + (IR_flag="ON") * (VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,5,FALSE)*VLOOKUP(BROWSE_PARAMETERS,list_of_browse_parameters,4,FALSE)) ) / Number_of_browse_spectels)=browse_DV__Mbits / cu_trep_ms / nb_cu_frames_tot * (1024*1024)=IF(AND(nb_cu_frames_tot__computed<>"N/A",nb_cu_frames_tot<>nb_cu_frames_tot__computed), "ERROR: nb_cu_frames_tot and nb_cu_frames_tot (computed) are not equal", IF(nb_cu_frames_tot=65535, DIFF_TIME_CA_ms(First_CU_frame_start_wrt_C_A,Last_CU_frame_stop_wrt_C_A)/cu_trep_ms, nb_cu_frames_tot) * ( ppe / 2^(IF(spatial_binning="No Binning",0,IF(spatial_binning="Binning x2",1,IF(spatial_binning="Binning x4",2,"N/A")))) ) * Number_of_browse_spectels * Nb_of_bits_per_browse_spectel_after_compression / (1024*1024) )372=IF(AND(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_2ch_science_scanning, power_2ch_science_pointing), IF(OR(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_1ch_science_scanning, power_1ch_science_pointing), "N/A"))=IF(AND(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_2ch_science_scanning_description, power_2ch_science_pointing_description), IF(AND(VI_flag="ON",IR_flag="ON"), IF( Mirror_Flag = "ENABLE", power_1ch_science_scanning_description, power_1ch_science_pointing_description), "N/A"))