Skip to content

Generalized offset units #19

@cpiker

Description

@cpiker

Currently das2Java can handle units of the form:

ms since 2026-01-01 UTC

i.e. offset units from a datum.

Support should be added to das2C for these units because:

  • They are already supported by das2Java, and have been for quite a while,
  • Other systems, such as UD units support similar syntax,
  • They are useful for representing time high-precision values in streams with limited fundamental value type support (such as das v2 streams), and
  • They can be used to reduce the number of bytes on the wire, regardless of the value types supported by the stream.

Current examples of offset units can be seen in the following QDataset serializations:

[00]000081<?xml version="1.0" encoding="UTF-8"?>
<stream dataset_id="ds_0" version="1.1"/>
[01]000289<?xml version="1.0" encoding="UTF-8"?>
<packet>
  <qdataset id="ds_0" rank="1">
    <properties>
      <property name="UNITS" type="units" value="ms since 2026-02-24T00:00
:00.000Z"/>
    </properties>
    <values encoding="time24" length=""/>
  </qdataset>
</packet>
:01:2026-02-24T00:00:00.001
:01:2026-02-24T00:00:00.002
:01:2026-02-24T00:00:00.003
:01:2026-02-24T00:00:00.004
:01:2026-02-24T00:00:00.005
:01:2026-02-24T00:00:00.006

and similar via a das v2 stream export:

[00]000024<stream version="2.2"/>
[01]000096<packet>
  <x name="time" type="time24" units="ms since 2026-02-24T00:00:00.000Z"/>
</packet>
:01:2026-02-24T00:00:00.001
:01:2026-02-24T00:00:00.002
:01:2026-02-24T00:00:00.003
:01:2026-02-24T00:00:00.004
:01:2026-02-24T00:00:00.005
:01:2026-02-24T00:00:00.006

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions