Metadata
LEGEND metadata is stored in YAML or JSON. Formatting guidelines:
- In general, field names should be interpretable as valid variable names in common programming languages (e.g. use underscores (
_) instead of dashes (-)) - Snake casing is preferred, i.e. separating non-capitalized words with underscores (
_).
Physical units
Physical units should be specified as part of a field name by adding _in_<units> at the end. For example:
radius_in_mm: 11,
temperature_in_K: 7Specifying metadata validity in time (and system)
LEGEND adopts the YAML format to specify the validity of metadata (for example a data production configuration that varies in time or according to the data taking mode).
A validity.yaml file is essentially a collection of records. Each record is formatted as follows:
- valid_from: TIMESTAMP
category: DATATYPE
mode: MODE
apply:
- FILE1.yaml
- FILE2.yaml
- ...where:
TIMESTAMPis a LEGEND-style timestampyyymmddThhmmssZ(in UTC time), also used to label data cycles, specifying the start of validityDATATYPEis the data type (all,phy,cal,lar, etc.) to which the metadata applies. If omitted, it should default toall.MODEcan bereset,append,remove,replace. If omitted and this is the first record in the file, defaults toreset, otherwise defaults toappend.applytakes an array of metadata files, to be comined into the main metadata object depending onmode(see below). In general, the files are combined "in cascade" (precedence order first to last) into the final metadata object.
The above example record, if appearing at the top of the validity file, translates to:
Combine
FILE1,FILE2etc. into a single metadata object. Fields inFILE2override fields inFILE1. This metadata applies only toDATATYPEdata and is valid fromTIMESTAMPon.
Modes:
reset: remove all entries from the existing metadata file list before applying (in cascade) the ones listed inapply.append: append (in cascade) files listed inapplyto the current file list.remove: remove the file(s) listed inapplyfrom the current file list.replace: replace, in the current fule list, the first file listed inapplywith the second one.