Changes#

ctao_datamodel 1.1.0rc2.dev9+ga32fe53fc (2026-07-17)#

API Changes#

Bug Fixes#

New Features#

Maintenance#

Data Model Changes#

Refactoring and Optimization#

ctao_datamodel 1.1.0#

API Changes#

  • Models now fully support units, using the ctao_datamodel.Quantity type annotation, for example energy: Quantity[u.TeV]

    • Quantity values can be specified as bare floats as before, with the documented unit attached automatically (for backward compatibility, and for reading FITS headers where the units are lost. )

    • Fields with Quantity values are now de-serialized as _astropy_ u.Quantity objects (not as bare floats as before: this is the only non-backward-compatible change)

    • Three methods of serializing Quantity fields are provided, and can be chosen when calling ctao_datamodel.flatten_model_instance using the quantity_format option (see also ctao_datamodel.QuantityFormat):

      • float: as before, serialize as a bare float

      • string: serialize as an astropy-quantity string, e.g. "12 m s-1"

      • dict: serialize as a dict, e.g. {"value": 12, "unit": "m s-1"} [!36]

Bug Fixes#

  • Fixed bug where unit was not included in docstring of HIERARCH FITS keywords. [!34]

  • Fixed serialization of TimeSystem, which must be upper-case for FITS. [!44]

  • FITS headers using the HIERARCH standard now appear at the end of the generated header. [!49]

  • Fixed small bugs in latex rendering of examples [!50]

  • Fixed bug where examples provided in field metadata were not propegated to the table or latex output. [!51]

  • Fixed bug where units were not properly discovered for optional Quantity fields. [!52]

New Features#

  • Minor style update for PlantUML diagrams: include units for Quantities, and improve readability. [!39]

  • Added ability to define and validate astropy (and thus FITS) table schemas. This adds a new metadata item: fits_column_dtype to AstroField that allows that field to be used to validate an astropy Table column.

    It also adds two new conversion functions:

    • model_to_astropy_table: creates an empty Table object from a model

    • model_validate_astropy_table: validates an existing Table object columns

    • validate_fits_bintable_hdu: validates a FITS BINTABLE HDU’s column schema and metadata at the same time [!43]

  • Added support for model versioning and automatic migration of old versions to the current one. This introduces a new VersionedModel base class, and a Migration class hierarchy that defines basic migrations like _rename_, _drop_, _update_metadata_, as well as support for user-defined complex transforms. The versioning needs only to be applied to top-level models that are serialized, child model changes can be handled at the parent level. A new tutorial under _Development_ in the documentation, describes how this is used. [!47]

  • Added an add migration, to keep track of additions [!50]

Data Model Changes#

Auto-generated Summary for dataproducts.Product:

  • 1.0.0 -> 1.1.0
    • Updated ‘fits_keyword’ metadata for ‘activity.configuration_id’ from ‘ANAMODE’ to ‘ACTCONF’

  • 1.1.0 -> 2.0.0
    • Transformed ‘observation.coverage.time.t_min’ using transform_met_time_to_iso (MET to ISO)

    • Transformed ‘observation.coverage.time.t_max’ using transform_met_time_to_iso (MET to ISO)

    • Dropped ‘observation.coverage.time.reference’

    • Added ‘simulation’

Details:

  • Changed FITS serialization of activity.configuration_name to serialize to ACTCONF instead of ANAMODE. Note that ANAMODE comes from the IVOA HEIG note, and was meant for DL3 data, but doesn’t make sense for most of CTAO data products, for example DL0 products where there is no “analysis” happening, but there is an activity configuration. [!37]

  • Added missing short FITS keyword for data.category: DATACAT [!38]

  • Removed observation.coverage.time.reference: a TimeReference is not longer included, so t_start and t_stop must be ISO strings in UTC. This simplifies the model and serialization. Time references are still allowed in specific cases like EVENT HDUs, but are out of scope for the DataProducts metadata. The corresponding TimeReference and related classes are moved to models.common for future use. A version migration was added to models.dataproducts.Product so that this is a backward-compatible change. [!45]

  • Added Simulation context metadata. This includes the production name and the optional simulation grid node in both zenith/azimuth and hourangle/declination format. If the latter format is set to None, it is filled in automatically by the Product model validator using the observation location.. [!50]

  • Added instance.messenger from the IVOA High-Energy extension note. [!53]

ctao_datamodel 1.0.1#

Bug Fixes#

  • Fixed bug for disclaimer when serialized to a FITS header COMMENT field, where long values were truncated when reading back to the python class, due to how astropy serialized that header to multiple cards. [!30]

  • Fixed bug in flatten_model_instance where keys that had value 0 were dropped. Now only null values are dropped. [!31]

  • Using an underscore as a flattened key separator now raises an exception, as it is used as a word separator in keys, and thus prevents un-flattening. [!32]

ctao_datamodel 1.0.0#

First release, covering DataProducts data model document version A001