Skip to content

API

Point Target Binary

Input/output Point Target Binary product utilities.

Attributes

__all__ module-attribute

Python
__all__ = ['CoordinatesMemmap', 'PointSetProduct', 'RCSMemmap']

COORDINATES_RASTER_FILENAMES module-attribute

Python
COORDINATES_RASTER_FILENAMES = ['PointTargetPosX', 'PointTargetPosY', 'PointTargetPosZ']

RCS_RASTER_FILENAMES module-attribute

Python
RCS_RASTER_FILENAMES = ['PointTargetRCSHH', 'PointTargetRCSHV', 'PointTargetRCSVH', 'PointTargetRCSVV']

METADATA_EXTENSION module-attribute

Python
METADATA_EXTENSION = '.xml'

OpenMode module-attribute

Python
OpenMode = Literal['r', 'w']

Classes

CoordinatesMemmap dataclass

Coordinates memmap.

Attributes

x instance-attribute
Python
x: MemmappedNDArray
y instance-attribute
Python
y: MemmappedNDArray
z instance-attribute
Python
z: MemmappedNDArray

Methods:

__init__
Python
__init__(x: MemmappedNDArray, y: MemmappedNDArray, z: MemmappedNDArray) -> None

RCSMemmap dataclass

RCS memmap.

Attributes

HH instance-attribute
Python
HH: MemmappedNDArray
HV instance-attribute
Python
HV: MemmappedNDArray
VH instance-attribute
Python
VH: MemmappedNDArray
VV instance-attribute
Python
VV: MemmappedNDArray

Methods:

__init__
Python
__init__(HH: MemmappedNDArray, HV: MemmappedNDArray, VH: MemmappedNDArray, VV: MemmappedNDArray) -> None

PointSetProduct

PointSetProduct class representing the point target binary file.

Attributes

product_path property
Python
product_path: Path

PointSetProduct folder path.

number_of_targets property
Python
number_of_targets: int

Number of targets inside the PointSetProduct folder.

Methods:

__init__
Python
__init__(path: str | Path, open_mode: OpenMode = 'r') -> None

PointSetProduct init.

Parameters:

Name Type Description Default
path str | Path

path to the product folder

required
open_mode OpenMode

open mode (can be write "w" or read "r"), write mode will overwrite existing data, by default "r".

'r'

Raises:

Type Description
RuntimeError

if open_mode is "r" and path does not exist or is not a directory

ValueError

if open_mode is not "r" or "w"

read_data
Python
read_data(start: int = 0, num_points: int | None = None) -> tuple[np.ndarray, np.ndarray]

Read Point Target Binary rasters to extract point target data.

Parameters:

Name Type Description Default
start int

number of point targets from which to start reading the raster, by default 0

0
num_points int | None

number of points to be read, if None all points are read from the start to the end, by default None

None

Returns:

Type Description
ndarray

coordinates array in the form (N, 3)

ndarray

rcs array (HH, HV, VH, VV) in the form (N, 4)

Raises:

Type Description
ValueError

if start is negative

ValueError

if num_points is 0 or negative

ValueError

if start + num_points exceeds total number of points

ValueError

if start exceeds total number of points

ValueError

if num_points exceeds total number of points

read_data_as_memmap
Python
read_data_as_memmap() -> Generator[tuple[CoordinatesMemmap, RCSMemmap]]

Create and manages the lifecycle of a memmap to the Point Target Binary rasters.

Usage

with prod.read_data_as_memmap() as (coords_mm, rcs_mm): ...

Yields:

Type Description
CoordinatesMemmap

Object containing 3 memmaps (x, y, z) pointing to arrays of shape (N,)

RCSMemmap

Object containing 4 memmaps (HH, HV, VH, VV) pointing to arrays of shape (N,)

write_data
Python
write_data(coords: ndarray, rcs: ndarray, coords_data_type: Literal['FLOAT32', 'FLOAT64'] = 'FLOAT64', rcs_data_type: Literal['FLOAT_COMPLEX', 'DOUBLE_COMPLEX'] = 'FLOAT_COMPLEX') -> None

Write data to the Point Set Target folder.

Parameters:

Name Type Description Default
coords ndarray

point target coordinates, in the form (N, 3)

required
rcs ndarray

point target radar cross section values, in the form (N, 4) (HH,HV,VH,VV)

required
coords_data_type Literal['FLOAT32', 'FLOAT64']

data type to be used in writing coordinates rasters

'FLOAT64'
rcs_data_type Literal['FLOAT_COMPLEX', 'DOUBLE_COMPLEX']

data type to be used in writing rcs rasters

'FLOAT_COMPLEX'

Raises:

Type Description
RuntimeError

if coordinates shape is wrong

RuntimeError

if rcs shape is wrong

RuntimeError

if coordinates shape does not match rcs shape

Functions:

Nominal Point Targets

Nominal point target structure definition.

Attributes

__all__ module-attribute

Python
__all__ = ['NominalPointTarget', 'convert_array_to_point_target_structure']

Classes

NominalPointTarget dataclass

Nominal Point Target.

Attributes

xyz_coordinates instance-attribute
Python
xyz_coordinates: NDArray[float64]
rcs_hh instance-attribute
Python
rcs_hh: complex128
rcs_vv instance-attribute
Python
rcs_vv: complex128
rcs_vh instance-attribute
Python
rcs_vh: complex128
rcs_hv instance-attribute
Python
rcs_hv: complex128
delay class-attribute instance-attribute
Python
delay: float | None = None

Methods:

__init__
Python
__init__(xyz_coordinates: NDArray[float64], rcs_hh: complex128, rcs_vv: complex128, rcs_vh: complex128, rcs_hv: complex128, delay: float | None = None) -> None

Functions:

convert_array_to_point_target_structure

Python
convert_array_to_point_target_structure(coords: ndarray, rcs: ndarray, point_target_ids: list[str] | None = None) -> dict[str, NominalPointTarget]

Convert coordinates and rcs arrays to an array of structures.

Parameters:

Name Type Description Default
coords ndarray

point target coordinates, in the form (N, 3)

required
rcs ndarray

point target rcs values (HH, HV, VH, VV), in the form (N, 4)

required
point_target_ids list[str] | None

optional list of point target id labels, by default None

None

Returns:

Type Description
Dict[str, NominalPointTarget]

keys are the target ID, values are the corresponding NominalPointTarget objects

Raises:

Type Description
RuntimeError

if coordinates shape is wrong

RuntimeError

if rcs shape is wrong

RuntimeError

if coordinates shape does not match rcs shape

RuntimeError

if point targets ids shape does not match coordinates shape