hydromodpy.core.io.crs#

CRS helpers built on pyproj and rasterio.

Centralises coordinate transforms, UTM detection, and polygon-based filtering so downstream modules never have to reach into pyproj directly. The PROJ database bootstrap that used to live inline in hydromodpy/__init__.py is planned to migrate here in a later phase.

Functions

convert_units(df, var_key)

Apply unit conversions for precipitation, temperature, radiation.

filter_coordinates_by_shape(coordinates, ...)

Keep only coordinates that fall within the shapefile polygon.

get_centroid_coordinates(gdf)

Return (lon, lat) centroid of the first geometry in gdf.

reproject_coord(x_wgs, y_wgs)

Reproject WGS-84 coordinates to the local UTM zone.

reproject_shp(raw_shp_path, out_shp_path, ...)

Reproject a shapefile to utm_crs (e.g. 'EPSG:2154').

select_nearest_point(ds, lon, lat)

Select the nearest grid point in ds.

select_within_polygon_points(ds, gdf)

Mask ds to keep only points inside the gdf polygon.

transform_coordinates(dem_file_path, ...)

Convert all DEM pixel coordinates from from_crs to to_crs.