The Main SIDD 1.0 object

The SIDDType 1.0 definition.

class sarpy.io.product.sidd1_elements.SIDD.SIDDType(ProductCreation=None, Display=None, GeographicAndTarget=None, Measurement=None, ExploitationFeatures=None, DownstreamReprocessing=None, ErrorStatistics=None, Radiometric=None, ProductProcessing=None, Annotations=None, **kwargs)

Bases: Serializable

The root element of the SIDD 1.0 document.

ProductCreation: ProductCreationType

Information related to processor, classification, and product type. Required.

Type:

ProductCreationType

Display: ProductDisplayType

Contains information on the parameters needed to display the product in an exploitation tool. Required.

Type:

ProductDisplayType

GeographicAndTarget: GeographicAndTargetType

Contains generic and extensible targeting and geographic region information. Required.

Type:

GeographicAndTargetType

Measurement: MeasurementType

Contains the metadata necessary for performing measurements. Required.

Type:

MeasurementType

ExploitationFeatures: ExploitationFeaturesType

Computed metadata regarding the input collections and final product. Required.

Type:

ExploitationFeaturesType

DownstreamReprocessing: None | DownstreamReprocessingType

Metadata describing any downstream processing of the product. Optional.

Type:

DownstreamReprocessingType

ErrorStatistics: None | ErrorStatisticsType

Error statistics passed through from the SICD metadata. Optional.

Type:

ErrorStatisticsType

Radiometric: None | RadiometricType

Radiometric information about the product. Optional.

Type:

RadiometricType

ProductProcessing: ProductProcessingType

Contains metadata related to algorithms used during product generation. Optional.

Type:

ProductProcessingType

Annotations: AnnotationsType

List of annotations for the imagery. Optional.

Type:

AnnotationsType

property coa_projection

The COA Projection object, if previously defined through using define_coa_projection().

Return type:

None|sarpy.geometry.point_projection.COAProjection

property NITF

Optional dictionary of NITF header information, pertains only to subsequent SIDD file writing.

Return type:

Dict

can_project_coordinates()

Determines whether the necessary elements are populated to permit projection between image and physical coordinates. If False, then the (first discovered) reason why not will be logged at error level.

Return type:

bool

define_coa_projection(delta_arp=None, delta_varp=None, range_bias=None, adj_params_frame='ECF', override=True)

Define the COAProjection object.

Parameters:
  • delta_arp (None|numpy.ndarray|list|tuple) – ARP position adjustable parameter (ECF, m). Defaults to 0 in each coordinate.

  • delta_varp (None|numpy.ndarray|list|tuple) – VARP position adjustable parameter (ECF, m/s). Defaults to 0 in each coordinate.

  • range_bias (float|int) – Range bias adjustable parameter (m), defaults to 0.

  • adj_params_frame (str) – One of [‘ECF’, ‘RIC_ECF’, ‘RIC_ECI’], specifying the coordinate frame used for expressing delta_arp and delta_varp parameters.

  • override (bool) – should we redefine, if it is previously defined?

Return type:

None

project_ground_to_image(coords, **kwargs)

Transforms a 3D ECF point to pixel (row/column) coordinates. This is implemented in accordance with the SICD Image Projections Description Document. Really Scene-To-Image projection.

Parameters:
Returns:

  • image_points - the determined image point array, of size N x 2. Following the SICD convention, he upper-left pixel is [0, 0].

  • delta_gpn - residual ground plane displacement (m).

  • iterations - the number of iterations performed.

Return type:

Tuple[numpy.ndarray, float, int]

project_ground_to_image_geo(coords, ordering='latlong', **kwargs)

Transforms a 3D Lat/Lon/HAE point to pixel (row/column) coordinates. This is implemented in accordance with the SICD Image Projections Description Document. Really Scene-To-Image projection.

Parameters:
Returns:

  • image_points - the determined image point array, of size N x 2. Following the SICD convention, he upper-left pixel is [0, 0].

  • delta_gpn - residual ground plane displacement (m).

  • iterations - the number of iterations performed.

Return type:

Tuple[numpy.ndarray, float, int]

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

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) –

project_image_to_ground(im_points, projection_type='HAE', **kwargs)

Transforms image coordinates to ground plane ECF coordinate via the algorithm(s) described in SICD Image Projections document.

Parameters:
  • im_points (numpy.ndarray|list|tuple) – the image coordinate array

  • projection_type (str) – One of [‘PLANE’, ‘HAE’, ‘DEM’]. Type DEM is a work in progress.

  • kwargs – The keyword arguments for the sarpy.geometry.point_projection.image_to_ground() method.

Returns:

Ground Plane Point (in ECF coordinates) corresponding to the input image coordinates.

Return type:

numpy.ndarray

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

project_image_to_ground_geo(im_points, ordering='latlong', projection_type='HAE', **kwargs)

Transforms image coordinates to ground plane WGS-84 coordinate via the algorithm(s) described in SICD Image Projections document.

Parameters:
Returns:

Ground Plane Point (in ECF coordinates) corresponding to the input image coordinates.

Return type:

numpy.ndarray

static get_xmlns_collection()

Gets the correct SIDD 1.0 dictionary of xml namespace details.

Return type:

dict

static get_des_details()

Gets the correct SIDD 1.0 DES subheader details.

Return type:

dict

classmethod from_node(node, xml_ns, ns_key='default', 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

to_xml_bytes(urn=None, tag='SIDD', 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='SIDD', 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

copy()

Provides a deep copy.

Return type:

SIDDType

classmethod from_xml_file(file_path)

Construct the sidd object from a stand-alone xml file path.

Parameters:

file_path (str) –

Return type:

SIDDType

classmethod from_xml_string(xml_string)

Construct the sidd object from an xml string.

Parameters:

xml_string (str|bytes) –

Return type:

SIDDType