AFRL/RDE labeling Fiducial Info (sarpy.annotation.afrl_rde_elements.FiducialInfo)

Definition for the FiducialInfo NGA modified RDE/AFRL labeling object

class sarpy.annotation.afrl_rde_elements.FiducialInfo.ImageLocationType(CenterPixel=None, **kwargs)

Bases: Serializable

CenterPixel: RowColType

The pixel location of the center of the object Required.

Type:

RowColType

classmethod from_geolocation(geo_location, the_structure)

Construct from the corresponding Geolocation using the sicd projection model.

Parameters:
Return type:

None|ImageLocationType

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.annotation.afrl_rde_elements.FiducialInfo.GeoLocationType(CenterPixel=None, **kwargs)

Bases: Serializable

CenterPixel: LatLonEleType

The physical location of the center of the object Required.

Type:

LatLonEleType

classmethod from_image_location(image_location, the_structure, projection_type='HAE', **proj_kwargs)

Construct the geographical location from the image location via projection using the SICD model.

Note

This assumes that the image coordinates are with respect to the given image (chip), and NOT including any sicd.ImageData.FirstRow/Col values, which will be added here.

Parameters:
Returns:

Coordinates may be populated as NaN if projection fails.

Return type:

None|GeoLocationType

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.annotation.afrl_rde_elements.FiducialInfo.PhysicalLocationType(Physical=None, **kwargs)

Bases: Serializable

Physical: ImageLocationType

Required.

Type:

ImageLocationType

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.annotation.afrl_rde_elements.FiducialInfo.TheFiducialType(Name=None, SerialNumber=None, FiducialType=None, DatasetFiducialNumber=None, ImageLocation=None, GeoLocation=None, IPRWidth3dB=None, IPRWidth18dB=None, IPRWidth3dB18dBRatio=None, PeakSideLobeRatio=None, IntegratedSideLobeRatio=None, SlantPlane=None, GroundPlane=None, ProjectionPerturbation=None, **kwargs)

Bases: Serializable

Name: str | None

Name of the fiducial. Optional.

Type:

str

SerialNumber: str | None

The serial number of the fiducial Optional.

Type:

str

FiducialType: str

The type of fiducial Required.

Type:

str

DatasetFiducialNumber: int | None

Unique number of the fiducial within the selected dataset, defined by the RDE system Optional.

Type:

int

ImageLocation: ImageLocationType | None

Center of the fiducial in the image Required.

Type:

ImageLocationType

GeoLocation: GeoLocationType | None

Real physical location of the fiducial Required.

Type:

GeoLocationType

IPRWidth3dB: RangeCrossRangeType | None

The 3 dB impulse response width, in meters Optional.

Type:

RangeCrossRangeType

IPRWidth18dB: RangeCrossRangeType | None

The 18 dB impulse response width, in meters Optional.

Type:

RangeCrossRangeType

IPRWidth3dB18dBRatio: RangeCrossRangeType | None

Ratio of the 3 dB to 18 dB system impulse response width Optional.

Type:

RangeCrossRangeType

PeakSideLobeRatio: RangeCrossRangeType | None

Ratio of the peak sidelobe intensity to the peak mainlobe intensity, in dB Optional.

Type:

RangeCrossRangeType

IntegratedSideLobeRatio: RangeCrossRangeType | None

Ratio of all the energies in the sidelobes of the system impulse response to the energy in the mainlobe, in dB Optional.

Type:

RangeCrossRangeType

SlantPlane: PhysicalLocationType | None

Center of the object in the slant plane Optional.

Type:

PhysicalLocationType

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

GroundPlane: PhysicalLocationType | None

Center of the object in the ground plane Optional.

Type:

PhysicalLocationType

ProjectionPerturbation: ProjectionPerturbationType | None

Optional.

Type:

ProjectionPerturbationType

set_image_location_from_sicd(sicd, populate_in_periphery=False)

Set the image location information with respect to the given SICD.

Parameters:
  • sicd (SICDType) –

  • populate_in_periphery (bool) –

Returns:

-1 - insufficient metadata to proceed 0 - nothing to be done 1 - successful 2 - object in image periphery, not populating 3 - object not in image field

Return type:

int

set_geo_location_from_sicd(sicd, projection_type='HAE', **proj_kwargs)

Set the geographical location information with respect to the given SICD, assuming that the image coordinates are populated.

Note

This assumes that the image coordinates are with respect to the given image (chip), and NOT including any sicd.ImageData.FirstRow/Col values, which will be added here.

Parameters:
  • sicd (SICDType) –

  • projection_type (str) – The projection type selector, one of [‘PLANE’, ‘HAE’, ‘DEM’]. Using ‘DEM’ requires configuration for the DEM pathway described in sarpy.geometry.point_projection.image_to_ground_dem().

  • proj_kwargs – The keyword arguments for the SICDType.project_image_to_ground_geo() method.

class sarpy.annotation.afrl_rde_elements.FiducialInfo.FiducialInfoType(NumberOfFiducialsInImage=None, NumberOfFiducialsInScene=None, LabelSource=None, Fiducials=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

NumberOfFiducialsInImage: int

Number of ground truthed objects in the image. Required.

Type:

int

NumberOfFiducialsInScene: int

Number of ground truthed objects in the scene. Required.

Type:

int

LabelSource: LabelSourceType

The source of the labels Required.

Type:

LabelSourceType

Fiducials: List[TheFiducialType]

The object collection Required.

Type:

List[TheFiducialType]

set_image_location_from_sicd(sicd, populate_in_periphery=False, include_out_of_range=False)

Set the image location information with respect to the given SICD, assuming that the physical coordinates are populated. The NumberOfFiducialsInImage will be set, and NumberOfFiducialsInScene will be left unchanged.

Parameters:
  • sicd (SICDType) –

  • populate_in_periphery (bool) – Populate image information for objects on the periphery?

  • include_out_of_range (bool) – Include the objects which are out of range (with no image location information)?