EAST (CCSDS 644.0-B-3)

EAST (Enhanced Ada SubseT) is the CCSDS data description language: an EAST Data Description Record says, in a subset of Ada's declarations, exactly how a set of data is laid out, down to the bit. It is standardised as CCSDS 644.0-B-3 (June 2010), with the conventions for real numbers in CCSDS 646.0-G-1, and was used for space data archived in Standard Formatted Data Units (SFDUs). The oais-structure-east module has no third-party dependencies, and does three things with EAST.

Reading EAST into the element tree (EastReader)

A description's logical package (types, representation clauses, then the variables in the order the data holds them) and physical package (byte order, array storage, how numbers are represented) become an engine-neutral FormatDescription, from which Kaitai Struct, DFDL and DRB descriptions are generated:

A description describes one set of data, applied repeatedly to the whole of the data: the sets repeat to the end, in a record set, unless an EOF marker ends the last variable's repetition.

What the element tree can't express is refused with the line and why: markers other than EOF, ** and the EAST functions on values from the data, signed or LOW_ORDER_FIRST bit fields, integers in pieces or not in two's complement or unsigned, and reals in conventions other than IEEE 754. The interpreter reads all of these.

Writing EAST from the element tree (EastWriter)

A FormatDescription is written as an EAST description: a record type per record, an array per repeated element, an enumeration with a representation clause per field with a code list, a range per field with a valid range, and a physical package giving the byte order and the representation of every real (IEEE 754, FCSTC000) and of every integer whose byte order isn't the description's own. Counts, lengths, conditions and choices become virtual discriminants whose actual values, with the EAST paths of the fields they use, end the logical package. A variant part comes last in an EAST record, so an optional element or a choice becomes a record of its own, with the element's name. Meanings, units, scaling and fill values become comments.

Names are written in upper case; names that are EAST or Ada keywords (RECORD, BODY, DELTA...) get _1 added. What EAST can't describe is refused: delimited text, elements at an absolute offset, compression, records of a computed size, choices on text, repetition to the end except of the last element, and repeated text or bytes of a computed length.

Interpreting data with EAST (EastStructureRepInfo)

EastStructureRepInfo is an ExecutableStructureRepInfo (SpecificationLanguage.EAST, registered by EastStructureInterpreterProvider) that reads data directly as an EAST description says, giving a StructureNode tree: a composite node per record, an array node per array or repetition, and a leaf per value, each with the bits it was read from. It follows the description itself, so it reads everything EAST can say:

Names are given in lower case. A binary enumeration's leaf holds its code, with its literal as the meaning attribute. The interpreter reads data; it doesn't write it back.

Known limits: the CDC conventions follow CCSDS 646.0-G-1's algorithms but haven't been checked against data written on CDC machines; reals are given as Java doubles, so 128-bit reals lose precision.