RCS annotation element definition (sarpy.annotation.rcs)

This module provides structures for annotating a given SICD type file for RCS calculations

sarpy.annotation.rcs.create_rcs_value_collection_for_reader(reader, polygon)

Given a SICD type reader and a polygon with coordinates in pixel space (all sicd footprint assumed applicable), construct the RCSValueCollection.

Parameters:
Return type:

RCSValueCollection

class sarpy.annotation.rcs.RCSStatistics(mean=None, std=None, max=None, min=None)

Bases: Jsonable

classmethod from_dict(the_json)

Deserialize from json.

Parameters:

the_json (Dict) –

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

copy()

Make a deep copy of the item.

replicate()

Make a replica of the item, where uid has not been copied.

property type

The type identifier.

Return type:

str

class sarpy.annotation.rcs.RCSValue(polarization, units, index, value=None, noise=None)

Bases: Jsonable

The collection of RCSStatistics elements.

property value

The value

Type:

None|RCSStatistics

property index

The image index to which this applies

Type:

int

property noise

The noise

Type:

None|RCSStatistics

classmethod from_dict(the_json: dict) RCSValue

Deserialize from json.

Parameters:

the_json (Dict) –

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

copy()

Make a deep copy of the item.

replicate()

Make a replica of the item, where uid has not been copied.

property type

The type identifier.

Return type:

str

class sarpy.annotation.rcs.RCSValueCollection(pixel_count=None, elements=None)

Bases: Jsonable

A specific type for the AnnotationProperties.parameters

property pixel_count: None | int

The number of integer pixel grid elements contained in the interior of the associated geometry element.

Type:

None|int

property elements: None | List[RCSValue]

The RCSValue elements.

Type:

List[RCSValue]

insert_new_element(element)

Inserts an element at the end of the elements list.

Parameters:

element (RCSValue) –

classmethod from_dict(the_json: dict) RCSValueCollection

Deserialize from json.

Parameters:

the_json (Dict) –

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

copy()

Make a deep copy of the item.

replicate()

Make a replica of the item, where uid has not been copied.

property type

The type identifier.

Return type:

str

class sarpy.annotation.rcs.RCSProperties(name=None, description=None, directory=None, geometry_properties=None, parameters=None)

Bases: AnnotationProperties

property parameters

The parameters

Type:

RCSValueCollection

add_geometry_property(entry)

Add a geometry property to the list.

Warning

Care should be taken that this list stay in sync with the parent geometry.

Parameters:

entry (Dict|GeometryProperties) – The geometry properties instance of serialized version of it.

copy()

Make a deep copy of the item.

property description

The description

Type:

Optional[str]

property directory

The directory - for basic display and/or subdivision purposes

Type:

Optional[str]

classmethod from_dict(the_json)

Deserialize from json.

Parameters:

the_json (Dict) –

Return type:

AnnotationProperties

property geometry_properties: List[GeometryProperties]

The geometry properties.

Type:

List[GeometryProperties]

get_geometry_property(item)

Fetches the appropriate geometry property.

Parameters:

item (int|str) – The geometry properties uid or integer index.

Return type:

GeometryProperties

Raises:

KeyError

get_geometry_property_and_index(item)

Fetches the appropriate geometry property and its integer index.

Parameters:

item (int|str) – The geometry properties uid or integer index.

Return type:

(GeometryProperties, int)

Raises:

KeyError

property name

The name

Type:

Optional[str]

replicate()

Make a replica of the item, where uid has not been copied.

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

property type

The type identifier.

Return type:

str

class sarpy.annotation.rcs.RCSFeature(uid=None, geometry=None, properties=None)

Bases: AnnotationFeature

A specific extension of the Feature class which has the properties attribute populated with RCSValueCollection instance.

property properties: RCSProperties

The properties.

Return type:

RCSProperties

set_rcs_parameters_from_reader(reader)

Given a SICD type reader construct the RCSValueCollection and set that as the properties.parameters value.

Parameters:

reader (SICDTypeReader) –

add_geometry_element(geometry, properties=None)

Adds the given geometry to the feature geometry (collection).

Parameters:
add_to_kml(doc, coord_transform, parent=None)

Add this feature to the kml document. Note that coordinates or transformed coordinates are assumed to be WGS-84 coordinates in longitude, latitude order. Currently only the first two (i.e. longitude and latitude) are used in this export.

Parameters:
  • doc (sarpy.io.kml.Document) –

  • coord_transform (None|callable) – If callable, the the transform will be applied to the coordinates before adding to the document.

  • parent (None|minidom.Element) – The parent node.

Return type:

None

copy()

Make a deep copy of the item.

classmethod from_dict(the_json)

Deserialize from json.

Parameters:

the_json (Dict) –

property geometry

The geometry object.

Return type:

GeometryObject|GeometryCollection

property geometry_count

The number of base geometry elements

Type:

int

get_geometry_and_geometry_properties(item)

Gets the geometry and geometry properties object for the given index/uid.

Parameters:

item (int|str) – The geometry properties uid or integer index.

Return type:

(Point|Line|Polygon, GeometryProperties)

Raises:

KeyError

get_geometry_element(item)

Gets the basic geometry object at the given index.

Parameters:

item (int|str) – The integer index or associated geometry properties uid.

Return type:

Point|Line|Polygon

Raises:

ValueError|KeyError

get_geometry_name(item)

Gets the name, or a reasonable default, for the geometry.

Parameters:

item (int|str) –

Return type:

str

get_geometry_property(item)

Gets the geometry properties object for the given index/uid.

Parameters:

item (int|str) – The geometry properties uid or integer index.

Return type:

GeometryProperties

Raises:

KeyError

get_geometry_property_and_index(item)

Gets the geometry properties object and integer index for the given index/uid.

Parameters:

item (int|str) – The geometry properties uid or integer index.

Return type:

(GeometryProperties, int)

Raises:

KeyError

get_name()

Gets a useful name.

Return type:

str

remove_geometry_element(item)

Remove the geometry element at the given index

Parameters:

item (int|str) –

replicate()

Make a replica of the item, where uid has not been copied.

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

property type

The type identifier.

Return type:

str

property uid

The feature unique identifier.

Return type:

str

class sarpy.annotation.rcs.RCSCollection(features=None)

Bases: AnnotationCollection

A specific extension of the AnnotationCollection class which has that the features are RCSFeature instances.

copy()

Make a deep copy of the item.

export_to_kml(file_name, coord_transform=None, **params)

Export to a kml document. Note that underlying geometry coordinates or transformed coordinates are assumed in longitude, latitude order. Currently only the first two (i.e. longitude and latitude) are used in this export.

Parameters:
  • file_name (str|zipfile.ZipFile|file like) –

  • coord_transform (None|callable) – The coordinate transform function.

  • params (dict) –

Return type:

None

classmethod from_dict(the_json)

Deserialize from json.

Parameters:

the_json (Dict) –

get_integer_index(feature_id)

Gets the integer index for the given feature id.

Parameters:

feature_id (str) –

Return type:

int

replicate()

Make a replica of the item, where uid has not been copied.

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

property type

The type identifier.

Return type:

str

property features

The features list.

Return type:

List[RCSFeature]

add_feature(feature)

Add an annotation.

Parameters:

feature (RCSFeature|dict) –

class sarpy.annotation.rcs.FileRCSCollection(version=None, annotations=None, image_file_name=None, image_id=None, core_name=None)

Bases: FileAnnotationCollection

An collection of RCS statistics elements.

copy()

Make a deep copy of the item.

property core_name

The image core name, if appropriate.

Return type:

None|str

property image_file_name

The image file name, if appropriate.

Return type:

None|str

property image_id

The image id, if appropriate.

Return type:

None|str

replicate()

Make a replica of the item, where uid has not been copied.

to_dict(parent_dict=None)

Serialize to json.

Parameters:

parent_dict (None|Dict) –

Return type:

Dict

property type

The type identifier.

Return type:

str

property version

The version

Type:

str

property annotations

The annotations.

Return type:

RCSCollection

add_annotation(annotation)

Add an annotation.

Parameters:

annotation (RCSFeature) – The prospective annotation.

delete_annotation(annotation_id)

Deletes the annotation associated with the given id.

Parameters:

annotation_id (str) –

classmethod from_file(file_name)

Read from (json) file.

Parameters:

file_name (str) –

Return type:

FileRCSCollection

classmethod from_dict(the_dict)

Define from a dictionary representation.

Parameters:

the_dict (dict) –

Return type:

FileRCSCollection