Skip to content

Add XLSM timeline export from ITL observations

Axelle Gottafray requested to merge 2-integrate-itl2timeline-to-majis-itl-cli into main

Changes

  • Add Timeline object to manipulate MAJIS timeline file (.xlsm):
>>> from majis import Timeline

>>> timeline = Timeline(timeline='timeline.xlsm')

# Get the number of observations
>>> len(timeline)
10

# Get the list of observations
>>> timeline['OBS_NAME']
['OBS_001', ...]

# Get an observation details
>>> timeline[1]
{'OBS_NAME': 'OBS_001', 'start_angle': 1.5, ...}

# Get an observation property
>>> timeline['start_angle', 1]
1.5

# Append new observations from ITL file
>>> timeline.append('absolute_time.itl')

# Edit a single field
>>> timeline['start_angle', 1] = -1.5
>>> timeline['start_angle', 1]
-1.5

# Save to the same XLSM timeline
>>> timeline.save()

# Create a new timeline from the default template and a relative ITL file
>>> timeline = Timeline('relative_time.itl', refs='events.evf')

# Compute all relative time w.r.t. to a C/A reference
>>> timeline.ca_ref = '2032-09-24T21:33:36 PERIJOVE_12PJ (COUNT = 1)'
>>> timeline['First CU_frame start wrt C/A', 1]
'-001.18:35:25'

# Export the timeline to a new file
>>> timeline.save('new_timeline.xlsm')
  • Add explicit save_xlsm() function:
from majis.itl import save_xlsm

# Export as XLSM timeline w.r.t. C/A reference (based on default template)
save_xlsm('output.xlsm', itl_abs, ca_ref='DATETIME  REF_CA (COUNT = N)')

# Append to an existing XLSM timeline
save_xlsm(None, itl_abs, timeline='timeline.xlsm')
  • Add new flags to majis-itl to export as xlsm:
# Create a new MAJIS timeline (`.xlsm`) from a ITL the default template.
majis-itl absolute_time.itl --output output.xlsm

# Edit an existing MAJIS timeline to compute relative time w.r.t. C/A reference.
majis-itl --timeline timeline.xlsm --relative-to "2032-09-24T21:33:36 PERIJOVE_12PJ (COUNT = 1)"

Note: If no --output flag is present, the output will be save in the original template.

  • The original ITL filename is now kept in read_itl():
>>> events = read_itl('foo.itl')
>>> events['OBS_000']['ITL']
'foo.itl'
  • Add explicit START_ROW_VIS to tests ITL files and fix SYNCHRONOUS to float value (instead of 'YES' string).
  • Fix concatenate() function for on zeros blocks input

Other

  • Enforce code coverage to 100%.
  • Add Axelle Gottafray to authors

Fix #2 (closed)

Edited by Benoît SEIGNOVERT

Merge request reports

Loading