ocssw
V2022
|
EnumConverter
Inheritance diagram for EnumConverter:
Collaboration diagram for EnumConverter:
Public Member Functions | |
def | __init__ (self, replace_dict) |
def | convert (self, field_array) |
![]() | |
def | __init__ (self) |
Detailed Description
Post-processing conversion for applying dictionary replacement of integers to strings. If during conversion a value is encountered which does not have a corresponding key in the replacement dictionary, then a `:py:class:`~ccsdspy.converters.EnumConverterMissingKey` exception will be thrown.
Definition at line 103 of file converters.py.
Constructor & Destructor Documentation
◆ __init__()
def __init__ | ( | self, | |
replace_dict | |||
) |
Initialize a EnumConverter. Parameters ---------- replace_dict : dict of int to string Replacement dictionary mapping integer values to string values Raises ------ TypeError Either one of the keys of the replacement dictionary is not an integer, or one of the values is not a string.
Definition at line 113 of file converters.py.
Member Function Documentation
◆ convert()
def convert | ( | self, | |
field_array | |||
) |
Apply the enum replacement conversion. Parameters ---------- field_array : NumPy array decoded packet field values, must have at least one dimension Returns ------- converted : NumPy array converted form of the decoded packet field values
Reimplemented from Converter.
Definition at line 141 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