io
Input product protocols
Input product extended protocol.
Attributes
ALECorrectionFunctionType
module-attribute
Classes
SCTInputProduct
Bases: QualityInputProduct, Protocol
SCT extended version of QualityInputProduct protocol
Inputs managers
Input/Output utilities.
Attributes
Classes
InvalidProductType
Bases: RuntimeError
Invalid input product type
Functions:
product_loader
product_loader(product_path: Path, external_orbit: Path | None = None, external_corrections_product: Path | None = None) -> tuple[SCTInputProduct, ALECorrectionFunctionType | None]
Load any supported product
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_path
|
Path
|
Path to the product to be loaded |
required |
external_orbit
|
Path | None
|
Path to external orbit file, if needed, by default None |
None
|
external_corrections_product
|
Path | None
|
Path to external ALE corrections product, if needed, by default None |
None
|
Returns:
| Type | Description |
|---|---|
SCTInputProduct
|
SCTInputProduct compliant object |
ALECorrectionFunctionType | None
|
range and azimuth ale corrections function (if available) |
Point Target and Calibration Sites utilities.
Attributes
Classes
UnsupportedPointTargetSource
Bases: RuntimeError
External point target source provided is not supported
Functions:
extract_point_target_data_from_source
Managing external point target data source based on its type, unifying the output to the SCT standard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
str | Path
|
Path to the external source of point target files |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pandas dataframe corresponding to the input point target file |
read_csv_point_targets_file
Reading the input .csv file containing Point Target locations and info and converting it to a Pandas DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
Path
|
path to the .csv file |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Point Targets DataFrame |
read_geojson_point_targets_file
read_geojson_point_targets_file(surveys: Path, product_date: PreciseDateTime | None = None) -> pd.DataFrame
Reading the input .geojson file containing Point Target locations and info and converting it to Pandas DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
surveys
|
Path
|
path to the surveys .json file |
required |
product_date
|
PreciseDateTime | None
|
product acquisition date, this date is needed to select the proper survey data in case several surveys are available, if None, the latest survey is selected, by default None |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Point Targets DataFrame |
convert_df_to_nominal_point_target
Convert dataframe to dictionary of NominalPointTarget values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_df
|
DataFrame
|
point target dataframe |
required |
Returns:
| Type | Description |
|---|---|
list[PointTarget]
|
list of Point Target objects |
convert_rosamond_file_to_compliant_csv
convert_rosamond_file_to_compliant_csv(df: str | Path | DataFrame, measurement_date: PreciseDateTime) -> pd.DataFrame
Formatting downloaded Rosamond Point Target Dataset to be compliant with the SCT input .csv format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
str | Path | DataFrame
|
downloaded Rosamond Point Target dataset, can be a path to the .csv file or the corresponding pandas dataframe |
required |
measurement_date
|
PreciseDateTime
|
measurement date of the current dataset |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
SCT compliant Rosamond dataframe |
Antenna Pattern Data reader for the supported antenna pattern data model.
Functions:
read_antenna_pattern_netcdf
Reading Antenna Pattern data from NetCDF file and returning a dictionary containing the content divided by swath and polarization.
Hierarchy:
root/
└── swath
└── direction (e.g. `TW`)
└──polarization (e.g. `HH`, `VV`)
├── gain (in dB)
├── phase (optional, in rad)
├── azimuth_angles (in deg)
└── elevation_angles (in deg)
Supported Products
Only Two Way Antenna Patterns are supported, so only one direction group is expected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to the NetCDF file containing the antenna pattern data. The structure of the file must adhere to the following structure: |
required |
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, Dataset]]
|
nested dictionary containing the antenna pattern data divided by swath and polarization |