Metadata
LEGEND metadata is stored in 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 (-
))
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": 7
}
Specifying metadata validity in time (and system)
LEGEND adopts a custom file format to specify the validity of metadata (for example a data production configuration that varies in time or according to the data taking mode), called JSONL (JSON + Legend).
A JSONL file is essentially a collection of JSON-formatted records. Each record is formatted as follows:
{"valid_from": "TIMESTAMP", "category": "DATATYPE", "apply": ["FILE1", "FILE2", ...]}
where:
TIMESTAMP
is a LEGEND-style timestampyyymmddThhmmssZ
(in UTC time), also used to label data cycles, specifying the start of validityDATATYPE
is the data type (all
,phy
,cal
,lar
, etc.) to which the metadata appliesapply
takes an array of metadata files, to be combined "in cascade" (precedence order right to left) into the final metadata object
The record above translates to:
Combine
FILE1
,FILE2
etc. into a single metadata object. Fields inFILE2
override fields inFILE1
. This metadata applies only toDATATYPE
data and is valid fromTIMESTAMP
on.
Records are stored in JSONL files one per line, without special delimiters:
{"valid_from": "TIMESTAMP1", "category": "DATATYPE1", "apply": ["FILE1", "FILE2", ...]}
{"valid_from": "TIMESTAMP2", "category": "DATATYPE2", "apply": ["FILE3", "FILE4", ...]}
...