NASA Logo
Ocean Color Science Software

ocssw V2022
Inheritance diagram for DatetimeConverter:
[legend]
Collaboration diagram for DatetimeConverter:
[legend]

Public Member Functions

def __init__ (self, since, units)
 
def convert (self, *field_arrays)
 
- Public Member Functions inherited from Converter
def __init__ (self)
 
def convert (self, field_array)
 

Detailed Description

Post-processing conversion for converting timestamp fields to datetime
instances, computed using offset(s) from a reference time.

This class supports the offsets stored in multiple input fields, for example
where one field is a coarse time (e.g. seconds) and a second field is a fine
time (e.g. nanoseconds). To use multiple input fields, pass a tuple of input
field names when this converter is added to the packet.

Definition at line 173 of file converters.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  since,
  units 
)
Initialize a DatetimeConverter

Parameters
----------
since : datetime
  Reference datetime. The time stored in the field(s) is considered an
  offset to this reference. If this has timezone information attached to
  it, so will the converted datetimes.
units : str or tuple of str
  Units string of tuples of units strings for the offset of each
  input field.  Valid units are "days", "hours", "minutes",
  "seconds", "milliseconds", "microseconds", and "nanoseconds".

Raises
------
TypeError
  One of the input arguments is not of the correct type
ValueError
  One or more of the units are invalid

Definition at line 196 of file converters.py.

Member Function Documentation

◆ convert()

def convert (   self,
field_arrays 
)
Apply the datetime conversion.

Parameters
----------
field_arrays : list of NumPy array
  list of decoded packet field values, each must have at least one
  dimension

Returns
-------
converted : NumPy array of object (holding datetimes)
  converted form of the decoded packet field values

Raises
------
ValueError
  Too many or too few units were provided, as compared to the
  input field arrays sent.

Definition at line 233 of file converters.py.


The documentation for this class was generated from the following file:
  • /gfs-oceanweb/web/ocssw/ocssw_src/src/scripts/telemetry/ccsdspy/converters.py