STRIX
Reader Interface
Synspective StriX L1 product format reader.
Attributes
Classes
Functions:
read_channel_metadata
Reading channel metadata info and storing them in a StriXChannelMetadata dataclass.
The assumption here is that .xml files are associated ONLY to GRD (GeoTiFF raster file), as reported in the official documentation, while NITF file is SLC only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
Path | str
|
Path to the metadata file, could be an .xml (GRD) or a .nitf file (SLC) |
required |
channel_id
|
str
|
channel id |
required |
Returns:
| Type | Description |
|---|---|
StriXChannelMetadata
|
StriXChannelMetadata metadata dataclass |
read_channel_data
read_channel_data(raster_file: str | Path, raster_info: RasterInfo, orbit_direction: OrbitDirection, looking_side: LookingDirection, block_to_read: list[int] = None, scaling_conversion: float = 1) -> np.ndarray
Reading StriX data file. It can be a GeoTiff .tif file (for GRD products) or an NITF .nitf file (for SLC).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raster_file
|
str | Path
|
Path to .tif or .nitf file |
required |
raster_info
|
RasterInfo
|
channel raster info |
required |
orbit_direction
|
OrbitDirection
|
orbit direction |
required |
looking_side
|
LookingDirection
|
looking side |
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 applied to the data read |
1
|
Returns:
| Type | Description |
|---|---|
ndarray
|
numpy array containing the data read from raster file, with shape (lines, samples) |
Utilities
Synspective StriX reader support module.
Attributes
regex_collection
module-attribute
regex_collection = {'acquisition_mode': re.compile('(?<=<eop:operationalMode>).*(?=</eop:operationalMode>)'), 'polarization': re.compile('(?<=<sar:polarisationChannels>).*(?=</sar:polarisationChannels>)'), 'footprint': re.compile('(?<=<gml:posList>).*(?=</gml:posList>)'), 'lines': re.compile('(?<=<eop:numberOfLine>).*(?=</eop:numberOfLine>)'), 'samples': re.compile('(?<=<eop:numberOfPixel>).*(?=</eop:numberOfPixel>)'), 'samples_step': re.compile('(?<=<sar:rangePixelSpacing>).*(?=</sar:rangePixelSpacing>)'), 'azimuth_step': re.compile('(?<=<sar:azimuthPixelSpacing>).*(?=</sar:azimuthPixelSpacing>)'), 'orbit_direction': re.compile('(?<=<eop:orbitDirection>).*(?=</eop:orbitDirection>)'), 'signal_frequency': re.compile('(?<=<sar:carrierFrequency>).*(?=</sar:carrierFrequency>)'), 'range_sampling_frequency': re.compile('(?<=<sar:rangeSamplingFrequency>).*(?=</sar:rangeSamplingFrequency>)'), 'range_bandwidth': re.compile('(?<=<sar:chirpBandWidth>).*(?=</sar:chirpBandWidth>)'), 'look_side': re.compile('(?<=<sar:antennaLookDirection>).*(?=</sar:antennaLookDirection>)'), 'sensor': re.compile('(?<=<eop:shortName>).*(?=</eop:shortName>)'), 'sensor_id': re.compile('(?<=<eop:serialIdentifier>).*(?=</eop:serialIdentifier>)'), 'sv_num': re.compile('(?<=<numStateVectors>).*(?=</numStateVectors>)'), 'sv_time_utc': re.compile('(?<=<timeUTC>).*(?=</timeUTC>)'), 'sv_pos_x': re.compile('(?<=<posX>).*(?=</posX>)'), 'sv_pos_y': re.compile('(?<=<posY>).*(?=</posY>)'), 'sv_pos_z': re.compile('(?<=<posZ>).*(?=</posZ>)'), 'sv_vel_x': re.compile('(?<=<velX>).*(?=</velX>)'), 'sv_vel_y': re.compile('(?<=<velY>).*(?=</velY>)'), 'sv_vel_z': re.compile('(?<=<velZ>).*(?=</velZ>)'), 'local_value': re.compile('(?<=<eop:localValue>).*(?=</eop:localValue>)'), 'calibration_factor': re.compile('<eop:localAttribute>calibrationFactor</eop:localAttribute>'), 'acquisition_mid_center_time': re.compile('<eop:localAttribute>sceneCenterDateTime</eop:localAttribute>')}
Classes
InvalidStriXProduct
Bases: RuntimeError
Invalid StriX product
StriXProcessingLevel
Bases: Enum
StriX L1 processing level
StriXOperationalModes
Bases: Enum
StriX Acquisition Modes
StriXGeneralChannelInfo
dataclass
StriX general channel info dataclass
Attributes
orbit_direction
class-attribute
instance-attribute
Methods:
__init__
__init__(product_name: str, channel_id: str, swath: str, processing_level: StriXProcessingLevel, polarization: SARPolarization, projection: SARProjection, acquisition_mode: StriXOperationalModes, acquisition_mode_std: StandardSARAcquisitionMode, signal_frequency: float, acq_start_time: PreciseDateTime, acq_stop_time: PreciseDateTime, orbit_direction: OrbitDirection | None = None) -> None
from_metadata
classmethod
from_metadata(root: str | SICDType, product_name: str, channel_id: str) -> StriXGeneralChannelInfo
Generating StriXGeneralChannelInfo object directly from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
xml metadata file content as string or SICDType object |
required |
product_name
|
str
|
product name |
required |
channel_id
|
str
|
channel id |
required |
Returns:
| Type | Description |
|---|---|
StriXGeneralChannelInfo
|
general channel info dataclass |
StriXChannelMetadata
dataclass
StriX channel metadata dataclass
Attributes
image_radiometric_quantity
instance-attribute
Methods:
__init__
__init__(general_info: StriXGeneralChannelInfo, orbit: Trajectory, 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 | None, doppler_rate_poly: DopplerEvaluator | None, coordinate_conversions: CoordinatesConversions, state_vectors: StateVectors) -> None
StriXProduct
StriX product object
Attributes
acquisition_time
property
Acquisition start time for this product
channels_number
property
Returning the number of channels of StriX product
footprint
property
Product footprint as tuple of (min lat, max lat, min lon, max lon)
Methods:
__init__
get_files_from_channel_name
Get files associated to a given channel name.
GRD channels will return a list of two paths: .xml metadata file, .tif GeoTiff raster file
SLC channels will return a list of a single path: .nitf NITF file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
channel_name
|
str
|
channel id name |
required |
Returns:
| Type | Description |
|---|---|
list[Path] | Path
|
path to grd metadata and raster file, or path to slc file |
Functions:
get_basic_info_from_metadata
get_basic_info_from_metadata(root: str | SICDType) -> tuple[StriXOperationalModes, PreciseDateTime, PreciseDateTime, PreciseDateTime, SARPolarization, tuple[float, float, float, float]]
Get the product acquisition mode, acquisition start time, polarization and footprint from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object, string file content or SICDType object |
required |
Returns:
| Type | Description |
|---|---|
StriXOperationalModes
|
Strix acquisition mode |
PreciseDateTime
|
acquisition start time |
PreciseDateTime
|
acquisition mid center time |
PreciseDateTime
|
acquisition stop time |
SARPolarization
|
product polarization |
tuple[float, float, float, float]
|
product footprint |
raster_info_from_metadata
Creating a RasterInfo metadata object from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object, string file content or SICDType object |
required |
orbit
|
Trajectory
|
sensor orbit |
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
Creating a DatasetInfo metadata object from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object, string file content or SICDType object |
required |
Returns:
| Type | Description |
|---|---|
DatasetInfo
|
DatasetInfo metadata object |
state_vectors_from_metadata
Generating StateVectors object directly from product metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object, string file content or SICDType object |
required |
Returns:
| Type | Description |
|---|---|
StateVectors
|
orbit's state vectors dataclass |
sampling_constants_from_metadata
sampling_constants_from_metadata(root: str | SICDType, lines_step: float) -> SARSamplingFrequencies
Creating a SARSamplingFrequencies metadata object from metadata file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object, string file content or SICDType object |
required |
lines_step
|
float
|
azimuth lines step |
required |
Returns:
| Type | Description |
|---|---|
SARSamplingFrequencies
|
SARSamplingFrequencies metadata object |
doppler_centroid_poly_from_metadata_node
doppler_centroid_poly_from_metadata_node(root: str | SICDType, raster_info: RasterInfo) -> DopplerEvaluator | None
Creating a DopplerEvaluator doppler centroid polynomial wrapper from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object |
required |
raster_info
|
RasterInfo
|
channel raster info |
required |
Returns:
| Type | Description |
|---|---|
DopplerEvaluator | None
|
DopplerEvaluator dataclass for Doppler Centroid polynomial |
doppler_rate_poly_from_metadata
doppler_rate_poly_from_metadata(root: str | SICDType, raster_info: RasterInfo, orbit: Trajectory) -> DopplerEvaluator | None
Creating a DopplerEvaluator doppler rate vector polynomial wrapper from metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object |
required |
raster_info
|
RasterInfo
|
channel raster info |
required |
orbit
|
Trajectory
|
sensor orbit |
required |
Returns:
| Type | Description |
|---|---|
DopplerEvaluator | None
|
DopplerEvaluator dataclass for Doppler Rate polynomial, if any else None |
get_calibration_factor_and_quantity_from_metadata
coordinates_conversions_from_metadata
coordinates_conversions_from_metadata(root: str | SICDType, raster_info: RasterInfo, orbit: Trajectory) -> 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 |
|---|---|---|---|
root
|
str | SICDType
|
metadata root object, string file content or SICDType object |
required |
raster_info
|
RasterInfo
|
product raster info |
required |
orbit
|
Trajectory
|
sensor orbit |
required |
Returns:
| Type | Description |
|---|---|
CoordinatesConversions
|
polynomial for coordinate conversion dataclass |
is_strix_product
Check if input path corresponds to a valid StriX product, basic version.
Conditions to be met for basic validity: - path exists - path is a file - metadata can be found (GRD) - metadata can be read (GRD, SLC)
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 |