ccsds

Simple CCSDS TDM/OEM file writer.

https://public.ccsds.org/Pubs/503x0b1c1.pdf

Module summary

Classes

epochType(val1, val2, scale, precision, …)

Convert astropy time to “yyyy-dddThh:mm:ss.d->dZ” CCSDS 2.0 epochType standard.

Functions

read_oem(fname[, xml])

Todo: docstring

read_tdm(fname[, xml])

Just get the range data # TODO: the rest

write_oem(t, state, meta[, fname, xml])

Uses a series of astropy times and state vectors to create a CCSDS OEM file (plain-text of xml) or return a string.

write_tdm(datas, meta[, fname])

# TODO: Document function.

xml_tdm_segmet(datas)

xml_tdm_tree(meta, segments)

Contents

epochType

class sorts.io.ccsds.epochType(val1, val2, scale, precision, in_subfmt, out_subfmt, from_jd=False)[source]

Bases: astropy.time.formats.TimeISO

Convert astropy time to “yyyy-dddThh:mm:ss.d->dZ” CCSDS 2.0 epochType standard.

property cache

Return the cache associated with this instance.

format_string(str_fmt, **kwargs)

Write time to a string using a given format.

By default, just interprets str_fmt as a format string, but subclasses can add to this.

parse_string(timestr, subfmts)

Read time from a single string, using a set of possible formats.

property scale

Time scale

set_jds(val1, val2)

Parse the time strings contained in val1 and set jd1, jd2

str_kwargs()

Generator that yields a dict of values corresponding to the calendar date and time for the internal JD values.

to_value(parent=None, out_subfmt=None)

Return time representation from internal jd1 and jd2 in specified out_subfmt.

This is the base method that ignores parent and uses the value property to compute the output. This is done by temporarily setting self.out_subfmt and calling self.value. This is required for legacy Format subclasses prior to astropy 4.0 New code should instead implement the value functionality in to_value() and then make the value property be a simple call to self.to_value().

parentobj

Parent ~astropy.time.Time object associated with this ~astropy.time.TimeFormat object

out_subfmtstr or None

Output subformt (use existing self.out_subfmt if None)

valuenumpy.array, numpy.ma.array

Array or masked array of formatted time representation values

Functions

sorts.io.ccsds.read_oem(fname, xml=True)[source]

Todo: docstring

sorts.io.ccsds.read_tdm(fname, xml=True)[source]

Just get the range data # TODO: the rest

# TODO: Document function. # TODO: Update plain text function to be more general and conform to CCSDS 2.0

sorts.io.ccsds.write_oem(t, state, meta, fname=None, xml=True)[source]

Uses a series of astropy times and state vectors to create a CCSDS OEM file (plain-text of xml) or return a string.

Parameters
  • t (astropy.Time) – Vector of unix-times

  • state (numpy.ndarray) – 6-D states given in SI units in the ITRF2000 frame. Rows correspond to different states and columns to dimensions.

  • meta (dict) – Dict containing all the standard CCSDS 2.0 meta data.

  • xml (bool) – If False, use the plain-text format

  • fname (str) – Output file-path for OEM.

sorts.io.ccsds.write_tdm(datas, meta, fname=None)[source]

# TODO: Document function. # TODO: Update function to be more general # TODO: add arbitrary fields and meta data

sorts.io.ccsds.xml_tdm_segmet(datas)[source]
sorts.io.ccsds.xml_tdm_tree(meta, segments)[source]