pixcdust.converters.core¶
Interface used by all Pixcdust Converters.
Classes¶
Abstract class parent of pixcdust converters. |
|
Abstract class parent of pixcdust converters supporting water surface elevation computation. |
|
Class for adding H3 projections to databases |
Module Contents¶
- class pixcdust.converters.core.Converter(path_in: str | Iterable[str] | pathlib.Path | Iterable[pathlib.Path], variables: list[str] | None = None, area_of_interest: geopandas.GeoDataFrame | None = None, conditions: dict[str, dict[str, str | float]] | None = None)[source]¶
Abstract class parent of pixcdust converters.
They convert from official SWOT Pixel Cloud Netcdf to the supported format.
- Attributes:
path_in: List of path of files to convert. variables: Optionally only read these variables. area_of_interest: Optionally only read points in area_of_interest. conditions: Optionally pass conditions to filter variables. Example: { “sig0”:{‘operator’: “ge”, ‘threshold’: 20}, “classification”:{‘operator’: “ge”, ‘threshold’: 3}, }
- class pixcdust.converters.core.ConverterWSE(path_in: str | Iterable[str] | pathlib.Path | Iterable[pathlib.Path], variables: list[str] | None = None, area_of_interest: geopandas.GeoDataFrame | None = None, conditions: dict[str, dict[str, str | float]] | None = None)[source]¶
Bases:
ConverterAbstract class parent of pixcdust converters supporting water surface elevation computation.
They convert from official SWOT Pixel Cloud Netcdf to the supported format.
- Attributes:
path_in: List of path of files to convert. variables: Optionally only read these variables. area_of_interest: Optionally only read points in area_of_interest.
- abstract database_from_nc(path_out: str | pathlib.Path, mode: str = 'w', compute_wse: bool = True) None[source]¶
Convert the path_in files to path_out. Args:
path_out: Output path of the convertion. mode: Writing mode of the outpout. Must be ‘w’(write/append) or ‘o’(overwrite). compute_wse: toggle water surface elevation computation.
- class pixcdust.converters.core.GeoLayerH3Projecter[source]¶
Class for adding H3 projections to databases
- Attributes:
data: data getting projected resolution: Resolution
- filter_variable(conditions: dict[str, dict[str, str | float]]) None[source]¶
filters from xarray dataset based on operator and threshold on specific variables
- Args:
conditions (dict): specifies the filters. Example: { “sig0”:{‘operator’: “ge”, ‘threshold’: 20}, “classification”:{‘operator’: “ge”, ‘threshold’: 3}, }
- Raises:
IOError: if variable provided in conditions are not in self.data.columns ValueError: if ‘operator’ and ‘to’ keys are not in conditions AttributeError: if operator is not the function name of the operator module