NovaSAR-1
Reader Interface
NOVASAR-1 product format reader.
Classes
Functions:
read_product_metadata
Read NovaSAR-1 product metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml_path
|
str | Path
|
Path to the .xml metadata file |
required |
Returns:
| Type | Description |
|---|---|
dict[str, NovaSAR1ChannelMetadata]
|
dictionary with channel id as keys and NovaSAR1ChannelMetadata dataclass as values |
read_channel_data
read_channel_data(raster_file: str | Path, block_to_read: list[int] | None = None, scaling_conversion: float = 1) -> np.ndarray
Reading NovaSAR-1 tif channel data file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
Path to .tif raster file 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: Text Only
if None, the whole raster is read, by default None |
None
|
scaling_conversion
|
float
|
scaling conversion to be multiplied to the data read |
1
|
Returns:
| Type | Description |
|---|---|
ndarray
|
numpy array containing the data read from raster file, with shape (lines, samples) |
open_product
Utilities
NOVASAR-1 reader support module.
Classes
InvalidNovaSAR1Product
Bases: RuntimeError
Invalid NovaSAR-1 product
NovaSAR1ProductType
Bases: Enum
NovaSAR-1 L1 product types
NovaSAR1AcquisitionModes
Bases: Enum
NovaSAR-1 L1 acquisition modes
NovaSAR1ReferenceFrameType
Bases: Enum
NovaSAR-1 available reference frames
NovaSAR1TimeOrdering
Bases: Enum
NovaSAR-1 available Time Ordering
NovaSAR1Attitude
dataclass
NovaSAR-1 sensor's attitude
Attributes
Methods:
__init__
__init__(num: int, frame: NovaSAR1ReferenceFrameType, yaw: ndarray, pitch: ndarray, roll: ndarray, time_axis: ndarray, time_step: float) -> None
from_metadata_node
staticmethod
from_metadata_node(orbit_data_node: _Element, image_gen_params_node: _Element) -> NovaSAR1Attitude
Generating NovaSAR1Attitude object directly from metadata xml node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orbit_data_node
|
_Element
|
OrbitData xml node |
required |
image_gen_params_node
|
_Element
|
Image_Generation_Parameters metadata xml node |
required |
Returns:
| Type | Description |
|---|---|
NovaSAR1Attitude
|
sensor's attitude dataclass |
NovaSAR1IncidenceAnglePolynomial
dataclass
NovaSAR-1 Incidence Angle Polynomial
Attributes
incidence_angles
class-attribute
instance-attribute
azimuth_reference_times
class-attribute
instance-attribute
Methods:
__init__
__init__(incidence_angles: list[ConversionFunction] | None = None, azimuth_reference_times: ndarray | None = None) -> None
from_metadata_node
staticmethod
from_metadata_node(image_generation_parameters_node: _Element, raster_info: RasterInfo) -> NovaSAR1IncidenceAnglePolynomial
Generating NovaSAR1IncidenceAnglePolynomial object directly from metadata xml node.
About coefficients annotated in metadata:
Polynomial coefficients for incidence angle at pixel position. Fixed along all image slices. Defined with respect to (angles in deg)/(pixel no.)^n where first pixel in line is 0.
Values output in order A0, A1, ..., An, in order of increasing degree. Polynomial to be evaluated is: A_0+ A_1 x + ... + A_n x^n where x is pixel number in the line, starting from 0.
Evaluated polynomial gives Incidence Angle in deg.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
Image_Generation_Parameters metadata xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
NovaSAR1IncidenceAnglePolynomial
|
polynomial for incidence angle computation |
evaluate_incidence_angle
Compute incidence angle at given time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
azimuth_time
|
PreciseDateTime
|
azimuth time to select the proper polynomial to be used for conversion |
required |
range_pixels
|
ArrayLike
|
range pixel index |
required |
Returns:
| Type | Description |
|---|---|
float
|
incidence angle in degrees |
NovaSAR1GeneralChannelInfo
dataclass
NovaSAR-1 general channel info representation dataclass
Attributes
Methods:
__init__
__init__(product_name: str, product_id: int, channel_id: str, swath: str, satellite: str, acq_start_time: PreciseDateTime, product_type: NovaSAR1ProductType, acquisition_mode: NovaSAR1AcquisitionModes, acquisition_mode_std: StandardSARAcquisitionMode, polarization: SARPolarization, projection: SARProjection, orbit_direction: OrbitDirection) -> None
from_metadata_node
staticmethod
from_metadata_node(product_node: _Element, source_attributes_node: _Element, orbit_data_node: _Element, prod_type: NovaSAR1ProductType, channel_id: str) -> NovaSAR1GeneralChannelInfo
Generating S1GeneralChannelInfo object directly from metadata xml nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_node
|
_Element
|
Product metadata xml node |
required |
source_attributes_node
|
_Element
|
Source_Attributes metadata xml node |
required |
orbit_data_node
|
_Element
|
OrbitData metadata xml node |
required |
prod_type
|
NovaSAR1ProductTypes
|
product type |
required |
channel_id
|
str
|
channel id |
required |
Returns:
| Type | Description |
|---|---|
NovaSAR1GeneralChannelInfo
|
general channel info dataclass |
NovaSAR1ChannelMetadata
dataclass
NovaSAR-1 channel metadata xml file wrapper
Attributes
image_radiometric_quantity
instance-attribute
incidence_angles_poly
instance-attribute
Methods:
__init__
__init__(general_info: NovaSAR1GeneralChannelInfo, orbit: Trajectory, attitude: NovaSAR1Attitude, image_calibration_factor: float, image_radiometric_quantity: SARRadiometricQuantity, burst_info: BurstInfo, raster_info: RasterInfo, dataset_info: DatasetInfo, swath_info: SwathInfo, sampling_constants: SARSamplingFrequencies, doppler_centroid_poly: DopplerEvaluator, incidence_angles_poly: NovaSAR1IncidenceAnglePolynomial, pulse: PulseInfo, coordinate_conversions: CoordinatesConversions, state_vectors: StateVectors) -> None
NovaSAR1Product
NovaSAR-1 product object
Attributes
acquisition_time
property
Acquisition start time for this product
data_list
property
Returning the list of raster data files of NovaSAR product
metadata_file
property
Returning the product metadata file path of NovaSAR product
channels_number
property
Returning the number of channels of NovaSAR product
channels_list
property
Returning the list of channels in terms of SwathID (swath-polarization)
footprint
property
Product footprint as tuple of (min lat, max lat, min lon, max lon)
Methods:
__init__
Functions:
get_basic_info_from_metadata
get_basic_info_from_metadata(metadata_path: str | Path) -> tuple[PreciseDateTime, NovaSAR1ProductType, list[str], tuple[float, float, float, float]]
Recovering acquisition time and list of channels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metadata_path
|
str | Path
|
Path to NovaSAR-1 metadata file |
required |
Returns:
| Type | Description |
|---|---|
tuple[PreciseDateTime, NovaSAR1ProductTypes, list[str]]
|
acquisition time in PreciseDateTime format, product type, list of channels ids, scene footprint [min lat, max lat, min lon, max lon] |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
if acquisition mode is not stripmap nor scansar |
get_acquisition_mode_from_product_type
get_acquisition_mode_from_product_type(prod_type: NovaSAR1ProductType) -> NovaSAR1AcquisitionModes
Get product acquisition mode from product type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prod_type
|
NovaSAR1ProductTypes
|
product type |
required |
Returns:
| Type | Description |
|---|---|
NovaSAR1AcquisitionModes
|
product acquisition mode |
get_projection_from_product_type
Get product projection from product type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prod_type
|
NovaSAR1ProductTypes
|
product type |
required |
Returns:
| Type | Description |
|---|---|
SARProjection
|
product projection |
raster_info_from_metadata_nodes
raster_info_from_metadata_nodes(image_generation_parameters_node: _Element, image_attributes_node: _Element, product_type: NovaSAR1ProductType) -> RasterInfo
Creating a RasterInfo metadata element from xml node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
Image_Generation_Parameters metadata xml node |
required |
image_attributes_node
|
_Element
|
Image_Attributes metadata xml node |
required |
product_type
|
NovaSAR1ProductTypes
|
product type |
required |
Returns:
| Type | Description |
|---|---|
RasterInfo
|
RasterInfo metadata object |
burst_info_from_metadata
Generating BurstInfo object directly from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
BurstInfo
|
burst info dataclass |
dataset_info_from_metadata_node
dataset_info_from_metadata_node(source_attributes_node: _Element, prod_type: NovaSAR1ProductType) -> DatasetInfo
Creating a DatasetInfo metadata element from safe xml nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_attributes_node
|
_Element
|
Source_Attributes metadata xml node |
required |
prod_type
|
NovaSAR1ProductTypes
|
product type |
required |
Returns:
| Type | Description |
|---|---|
DatasetInfo
|
DatasetInfo metadata object |
swath_info_from_metadata
swath_info_from_metadata(source_attributes_node: _Element, acq_mode: NovaSAR1AcquisitionModes) -> SwathInfo
Creating a SwathInfo metadata object from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_attributes_node
|
_Element
|
Source_Attributes xml node |
required |
acq_mode
|
_Element
|
product acquisition mode |
required |
Returns:
| Type | Description |
|---|---|
SwathInfo
|
SwathInfo metadata object |
state_vectors_from_metadata
Generating StateVectors object directly from product metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orbit_data_node
|
_Element
|
OrbitInformation xml node |
required |
Returns:
| Type | Description |
|---|---|
StateVectors
|
orbit's state vectors dataclass |
sampling_constants_from_metadata
sampling_constants_from_metadata(image_generation_parameters_node: _Element, raster_info: RasterInfo, product_type: NovaSAR1ProductType) -> SARSamplingFrequencies
Creating a SARSamplingFrequencies metadata object from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
ImageGenerationParameters xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
product_type
|
NovaSAR1ProductType
|
product type |
required |
Returns:
| Type | Description |
|---|---|
SARSamplingFrequencies
|
SARSamplingFrequencies metadata object |
pulse_info_from_metadata_nodes
pulse_info_from_metadata_nodes(image_generation_parameters_node: _Element, source_attributes_node: _Element, samples_step: float) -> PulseInfo
Creating a PulseInfo dataclass from xml nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
Image_Generation_Parameters metadata xml node |
required |
source_attributes_node
|
_Element
|
Source_Attributes metadata xml node |
required |
samples_step
|
float
|
raster info samples step |
required |
Returns:
| Type | Description |
|---|---|
PulseInfo
|
PulseInfo dataclass |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
unsupported chirp direction |
doppler_centroid_poly_from_metadata_node
doppler_centroid_poly_from_metadata_node(image_generation_parameters_node: _Element, raster_info: RasterInfo) -> DopplerEvaluator
Creating a DopplerEvaluator doppler centroid polynomial wrapper from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
Image_Generation_Parameters metadata xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
DopplerEvaluator
|
DopplerEvaluator dataclass for Doppler Centroid polynomial |
coordinates_conversions_from_metadata
coordinates_conversions_from_metadata(image_generation_parameters_node: _Element, raster_info: RasterInfo) -> CoordinatesConversions
Generating CoordinatesConversions object from metadata.
About coefficients annotated in metadata:
Coefficients of polynomial fit to the "Ground to Slant Range" transform applied. Fixed along all image slices. Defined with respect to (slant range in m)/(pixel no.)^n where first pixel in line is 0.
Values output in order A0, A1, ..., An, in order of increasing degree. Polynomial to be evaluated is: A_0+ A_1 x + ... + A_n x^n where x is pixel number in the line, starting from 0.
Evaluated polynomial gives Slant Range in meters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
Image_Generation_Parameters metadata xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
CoordinatesConversions
|
polynomial for coordinate conversion dataclass |
is_novasar_1_product
Check if input path corresponds to a valid NovaSAR-1 product, basic version.
Conditions to be met for basic validity: - path exists - path is a directory - metadata file exists - basic info from metadata file can be read
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product
|
str | Path
|
path to the product to be checked |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if it is a valid product, else False |