[Smwg] SoS XML Schema does not quite match time code B?

Barkley, Erik J (3970) erik.j.barkley at jpl.nasa.gov
Wed May 11 19:34:52 UTC 2016


John,

I realize you are on vacation, but when you come back…

As part of the ESTRACK/DSN schedule exchange work ongoing, a question about time representation has arisen. I have taken a look and my conclusion is that the schema that we have for Time code B does not quite match the Time code B definition in the book. Certainly a more "relaxed" definition with regard to sub seconds is in order for reporting things like schedules which often (although perhaps not exclusively) don't need anything stated below a second resolution.

Here is what the CCSDS recommendation on Time codes says about T.C. B says about it:

“….
3.5.1.2 ASCII TIME CODE B, Year/Day of Year Calendar Variation:
The format for ASCII Time Code B is as follows:
YYYY-DDDThh:mm:ss.d→dZ

where each character is an ASCII character using one octet with the following meanings:
YYYY = Year in four-character subfield with values 0001-9999
DDD = Day of year in three-character subfield with values 001-365 or -366
T = Calendar-Time separator
hh = Hour in two-character subfield with values 00-23
mm = Minute in two-character subfield with values 00-59
ss = Second in two-character subfield with values 00-59
(-58 or -60 during leap seconds)
d→d = Decimal fraction of second in one- to n-character subfield
where each d has values 0-9
Z = time code terminator (optional)

The hyphen (-), colon (:), letter ‘ T’ and period (.) are used as specific subfield separators,
and that all subfields must include leading zeros.

As many ‘d’ characters to the right of the period as required may be used to obtain the
required precision.

An optional terminator consisting of the ASCII character ‘Z’ may be placed at the end of the
time code.
EXAMPLE: 1988-018T17:20:43.123456Z
….”



And here is the key line in the XML schema that defines the pattern

<xsd:pattern value="\d{4}-\d{3}T\d{2}:\d{2}:\d{2}\.\d+Z?"/>

Note that the CCSDS book says “..As many ‘d’ characters to the right of the period as required may be used to obtain the
required precision”.  I take this to mean that “as many” could in fact be 0 (zero).

Given that, I think the XML schema line should read:
<xsd:pattern value="\d{4}-\d{3}T\d{2}:\d{2}:\d{2}\.\d*Z?"/>

With this definition which I think is consistent with the definition of Time code B implementations are not required to state at least a 10th of a second for timestamps.

I propose that we update the schema accordingly which I think makes the schema more useful to our implementing organizations, consistent with time code B definition, while still allowing for the subsecond expression if needed.

Best regards,
-Erik







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ccsds.org/pipermail/smwg/attachments/20160511/2b69fa11/attachment.html>


More information about the SMWG mailing list