API
Product Folder Format
Product Folder utilities.
Attributes
__all__
module-attribute
__all__ = ['ProductFolder', 'create_product_folder', 'delete_product_folder_content', 'is_product_folder', 'is_valid_product_folder', 'open_product_folder', 'rename_product_folder']
Classes
ProductFolder
Product Folder main object.
Attributes
raster_extension
property
The channel raster file extension.
channel_ids
property
The list of available channels on disk for the current Product Folder.
Returns:
| Type | Description |
|---|---|
list[int]
|
list of integers corresponding to the available channels. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if the current path is not a valid product folder |
config_path
property
Getter method for retrieving Product Folder config file path.
Returns:
| Type | Description |
|---|---|
Path
|
Path to the Product Folder config file. |
overlay_path
property
Getter method for retrieving Product Folder overlay (.kmz) file path.
Returns:
| Type | Description |
|---|---|
Path
|
Path to the Product Folder overlay file. |
Methods:
__init__
Generate a Product Folder object from its path and the extension of its data files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
path to the selected Product Folder |
required |
raster_extension
|
RasterExtension
|
extension of channel raster data files, by default "". |
''
|
rename
channel_metadata_path
channel_data_path
channel_quicklook_path
Quicklook full path for the selected channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ext
|
QuicklookExtension
|
quicklook extension |
required |
channel_id
|
int
|
channel number. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the quicklook image corresponding to the selected channel |
Functions:
create_product_folder
create_product_folder(pf_path: str | Path, raster_extension: RasterExtension = '', *, overwrite_ok: bool = False, description: str | None = None) -> ProductFolder
Create a new Product Folder layout at the desired location.
If the path provided already exists, it raises an error unless the overwrite_ok flag is set to True. In this case, if the target location corresponds to a valid Product Folder, the Product is erased and overwritten.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf_path
|
str | Path
|
path to the location where to create the Product Folder |
required |
raster_extension
|
RasterExtension
|
extension of the channel's raster data file to be written in Manifest, by default "" |
''
|
overwrite_ok
|
bool
|
if True, if a valid Product Folder is located at the given path, it is overwritten, by default False |
False
|
description
|
str | None
|
description of the product folder, by default None |
None
|
Returns:
| Type | Description |
|---|---|
ProductFolder
|
Product Folder object |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if path already exist but the path does not correspond to a valid Product Folder |
RuntimeError
|
if input path already exist but overwrite permissions are not given |
open_product_folder
Open Product Folder at the provided location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf_path
|
str | Path
|
path to the location where to create the Product Folder. |
required |
Returns:
| Type | Description |
|---|---|
ProductFolder
|
Product Folder object |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if path provided does not exist |
RuntimeError
|
if path provided exist but does not correspond to a valid Product Folder |
is_product_folder
Check if input path corresponds to a valid Product Folder, basic version.
Conditions to be met for Product Folder validity: - path exists - path is a directory - manifest exist - manifest can be loaded
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf_path
|
str | Path
|
path to Product Folder to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
true if path is a Product Folder, else False |
is_valid_product_folder
Check if the input path corresponds to a valid Product Folder.
Conditions to be met for Product Folder validity: - path exists - path is a directory - manifest exists - pairing between channel metadata and data, aka a raster for each header
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf_path
|
str | Path
|
path to the selected Product Folder |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if path corresponds to a valid Product Folder, else False |
delete_product_folder_content
Safely deleting a Product Folder on disk at the selected location.
Removing main constituents of a Product Folder based on ProductFolder input object. If more files than the essential ones are found inside the Product Folder directory, the whole directory is not removed and those files only are preserved. Quicklook files are not considered part of the ProductFolder structure, so they are always kept.
If there any files left in the folder after removing the main constituents, the manifest file is formatted to the default factory value and the folder is not deleted. Otherwise, if only the manifest file is left, it is removed along with the folder itself.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_folder
|
ProductFolder
|
Product Folder object corresponding to the Product Folder on disk to be removed |
required |
rename_product_folder
Rename a Product Folder keeping all files and properly renaming them.
Channel metadata are edited to replace the old Filename field with the new one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
current_folder
|
str | Path
|
current Product Folder, full path |
required |
new_folder
|
str | Path
|
desired Product Folder, full path |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if current folder does not exist or is not a directory |
Product Folder layout definition.
Attributes
__all__
module-attribute
__all__ = ['METADATA_EXTENSION', 'ProductFolderLayout', 'QuicklookExtension', 'RasterExtension']
Classes
ProductFolderLayout
Class that manages the whole product folder layout and file paths.
Attributes
Methods:
__init__
Product folder layout definition.
Build full paths to channel dependent raster files (with specified extension), metadata files (with default extension), quicklook files (with specified extension) and product folder related config file and overlay (.kmz) file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
path to the product folder |
required |
generate_manifest_path
staticmethod
get_config_path
get_overlay_path
Retrieve the overlay kmz archive full path.
Returns:
| Type | Description |
|---|---|
Path
|
path to the product folder's overlay file (.kmz archive). |
get_channel_metadata_path
get_channel_data_path
Retrieve the channel data full path for the given channel number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_id
|
int
|
channel number of choice |
required |
extension
|
RasterExtension
|
extension of raster data file in folder. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
full path to the channel's data file for the channel of choice |
get_channel_quicklook_path
Retrieve the channel quicklook full path for the given channel number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_id
|
int
|
channel number of choice |
required |
extension
|
QuicklookExtension
|
extension of quicklook image file in folder. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
full path to the channel's quicklook file for the channel of choice |
Product Folder manifest definition.
Attributes
Classes
Manifest
dataclass
Product folder manifest document dataclass.
Attributes
datafile_extension
class-attribute
instance-attribute
Methods:
__init__
__init__(version: str = _VERSION, description: str | None = None, datafile_extension: RasterExtension = '') -> None
write
from_file
staticmethod
Read manifest xml document from file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str | Path
|
path to the xml manifest file. |
required |
Returns:
| Type | Description |
|---|---|
Manifest
|
Manifest dataclass containing all the info from loaded file |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if the input file does not exist |
ValueError
|
if the raster extension found in the manifest is not valid |
Metadata
Aresys product metadata definition.
Attributes
Classes
MetaDataChannel
dataclass
MetaDataChannel class.
Attributes
elements
class-attribute
instance-attribute
sampling_constants
property
raster_info
property
dataset_info
property
state_vectors
property
attitude_info
property
acquisition_time_line
property
AcquisitionTimeLine.
Returns:
| Type | Description |
|---|---|
AcquisitionTimeLine
|
AcquisitionTimeLine metadata element. |
ground_corner_points
property
GroundCornerPoints.
Returns:
| Type | Description |
|---|---|
GroundCornerPoints
|
GroundCornerPoints metadata element. |
burst_info
property
doppler_centroid
property
DopplerCentroidVector.
Returns:
| Type | Description |
|---|---|
DopplerCentroidVector
|
DopplerCentroidVector metadata element. |
doppler_rate
property
tops_azimuth_modulation_rate
property
TopsAzimuthModulationRateVector.
Returns:
| Type | Description |
|---|---|
TopsAzimuthModulationRateVector
|
TopsAzimuthModulationRateVector metadata element. |
slant_to_ground
property
SlantToGroundVector.
Returns:
| Type | Description |
|---|---|
SlantToGroundVector
|
SlantToGroundVector metadata element. |
ground_to_slant
property
GroundToSlantVector.
Returns:
| Type | Description |
|---|---|
GroundToSlantVector
|
GroundToSlantVector metadata element. |
slant_to_incidence
property
SlantToIncidenceVector.
Returns:
| Type | Description |
|---|---|
SlantToIncidenceVector
|
SlantToIncidenceVector metadata element. |
slant_to_elevation
property
SlantToElevationVector.
Returns:
| Type | Description |
|---|---|
SlantToElevationVector
|
SlantToElevationVector metadata element. |
antenna_info
property
data_statistics
property
swath_info
property
coreg_poly
property
Methods:
__init__
__init__(content_id: str | None = None, number: int | None = None, total: int | None = None, elements: dict[MetaDataElementName, MetaDataPydanticModel] = dict()) -> None
__contains__
Overloaded method to check if the element is available in the metadata channel.
insert_element
Insert the specified metadata element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
MetaDataPydanticModel
|
metadata element to insert |
required |
overwrite_ok
|
bool
|
overwrite existing metadata element of the same type. False by default. |
False
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if the element is not supported in the current metadata channel |
RuntimeError
|
if the element is already present and overwrite_ok is False |
remove_element
Remove specified channel element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_type
|
MetaDataElementName
|
element name. |
required |
get_element
Channel metadata element from element name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_type
|
MetaDataElementName
|
element name. |
required |
Returns:
| Type | Description |
|---|---|
MetaDataPydanticModel
|
channel metadata element |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if element is not available in the current metadata channel |
trajectory
Create a CubicSplineTrajectory from the state vector data.
doppler_centroid_poly
Create a DopplerCentroidPoly from the doppler centroid metadata element.
doppler_rate_poly
Create a DopplerRatePoly from the doppler rate metadata element.
tops_azimuth_modulation_rate_poly
Create a TopsAzimuthModulationRatePoly from the tops azimuth rate metadata element.
ground_to_slant_poly
Create a GroundToSlantPoly from the ground to slant metadata element.
slant_to_ground_poly
Create a SlantToGroundPoly from the slant to ground metadata element.
slant_to_incidence_poly
Create a SlantToIncidencePoly from the slant to incidence metadata element.
slant_to_elevation_poly
Create a SlantToElevationPoly from the slant to elevation metadata element.
coregistration_poly
Create a CoregistrationPoly from the coreg_poly metadata element.
MetaData
dataclass
Metadata.
Attributes
channels
class-attribute
instance-attribute
sampling_constants
property
SamplingConstants from the first metadata channel.
Returns:
| Type | Description |
|---|---|
SamplingConstants
|
SamplingConstants metadata element from the first metadata channel. |
pulse
property
Pulse from the first metadata channel.
Returns:
| Type | Description |
|---|---|
Pulse
|
Pulse metadata element from the first metadata channel. |
raster_info
property
RasterInfo from the first metadata channel.
Returns:
| Type | Description |
|---|---|
RasterInfo
|
RasterInfo metadata element from the first metadata channel. |
dataset_info
property
DataSetInfo from the first metadata channel.
Returns:
| Type | Description |
|---|---|
DataSetInfo
|
DataSetInfo metadata element from the first metadata channel. |
state_vectors
property
StateVectors from the first metadata channel.
Returns:
| Type | Description |
|---|---|
StateVectors
|
StateVectors metadata element from the first metadata channel. |
attitude_info
property
AttitudeInfo from the first metadata channel.
Returns:
| Type | Description |
|---|---|
AttitudeInfo
|
AttitudeInfo metadata element from the first metadata channel. |
acquisition_time_line
property
AcquisitionTimeLine from the first metadata channel.
Returns:
| Type | Description |
|---|---|
AcquisitionTimeLine
|
AcquisitionTimeLine metadata element from the first metadata channel. |
ground_corner_points
property
GroundCornerPoints from the first metadata channel.
Returns:
| Type | Description |
|---|---|
GroundCornerPoints
|
GroundCornerPoints metadata element from the first metadata channel. |
burst_info
property
BurstInfo from the first metadata channel.
Returns:
| Type | Description |
|---|---|
BurstInfo
|
BurstInfo metadata element from the first metadata channel. |
doppler_centroid
property
DopplerCentroidVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
DopplerCentroidVector
|
DopplerCentroidVector metadata element from the first metadata channel. |
doppler_rate
property
DopplerRateVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
DopplerRateVector
|
DopplerRateVector metadata element from the first metadata channel. |
tops_azimuth_modulation_rate
property
TopsAzimuthModulationRateVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
TopsAzimuthModulationRateVector
|
TopsAzimuthModulationRateVector metadata element from the first metadata channel. |
slant_to_ground
property
SlantToGroundVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
SlantToGroundVector
|
SlantToGroundVector metadata element from the first metadata channel. |
ground_to_slant
property
GroundToSlantVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
GroundToSlantVector
|
GroundToSlantVector metadata element from the first metadata channel. |
slant_to_incidence
property
SlantToIncidenceVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
SlantToIncidenceVector
|
SlantToIncidenceVector metadata element from the first metadata channel. |
slant_to_elevation
property
SlantToElevationVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
SlantToElevationVector
|
SlantToElevationVector metadata element from the first metadata channel. |
antenna_info
property
AntennaInfo from the first metadata channel.
Returns:
| Type | Description |
|---|---|
AntennaInfo
|
AntennaInfo metadata element from the first metadata channel. |
data_statistics
property
DataStatistics from the first metadata channel.
Returns:
| Type | Description |
|---|---|
DataStatistics
|
DataStatistics metadata element from the first metadata channel. |
swath_info
property
SwathInfo from the first metadata channel.
Returns:
| Type | Description |
|---|---|
SwathInfo
|
SwathInfo metadata element from the first metadata channel. |
coreg_poly
property
CoregPolyVector from the first metadata channel.
Returns:
| Type | Description |
|---|---|
CoregPolyVector
|
CoregPolyVector metadata element from the first metadata channel. |
Methods:
__getitem__
Retrieve the metadata channel at the specified index.
__contains__
Overloaded method to check if the element is available in the metadata first channel.
insert_element
Insert a new metadata element into the first metadata channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element
|
MetaDataPydanticModel
|
metadata element to be inserted into the first metadata channel. |
required |
overwrite_ok
|
bool
|
overwrite existing metadata element of the same type. False by default. |
False
|
remove_element
Remove the specified metadata element from the first metadata channel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
element_type
|
MetaDataElementName
|
metadata element name to be removed from the first metadata channel. |
required |
trajectory
CubicSplineTrajectory from the first metadata channel.
Returns:
| Type | Description |
|---|---|
CubicSplineTrajectory
|
CubicSplineTrajectory metadata element from the first metadata channel. |
attitude
Attitude from the first metadata channel.
Returns:
| Type | Description |
|---|---|
Attitude
|
Attitude metadata element from the first metadata channel. |
doppler_centroid_poly
Create a PiecewisePolynomial2D from the first metadata channel's doppler centroid.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
doppler_rate_poly
Create a PiecewisePolynomial2D from the first metadata channel's doppler rate.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
tops_azimuth_modulation_rate_poly
Create a PiecewisePolynomial2D from the first metadata channel's tops azimuth mod rate.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
ground_to_slant_poly
Create a PiecewisePolynomial2D from the first metadata channel's ground to slant range.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
slant_to_ground_poly
Create a PiecewisePolynomial2D from the first metadata channel's slant to ground range.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
slant_to_incidence_poly
Create a PiecewisePolynomial2D from the first metadata channel's slant to incidence.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
slant_to_elevation_poly
Create a PiecewisePolynomial2D from the first metadata channel's slant to elevation.
Returns:
| Type | Description |
|---|---|
PiecewisePolynomial2D
|
PiecewisePolynomial2D metadata element from the first metadata channel. |
coregistration_poly
Create a CoregistrationPoly from the first metadata channel's coregistration.
Returns:
| Type | Description |
|---|---|
CoregistrationPoly
|
CoregistrationPoly metadata element from the first metadata channel. |
Functions:
create_new_metadata
create_new_metadata(num_metadata_channels: int = 1, description: str | None = None) -> MetaData
Create a new empty MetaData object with the selected number of channels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num_metadata_channels
|
int
|
number of metadata channels, by default 1 |
1
|
description
|
str | None
|
metadata description, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
MetaData
|
new empty MetaData object |
MetaData elements module.
Attributes
__all__
module-attribute
__all__ = ['METADATA_ELEMENT_NAMES', 'AcquisitionTimeLine', 'AntennaInfo', 'AntennaPolarization', 'AttitudeInfo', 'AttitudeReferenceFrame', 'AttitudeRotationOrder', 'AttitudeType', 'Burst', 'BurstInfo', 'CoregPoly', 'CoregPolyVector', 'DataBlockStatistic', 'DataSetImageQuantity', 'DataSetInfo', 'DataStatistics', 'DopplerCentroid', 'DopplerCentroidVector', 'DopplerRate', 'DopplerRateVector', 'GeoPoint', 'GroundCornerPoints', 'GroundToSlant', 'GroundToSlantVector', 'MetaDataElementName', 'OrbitDirection', 'Poly2D', 'Pulse', 'PulseDirection', 'RasterByteOrder', 'RasterCellType', 'RasterFormat', 'RasterInfo', 'SamplingConstants', 'SideLooking', 'SlantToElevation', 'SlantToElevationVector', 'SlantToGround', 'SlantToGroundVector', 'SlantToIncidence', 'SlantToIncidenceVector', 'StateVectors', 'SwathInfo', 'SwathPolarization', 'TopsAzimuthModulationRate', 'TopsAzimuthModulationRateVector']
RasterCellType
module-attribute
RasterCellType = Literal['INT8', 'INT16', 'INT32', 'FLOAT32', 'FLOAT64', 'INT8_COMPLEX', 'INT16_COMPLEX', 'INT_COMPLEX', 'FLOAT_COMPLEX', 'DOUBLE_COMPLEX', 'CUSTOM']
DataSetImageQuantity
module-attribute
AntennaPolarization
module-attribute
AttitudeReferenceFrame
module-attribute
AttitudeRotationOrder
module-attribute
MetaDataElementName
module-attribute
MetaDataElementName = Literal['RasterInfo', 'DataSetInfo', 'SwathInfo', 'SamplingConstants', 'AcquisitionTimeLine', 'BurstInfo', 'StateVectors', 'AttitudeInfo', 'Pulse', 'GroundCornerPoints', 'DopplerCentroidVector', 'DopplerRateVector', 'TopsAzimuthModulationRateVector', 'SlantToGroundVector', 'GroundToSlantVector', 'SlantToIncidenceVector', 'SlantToElevationVector', 'AntennaInfo', 'DataStatistics', 'CoregPolyVector']
METADATA_ELEMENT_NAMES
module-attribute
ReferenceAzimuthTimeT
module-attribute
Classes
MetaDataPydanticModel
Bases: BaseModel
Base Pydantic model for metadata elements.
RasterInfo
Bases: MetaDataPydanticModel
Raster metadata container based on Pydantic public fields.
Attributes
azimuth_axis
property
range_axis
property
lines_start_date
property
The start date of the lines.
Returns:
| Type | Description |
|---|---|
PreciseDateTime
|
The start date of the lines. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If the lines start is not a PreciseDateTime. |
samples_start_date
property
The start date of the samples.
Returns:
| Type | Description |
|---|---|
PreciseDateTime
|
The start date of the samples. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If the samples start is not a PreciseDateTime. |
DataSetInfo
Bases: MetaDataPydanticModel
Dataset metadata container based on Pydantic public fields.
Attributes
projection_params_format
class-attribute
instance-attribute
image_quantity
class-attribute
instance-attribute
processing_date
class-attribute
instance-attribute
external_calibration_factor
class-attribute
instance-attribute
GeoPoint
Bases: MetaDataPydanticModel
GeoPoint class.
GroundCornerPoints
Bases: MetaDataPydanticModel
GroundCornerPoint class.
Attributes
nw_point
class-attribute
instance-attribute
ne_point
class-attribute
instance-attribute
sw_point
class-attribute
instance-attribute
se_point
class-attribute
instance-attribute
center_point
class-attribute
instance-attribute
geo_points
property
Geo points as a list: [nw_point, ne_point, sw_point, se_point, center_point].
SwathInfo
Bases: MetaDataPydanticModel
SwathInfo class.
Attributes
azimuth_steering_angle_reference_time
class-attribute
instance-attribute
azimuth_steering_angle_pol
class-attribute
instance-attribute
azimuth_steering_rate_reference_time
class-attribute
instance-attribute
azimuth_steering_rate_pol
class-attribute
instance-attribute
SamplingConstants
Bases: MetaDataPydanticModel
SamplingConstants class.
AcquisitionTimeLine
Bases: MetaDataPydanticModel
AcquisitionTimeLine class.
Attributes
missing_lines
class-attribute
instance-attribute
swst_changes
class-attribute
instance-attribute
noise_packet
class-attribute
instance-attribute
internal_calibration
class-attribute
instance-attribute
swl_changes
class-attribute
instance-attribute
prf_changes
class-attribute
instance-attribute
duplicated_lines
class-attribute
instance-attribute
AttitudeInfo
Bases: MetaDataPydanticModel
AttitudeInfo class.
Attributes
times
property
The time axis of the attitude data.
Returns:
| Type | Description |
|---|---|
NDArray
|
The time axis of the attitude data. |
Burst
Bases: MetaDataPydanticModel
Single burst metadata.
BurstInfo
Bases: MetaDataPydanticModel
Burst info metadata container.
Attributes
burst_repetition_frequency
class-attribute
instance-attribute
lines_per_burst
property
The number of lines per burst if constant, raise otherwise.
model_config
class-attribute
instance-attribute
model_config = {'arbitrary_types_allowed': True, 'populate_by_name': True, 'validate_assignment': True}
Methods:
get_burst_roi
get_burst_roi(burst_index: int, raster_info: RasterInfo, range_interval: tuple[int, int] | None = None) -> list[int]
Get the region of interest for a specific burst.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
burst_index
|
int
|
Index of the burst to retrieve the ROI for. |
required |
raster_info
|
RasterInfo
|
Raster information for the product. |
required |
range_interval
|
tuple[int, int] | None
|
Range of interest in the format (start, end), by default None. |
None
|
Returns:
| Type | Description |
|---|---|
list[int]
|
The region of interest for the specified burst. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the burst index is not valid. |
StateVectors
Bases: MetaDataPydanticModel
State vectors metadata container.
Attributes
anx_position
class-attribute
instance-attribute
annotated_orbit_direction
property
writable
Annotated orbit direction.
Might be different from the orbit direction which is derived from velocity.
orbit_direction
property
Orbit direction inferred from the first velocity vector.
times
property
The time axis of the state vector data.
Returns:
| Type | Description |
|---|---|
NDArray
|
The time axis of the state vector data. |
model_config
class-attribute
instance-attribute
model_config = {'arbitrary_types_allowed': True, 'populate_by_name': True, 'validate_assignment': True}
Methods:
Poly2D
Bases: MetaDataPydanticModel, Generic[ReferenceAzimuthTimeT]
Base class for Poly2D format.
DopplerCentroid
Bases: Poly2D
DopplerCentroid class.
Attributes
UNITS
class-attribute
instance-attribute
UNITS = ('Hz', 'Hz/s', 'Hz/s', 'Hz/s2', 'Hz/s2', 'Hz/s3', 'Hz/s4', 'Hz/s5', 'Hz/s6', 'Hz/s7', 'Hz/s8')
DopplerCentroidVector
Bases: MetaDataPydanticModel
List of DopplerCentroid poly.
DopplerRate
Bases: Poly2D
DopplerRate class.
Attributes
UNITS
class-attribute
instance-attribute
UNITS = ('Hz/s', 'Hz/s2', 'Hz/s2', 'Hz/s3', 'Hz/s3', 'Hz/s4', 'Hz/s5', 'Hz/s6', 'Hz/s7', 'Hz/s8', 'Hz/s9')
DopplerRateVector
Bases: MetaDataPydanticModel
list of DopplerRate poly.
TopsAzimuthModulationRate
Bases: Poly2D
TopsAzimuthModulationRate class.
Attributes
UNITS
class-attribute
instance-attribute
UNITS = ('Hz', 'Hz/s', 'Hz/s', 'Hz/s2', 'Hz/s2', 'Hz/s3', 'Hz/s4', 'Hz/s5', 'Hz/s6', 'Hz/s7', 'Hz/s8')
TopsAzimuthModulationRateVector
Bases: MetaDataPydanticModel
List of TopsAzimuthModulationRate poly.
SlantToGround
Bases: Poly2D
SlantToGround class.
SlantToGroundVector
Bases: MetaDataPydanticModel
List of SlantToGround poly.
GroundToSlant
Bases: Poly2D
GroundToSlant class.
GroundToSlantVector
Bases: MetaDataPydanticModel
List of GroundToSlant poly.
SlantToIncidence
Bases: Poly2D
SlantToIncidence class.
Attributes
UNITS
class-attribute
instance-attribute
UNITS = ('deg', 'deg/s', 'deg/s', 'deg/s2', 'deg/s2', 'deg/s3', 'deg/s4', 'deg/s5', 'deg/s6', 'deg/s7', 'deg/s8')
SlantToIncidenceVector
Bases: MetaDataPydanticModel
List of SlantToIncidence poly.
SlantToElevation
Bases: Poly2D
SlantToElevation class.
Attributes
UNITS
class-attribute
instance-attribute
UNITS = ('deg', 'deg/s', 'deg/s', 'deg/s2', 'deg/s2', 'deg/s3', 'deg/s4', 'deg/s5', 'deg/s6', 'deg/s7', 'deg/s8')
SlantToElevationVector
Bases: MetaDataPydanticModel
List of SlantToElevation poly.
AntennaInfo
Bases: MetaDataPydanticModel
Antenna pattern metadata container.
DataBlockStatistic
Bases: MetaDataPydanticModel
Statistics computed over a data block.
DataStatistics
Bases: MetaDataPydanticModel
Statistics computed over full data.
CoregPoly
Bases: MetaDataPydanticModel
Coregistration polynomials metadata container.
CoregPolyVector
Bases: MetaDataPydanticModel
List of CoregPoly.
Pulse
Bases: MetaDataPydanticModel
Pulse class.
Metadata file IO.
Attributes
__all__
module-attribute
Functions:
read_metadata
write_metadata
serialize_metadata
Serialize metadata object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_obj
|
MetaData
|
Metadata representation object |
required |
Returns:
| Type | Description |
|---|---|
str
|
serialized metadata as a string (xml format) |
parse_metadata
Parse metadata XML string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_content
|
str
|
Metadata as string in XML format |
required |
Returns:
| Type | Description |
|---|---|
MetaData
|
Metadata representation object |
Input/output utilities using metadata objects.
Attributes
__all__
module-attribute
__all__ = ['MemmappedNDArray', 'read_binary_header_with_raster_info', 'read_raster_as_memmap_with_raster_info', 'read_raster_with_raster_info', 'read_row_prefix_with_raster_info', 'retrieve_data_layout', 'write_binary_header_with_raster_info', 'write_raster_with_raster_info', 'write_row_prefix_with_raster_info']
Classes
Functions:
retrieve_data_layout
Retrieve the data layout from a RasterInfo object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read |
required |
Returns:
| Type | Description |
|---|---|
DataLayout
|
Unified layout and format information for the raster |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the raster info cell type is 'custom', which is not supported for reading raster files |
read_raster_with_raster_info
read_raster_with_raster_info(raster_file: str | Path, raster_info: RasterInfo, block_to_read: list[int] | None = None) -> npt.NDArray
Read raster file using information from a RasterInfo metadata object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be read |
required |
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read |
required |
block_to_read
|
list[int] | None
|
data block to be read, to be specified as a list of 4 integers, in the form: 0. first line to be read 1. first sample to be read 2. total number of lines to be read 3. total number of samples to be read. if None, the whole raster is read, by default None |
None
|
Returns:
| Type | Description |
|---|---|
NDArray
|
numpy array containing the data read from raster file, with shape (lines, samples) |
read_raster_as_memmap_with_raster_info
read_raster_as_memmap_with_raster_info(raster_file: str | Path, raster_info: RasterInfo) -> Generator[MemmappedNDArray, None, None]
Create and manage the lifecycle of a read-only memmap to a raster file.
Usage
with read_raster_as_memmap_with_raster_info(...) as data_as_memmap: ...
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be read |
required |
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read |
required |
Yields:
| Type | Description |
|---|---|
MemmappedNDArray (alias to np.ndarray)
|
Memory-mapped numpy array containing raster data of shape (lines, samples) |
write_raster_with_raster_info
write_raster_with_raster_info(raster_file: str | Path, data: NDArray, raster_info: RasterInfo, write_offset: tuple[int, int] = (0, 0)) -> None
Write data to the specified raster file on disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be written |
required |
data
|
NDArray
|
data to be written |
required |
raster_info
|
RasterInfo
|
RasterInfo object containing all the info related to the raster of choice |
required |
write_offset
|
tuple[int, int]
|
start point from where to write (lines, samples), by default (0, 0). |
(0, 0)
|
read_binary_header_with_raster_info
read_binary_header_with_raster_info(raster_file: str | Path, raster_info: RasterInfo) -> bytes
Read raster binary header using information from a RasterInfo metadata object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be read |
required |
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read. |
required |
Returns:
| Type | Description |
|---|---|
bytes
|
header binary of the raster file |
write_binary_header_with_raster_info
write_binary_header_with_raster_info(raster_file: str | Path, header: bytes, raster_info: RasterInfo) -> None
Write raster binary header using information from a RasterInfo metadata object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be read |
required |
header
|
bytes
|
header to be written in bytes |
required |
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read. |
required |
read_row_prefix_with_raster_info
read_row_prefix_with_raster_info(raster_file: str | Path, line_interval: tuple[int, int], raster_info: RasterInfo) -> list[bytes]
Read the row prefix of a given line using information from a RasterInfo metadata object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be read |
required |
line_interval
|
tuple[int, int]
|
raster line interval as (start_line, end_line), with end excluded |
required |
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read. |
required |
Returns:
| Type | Description |
|---|---|
list[bytes]
|
row prefixes as byte sequences |
write_row_prefix_with_raster_info
write_row_prefix_with_raster_info(raster_file: str | Path, line_interval: tuple[int, int], row_prefix: list[bytes], raster_info: RasterInfo) -> None
Write the row prefix at a given line using information from a RasterInfo metadata object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
path to the raster file to be read |
required |
line_interval
|
tuple[int, int]
|
raster line interval as (start_line, end_line), with end excluded |
required |
row_prefix
|
list[bytes]
|
row prefixes as byte sequences, one for each line in interval |
required |
raster_info
|
RasterInfo
|
RasterInfo metadata corresponding to the raster to be read. |
required |