pixcdust.converters.gpkg

Geopackage converters.

Classes

Nc2GpkgConverter

Converter from official SWOT Pixel Cloud Netcdf to a Geopackage database.

GpkgDGGSProjecter

Converter from a Gpkg pixelcloud to a Gpkg DGGS projection.

Zarr2GpkgConverter

Converter from Pixel Cloud zcollection to Geopackage database

Module Contents

class pixcdust.converters.gpkg.Nc2GpkgConverter(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: pixcdust.converters.core.ConverterWSE

Converter from official SWOT Pixel Cloud Netcdf to a Geopackage database.

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}, }

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.gpkg.GpkgDGGSProjecter[source]

Converter from a Gpkg pixelcloud to a Gpkg DGGS projection.

Attributes:

path: Gpkg pixelcloud to convert. dggs_res: resolotion of the dggs projection. conditions: Optional limits on points converted. healpix: Projection either in healpix or h3 grid, default to h3 (False). dggs_layer_pattern: Postfix of output layers. path_out: Output path of the convertion.

path: str[source]
dggs_res: int[source]
conditions: dict[str, dict[str, str | float]] | None = None[source]
healpix: bool = False[source]
dggs_layer_pattern: str = '_h3'[source]
path_out: str | None = None[source]
__post_init__() None[source]
compute_layers() None[source]

Convert to an H3 projection and write it as Gpkg in self.path_out

_compute_layer(gdf: geopandas.GeoDataFrame) geopandas.GeoDataFrame[source]

Convert to an H3 projection a single layer.

Args:

gdf: Layer to project.

Returns:

Converted layer.

class pixcdust.converters.gpkg.Zarr2GpkgConverter[source]

Converter from Pixel Cloud zcollection to Geopackage database Attributes:

path: Gpkg pixelcloud to convert.

path: str[source]
data: geopandas.GeoDataFrame = None[source]
__post_init__() None[source]
convert(path_out: str) None[source]

Convert and write to path_out.