pycequeau.core package

Core module.

class pycequeau.core.CopernicusDEMProcessor(project_path: str, extent: list | tuple)[source]

Bases: object

_summary_

classmethod basic_dem_condition(in_dem: str, in_wbm: str)[source]

_summary_

Returns:

_description_

Return type:

_type_

download_and_merge()[source]

_summary_

Returns:

_description_

Return type:

_type_

property project_extent

project_extent getter

pycequeau.core.GetExtent(raster: Dataset)[source]

Return list of corner coordinates from a gdal Dataset

class pycequeau.core.UnitHandler[source]

Bases: object

Convert meteorological variables to their canonical units.

classmethod convert_array_to_canonical_units(values: np.ndarray | xr.DataArray, source_unit: str, spec: VariableSpec) np.ndarray | xr.DataArray[source]
classmethod convert_dataarray_to_canonical_units(data_array: xr.DataArray, spec: VariableSpec) xr.DataArray[source]
classmethod convert_temperature_to_celsius(values: ndarray | DataArray, source_unit: str) ndarray | DataArray[source]
classmethod convert_vapor_pressure_to_mmhg(values: ndarray | DataArray, source_unit: str) ndarray | DataArray[source]
classmethod normalize_unit_text(unit: str) str[source]
pycequeau.core.clip_netcdf(nc_files_path: str, bounds: list, output_path: str)[source]

_summary_

Parameters:
  • nc_files_path (str) – _description_

  • bounds (list) – _description_

  • output_path (str) – _description_

pycequeau.core.dataframe_to_struct_array(df: DataFrame) ndarray[source]

Convert DataFrame to MATLAB struct-array layout (1xN struct).

pycequeau.core.fix_calendar(ds: Dataset)[source]
pycequeau.core.fix_geometry(gdf: GeoDataFrame) GeoDataFrame[source]

_summary_ https://gis.stackexchange.com/questions/430384/using-shapely-methods-explain-validity-and-make-valid-on-shapefile :param gdf: _description_ :type gdf: gpd.GeoDataFrame

Returns:

_description_

Return type:

gpd.GeoDataFrame

pycequeau.core.get_altitude_point(DEM: Dataset, lat_utm: array, lon_utm: array)[source]

_summary_

Parameters:
  • DEM (gdal.Dataset) – _description_

  • lat_utm (np.array) – _description_

  • lon_utm (np.array) – _description_

Returns:

_description_

Return type:

_type_

pycequeau.core.get_index_list(raster: Dataset, x: ndarray, y: ndarray) tuple[source]

_summary_

Parameters:
  • raster (gdal.Dataset) – _description_

  • x (np.ndarray) – _description_

  • y (np.ndarray) – _description_

Returns:

_description_

Return type:

tuple

pycequeau.core.intermidiate_interpolation(ds: Dataset, scale: int)[source]
pycequeau.core.mat_field_value(value)[source]

Normalize a single table value to MATLAB-friendly field content.

pycequeau.core.mat_to_py(value)[source]

Recursively convert scipy.loadmat objects into plain Python containers.

pycequeau.core.polygonize_raster(raster_name: str)[source]

_summary_

Parameters:

raster_name (str) – _description_

Returns:

NoData value from the input raster first band.

Return type:

_type_

pycequeau.core.rasterize_feature(gdf: GeoDataFrame, raster_name: str, att: str) ndarray[source]

_summary_

Parameters:
  • gdf (gpd.GeoDataFrame) – _description_

  • raster_name (str) – _description_

  • att (str) – _description_

Returns:

_description_

Return type:

np.ndarray

pycequeau.core.rasterize_shp(grid_shp: str, ref_name: str, field: str) ndarray[source]

_summary_

Parameters:
  • grid_shp (str) – _description_

  • ref_name (str) – _description_

  • field (str) – _description_

Returns:

_description_

Return type:

np.ndarray

pycequeau.core.rasterize_shp_as_byte(grid_shp: str, ref_name: str, field: str, name: str) None[source]

_summary_

Parameters:
  • grid_shp (str) – _description_

  • ref_name (str) – _description_

  • field (str) – _description_

  • name (str) – _description_

Returns:

_description_

Return type:

_type_

pycequeau.core.regrid_CE(raster: Dataset, shp: Dataset, grid_size: int) Dataset[source]

_summary_

Parameters:
  • raster (gdal.Dataset) – _description_

  • shp (ogr.DataSource) – _description_

  • grid_size (int) – _description_

Returns:

_description_

Return type:

gdal.Dataset

pycequeau.core.to_mat_compatible(value)[source]

Recursively convert Python containers to scipy.savemat-compatible values.

Submodules