The CPHD 1.0 PVP object¶
The Per Vector parameters (PVP) definition.
- class sarpy.io.phase_history.cphd1_elements.PVP.PerVectorParameterI8(Offset=None, **kwargs)¶
Bases:
Serializable
- Offset: int¶
The offset value. Must be in the range [0, None] Required.
- Type:
int
- property Size¶
The size of the vector, constant value 1 here.
- Type:
int
- property Format¶
The format of the vector data, constant value ‘I8’ here.
- Type:
str
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.PerVectorParameterF8(Offset=None, **kwargs)¶
Bases:
Serializable
- Offset: int¶
The offset value. Must be in the range [0, None] Required.
- Type:
int
- property Size¶
The size of the vector, constant value 1 here.
- Type:
int
- property Format¶
The format of the vector data, constant value ‘F8’ here.
- Type:
str
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.PerVectorParameterXYZ(Offset=None, **kwargs)¶
Bases:
Serializable
- Offset: int¶
The offset value. Must be in the range [0, None] Required.
- Type:
int
- property Size¶
The size of the vector, constant value 3 here.
- Type:
int
- property Format¶
The format of the vector data, constant value ‘X=F8;Y=F8;Z=F8;’ here.
- Type:
str
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.PerVectorParameterEB(Offset=None, **kwargs)¶
Bases:
Serializable
- Offset: int¶
The offset value. Must be in the range [0, None] Required.
- Type:
int
- property Size¶
The size of the vector, constant value 2 here.
- Type:
int
- property Format¶
The format of the vector data, constant value ‘DCX=F8;DCY=F8;’ here.
- Type:
str
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.UserDefinedPVPType(Name=None, Offset=None, Size=None, Format=None, **kwargs)¶
Bases:
Serializable
A user defined PVP structure.
- Name: str¶
Required.
- Type:
str
- Offset: int¶
Must be in the range [0, None] Required.
- Type:
int
- Size: int¶
Must be in the range [1, None] Required.
- Type:
int
- Format: str¶
Required.
- Type:
str
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.TxAntennaType(TxACX: PerVectorParameterXYZ = None, TxACY: PerVectorParameterXYZ = None, TxEB: PerVectorParameterEB = None, **kwargs)¶
Bases:
Serializable
- TxACX: PerVectorParameterXYZ¶
Required.
- Type:
- TxACY: PerVectorParameterXYZ¶
Required.
- Type:
- TxEB: PerVectorParameterEB¶
Required.
- Type:
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.RcvAntennaType(RcvACX: PerVectorParameterXYZ | None = None, RcvACY: PerVectorParameterXYZ | None = None, RcvEB: PerVectorParameterEB | None = None, **kwargs)¶
Bases:
Serializable
- RcvACX: PerVectorParameterXYZ¶
Required.
- Type:
- RcvACY: PerVectorParameterXYZ¶
Required.
- Type:
- RcvEB: PerVectorParameterEB¶
Required.
- Type:
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- class sarpy.io.phase_history.cphd1_elements.PVP.PVPType(TxTime: PerVectorParameterF8 = None, TxPos: PerVectorParameterXYZ = None, TxVel: PerVectorParameterXYZ = None, RcvTime: PerVectorParameterF8 = None, RcvPos: PerVectorParameterXYZ = None, RcvVel: PerVectorParameterXYZ = None, SRPPos: PerVectorParameterXYZ = None, AmpSF: PerVectorParameterF8 | None = None, aFDOP: PerVectorParameterF8 = None, aFRR1: PerVectorParameterF8 = None, aFRR2: PerVectorParameterF8 = None, FX1: PerVectorParameterF8 = None, FX2: PerVectorParameterF8 = None, FXN1: PerVectorParameterF8 | None = None, FXN2: PerVectorParameterF8 | None = None, TOA1: PerVectorParameterF8 = None, TOA2: PerVectorParameterF8 = None, TOAE1: PerVectorParameterF8 | None = None, TOAE2: PerVectorParameterF8 | None = None, TDTropoSRP: PerVectorParameterF8 = None, TDIonoSRP: PerVectorParameterF8 | None = None, SC0: PerVectorParameterF8 = None, SCSS: PerVectorParameterF8 = None, SIGNAL: PerVectorParameterI8 | None = None, TxAntenna: TxAntennaType | None = None, RcvAntenna: RcvAntennaType | None = None, AddedPVP: List[UserDefinedPVPType] | None = None, **kwargs)¶
Bases:
Serializable
- copy()¶
Create a deep copy.
- classmethod from_dict(input_dict)¶
For json deserialization, from dict instance.
- Parameters:
input_dict (dict) – Appropriate parameters dict instance for deserialization
- Return type:
Corresponding class instance
- classmethod from_node(node, xml_ns, ns_key=None, kwargs=None)¶
For XML deserialization.
- Parameters:
node (ElementTree.Element) – dom element for serialized class instance
xml_ns (None|dict) – The xml namespace dictionary.
ns_key (None|str) – The xml namespace key. If xml_ns is None, then this is ignored. If None and xml_ns is not None, then the string default will be used. This will be recursively passed down, unless overridden by an entry of the cls._child_xml_ns_key dictionary.
kwargs (None|dict) – None or dictionary of previously serialized attributes. For use in inheritance call, when certain attributes require specific deserialization.
- Return type:
Corresponding class instance
- is_valid(recursive=False, stack=False)¶
Returns the validity of this object according to the schema. This is done by inspecting that all required fields (i.e. entries of _required) are not None.
- Parameters:
recursive (bool) – True if we recursively check that child are also valid. This may result in verbose (i.e. noisy) logging.
stack (bool) – Print a recursive error message?
- Returns:
condition for validity of this element
- Return type:
bool
- log_validity_error(msg)¶
Log a validity check error message.
- Parameters:
msg (str) –
- log_validity_info(msg)¶
Log a validation info message.
- Parameters:
msg (str) –
- log_validity_warning(msg)¶
Log a validity check warning message.
- Parameters:
msg (str) –
- set_numeric_format(attribute, format_string)¶
Sets the numeric format string for the given attribute.
- Parameters:
attribute (str) – attribute for which the format applies - must be in _fields.
format_string (str) – format string to be applied
- Return type:
None
- to_dict(check_validity=False, strict=False, exclude=())¶
For json serialization.
- Parameters:
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
dict representation of class instance appropriate for direct json serialization.
- Return type:
OrderedDict
- to_node(doc, tag, ns_key=None, parent=None, check_validity=False, strict=False, exclude=())¶
For XML serialization, to a dom element.
- Parameters:
doc (ElementTree.ElementTree) – The xml Document
tag (None|str) – The tag name. Defaults to the value of self._tag and then the class name if unspecified.
ns_key (None|str) – The namespace prefix. This will be recursively passed down, unless overridden by an entry in the _child_xml_ns_key dictionary.
parent (None|ElementTree.Element) – The parent element. Defaults to the document root element if unspecified.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
exclude (tuple) – Attribute names to exclude from this generic serialization. This allows for child classes to provide specific serialization for special properties, after using this super method.
- Returns:
The constructed dom element, already assigned to the parent element.
- Return type:
ElementTree.Element
- to_xml_bytes(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a bytes array, which corresponds to the xml string in utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace string or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
bytes array from
ElementTree.tostring()
call.- Return type:
bytes
- to_xml_string(urn=None, tag=None, check_validity=False, strict=False)¶
Gets a xml string with utf-8 encoding, identified as using the namespace given by urn (if given).
- Parameters:
urn (None|str|dict) – The xml namespace or dictionary describing the xml namespace.
tag (None|str) – The root node tag to use. If not given, then the class name will be used.
check_validity (bool) – Check whether the element is valid before serializing, by calling
is_valid()
.strict (bool) – Only used if check_validity = True. In that case, if True then raise an Exception (of appropriate type) if the structure is not valid, if False then log a hopefully helpful message.
- Returns:
xml string from
ElementTree.tostring()
call.- Return type:
str
- TxTime: PerVectorParameterF8¶
Required.
- Type:
- TxPos: PerVectorParameterXYZ¶
Required.
- Type:
- TxVel: PerVectorParameterXYZ¶
Required.
- Type:
- RcvTime: PerVectorParameterF8¶
Required.
- Type:
- RcvPos: PerVectorParameterXYZ¶
Required.
- Type:
- RcvVel: PerVectorParameterXYZ¶
Required.
- Type:
- SRPPos: PerVectorParameterXYZ¶
Required.
- Type:
- AmpSF: PerVectorParameterF8¶
Optional.
- Type:
- aFDOP: PerVectorParameterF8¶
Required.
- Type:
- aFRR1: PerVectorParameterF8¶
Required.
- Type:
- aFRR2: PerVectorParameterF8¶
Required.
- Type:
- FX1: PerVectorParameterF8¶
Required.
- Type:
- FX2: PerVectorParameterF8¶
Required.
- Type:
- FXN1: PerVectorParameterF8¶
Optional.
- Type:
- FXN2: PerVectorParameterF8¶
Optional.
- Type:
- TOA1: PerVectorParameterF8¶
Required.
- Type:
- TOA2: PerVectorParameterF8¶
Required.
- Type:
- TOAE1: PerVectorParameterF8¶
Optional.
- Type:
- TOAE2: PerVectorParameterF8¶
Optional.
- Type:
- TDTropoSRP: PerVectorParameterF8¶
Required.
- Type:
- TDIonoSRP: PerVectorParameterF8¶
Optional.
- Type:
- SC0: PerVectorParameterF8¶
Required.
- Type:
- SCSS: PerVectorParameterF8¶
Required.
- Type:
- SIGNAL: PerVectorParameterI8¶
Optional.
- Type:
- TxAntenna: TxAntennaType | None¶
Optional.
- Type:
- RcvAntenna: RcvAntennaType | None¶
Optional.
- Type:
- AddedPVP: None | List[UserDefinedPVPType]¶
Optional.
- Type:
List[UserDefinedPVPType]
- get_size()¶
Gets the size in bytes of each vector.
- Return type:
int
- get_offset_size_format(field)¶
Get the Offset (in bytes), Size (in bytes) for the given field, as well as the corresponding struct format string.
- Parameters:
field (str) – The desired field name.
- Return type:
None|Tuple[int, int, str]
- get_vector_dtype()¶
Gets the dtype for the corresponding structured array for the full PVP array.
- Returns:
This will be a compound dtype for a structured array.
- Return type:
numpy.dtype