API
Point Target Binary
Input/output Point Target Binary product utilities.
Attributes
COORDINATES_RASTER_FILENAMES
module-attribute
RCS_RASTER_FILENAMES
module-attribute
RCS_RASTER_FILENAMES = ['PointTargetRCSHH', 'PointTargetRCSHV', 'PointTargetRCSVH', 'PointTargetRCSVV']
Classes
CoordinatesMemmap
dataclass
RCSMemmap
dataclass
RCS memmap.
Attributes
Methods:
PointSetProduct
PointSetProduct class representing the point target binary file.
Attributes
number_of_targets
property
Number of targets inside the PointSetProduct folder.
Methods:
__init__
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
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
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
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
Classes
NominalPointTarget
dataclass
Nominal Point Target.
Attributes
Methods:
Functions:
convert_array_to_point_target_structure
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 |