EOS-04
Reader Interface
EOS04 product format reader.
Classes
Functions:
read_product_metadata
read_product_metadata(xml_path: str | Path, channels: list[str]) -> dict[str, support.EOS04ChannelMetadata]
Reading EOS04 product channel metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xml_path
|
str | Path
|
path to the annotation xml file |
required |
channels
|
list[str]
|
channels ids for the current product |
required |
Returns:
| Type | Description |
|---|---|
dict[str, EOS04ChannelMetadata]
|
dictionary of EOS04ChannelMetadata dataclasses as values, channel name as key |
read_channel_data
read_channel_data(raster_file: str | Path, block_to_read: list[int] | None = None, scaling_conversion: float = 1) -> np.ndarray
Reading EOS04 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) |
Utilities
EOS04 reader support module.
Attributes
Classes
InvalidEOS04Product
Bases: RuntimeError
Invalid EOS04 Product
EOS04TimeOrdering
Bases: Enum
EOS04 available Time Ordering
EOS04AcquisitionMode
Bases: Enum
EOS04 Acquisition Modes
EOS04ProductType
Bases: Enum
EOS04 Product Types
EOS04Attitude
dataclass
EOS04 sensor's attitude
Attributes
Methods:
__init__
__init__(num: int, yaw: ndarray, pitch: ndarray, roll: ndarray, time_axis: ndarray, time_step: float) -> None
from_metadata_node
staticmethod
Generating EOS04Attitude object directly from metadata xml node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attitude_information_node
|
_Element
|
AttitudeInformation xml node |
required |
Returns:
| Type | Description |
|---|---|
EOS04Attitude
|
sensor's attitude dataclass |
EOS04GeneralChannelInfo
dataclass
EOS04 general channel info representation dataclass
Attributes
Methods:
__init__
__init__(channel_id: str, product_name: str, satellite: str, swath: str, acq_start_time: PreciseDateTime, product_type: EOS04ProductType, acquisition_mode: EOS04AcquisitionMode, acquisition_mode_std: StandardSARAcquisitionMode, polarization: SARPolarization, projection: SARProjection, orbit_direction: OrbitDirection) -> None
from_metadata_node
staticmethod
from_metadata_node(source_attributes_node: _Element, product_type: str, channel_id: str) -> EOS04GeneralChannelInfo
Generating EOS04GeneralChannelInfo object directly from metadata xml nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_attributes_node
|
_Element
|
SourceAttributes metadata xml node |
required |
product_type
|
str
|
product type |
required |
channel_id
|
str
|
channel id |
required |
Returns:
| Type | Description |
|---|---|
EOS04GeneralChannelInfo
|
general channel info dataclass |
EOS04ChannelMetadata
dataclass
EOS04 channel metadata xml file wrapper
Attributes
image_radiometric_quantity
instance-attribute
Methods:
__init__
__init__(channel_id: str, general_info: EOS04GeneralChannelInfo, orbit: Trajectory, attitude: EOS04Attitude, 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, doppler_rate_poly: DopplerEvaluator, pulse: PulseInfo, coordinate_conversions: CoordinatesConversions, state_vectors: StateVectors) -> None
EOS04FolderLayout
EOS04 file main directory architecture
Attributes
Methods:
__init__
Definition of internal architecture of a EOS04 product folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
path to the EOS04 product base folder |
required |
get_slant_range_grid_file
get_beam_raster_file
get_beam_raster_file(polarization: str | SARPolarization, beam: int, product_type: EOS04ProductType) -> Path
Retrieving the raster file for the selected polarization and beam number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polarization
|
str | SARPolarization
|
polarization value |
required |
beam
|
int
|
selected beam number |
required |
product_type
|
EOS04ProductType
|
product type |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to the beam raster file |
EOS04Product
EOS04 Product
Attributes
acquisition_time
property
Acquisition start time for this product
channels_number
property
Returning the number of channels for this product
channels_list
property
Returning the list of channels in terms of SwathID (beam-polarization)
footprint
property
Product footprint as tuple of (min lat, max lat, min lon, max lon)
Methods:
Functions:
compose_channel_name
unpack_channel_name
raster_info_from_metadata_nodes
raster_info_from_metadata_nodes(image_generation_parameters_node: _Element, image_attributes_node: _Element, beam_id: int, polarization: SARPolarization, product_type: EOS04ProductType) -> RasterInfo
Creating a RasterInfo metadata element from xml node.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
ImageGenerationParameters metadata xml node |
required |
image_attributes_node
|
_Element
|
ImageAttributes metadata xml node |
required |
beam_id
|
int
|
swath beam id |
required |
product_type
|
EOS04ProductType
|
product type |
required |
Returns:
| Type | Description |
|---|---|
RasterInfo
|
RasterInfo metadata object |
burst_info_from_metadata
burst_info_from_metadata(image_generation_parameters_node: _Element, polarization: SARPolarization, beam_id: int, raster_info: RasterInfo, product_type: EOS04ProductType) -> BurstInfo
Generating BurstInfo object directly from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
ImageGenerationParameters xml node |
required |
polarization
|
SARPolarization
|
product acquisition mode |
required |
beam_id
|
int
|
channel beam id |
required |
raster_info
|
RasterInfo
|
product RasterInfo |
required |
product_type
|
EOS04ProductType
|
product type |
required |
Returns:
| Type | Description |
|---|---|
BurstInfo
|
burst info dataclass |
dataset_info_from_metadata_node
dataset_info_from_metadata_node(source_attributes_node: _Element, projection: SARProjection) -> DatasetInfo
Creating a DatasetInfo metadata element from safe xml nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_attributes_node
|
_Element
|
SourceAttributes metadata xml node |
required |
projection
|
SARProjection
|
product projection |
required |
Returns:
| Type | Description |
|---|---|
DatasetInfo
|
DatasetInfo metadata object |
swath_info_from_metadata
swath_info_from_metadata(image_generation_parameters_node: _Element, polarization: SARPolarization, beam: int, product_type: EOS04ProductType) -> SwathInfo
Creating a SwathInfo metadata object from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
ImageGenerationParameters xml node |
required |
polarization
|
SARPolarization
|
product acquisition mode |
required |
beam
|
int
|
channel beam id |
required |
product_type
|
EOS04ProductType
|
product type |
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_information_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) -> 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 |
Returns:
| Type | Description |
|---|---|
SARSamplingFrequencies
|
SARSamplingFrequencies metadata object |
pulse_info_from_metadata_nodes
pulse_info_from_metadata_nodes(source_attributes_node: _Element, samples_step: float) -> PulseInfo
Creating a PulseInfo dataclass from xml nodes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_attributes_node
|
_Element
|
SourceAttributes metadata xml node |
required |
samples_step
|
float
|
raster info samples step |
required |
Returns:
| Type | Description |
|---|---|
PulseInfo
|
PulseInfo dataclass |
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
|
ImageGenerationParameters metadata xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
DopplerEvaluator
|
DopplerEvaluator dataclass for Doppler Centroid polynomial |
doppler_rate_poly_from_metadata_node
doppler_rate_poly_from_metadata_node(image_generation_parameters_node: _Element, raster_info: RasterInfo) -> DopplerEvaluator
Creating a DopplerEvaluator doppler rate vector polynomial wrapper from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image_generation_parameters_node
|
_Element
|
ImageGenerationParameters metadata xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
DopplerEvaluator
|
DopplerEvaluator dataclass for Doppler Rate 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
|
ImageGenerationParameters metadata xml node |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
Returns:
| Type | Description |
|---|---|
CoordinatesConversions
|
polynomial for coordinate conversion dataclass |
is_eos04_product
Check if input path corresponds to a valid EOS04 product, basic version.
Conditions to be met for basic validity: - path exists - path is a directory - metadata file exists - metadata basic info extraction works
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 |