wolfhece.hydrology.climate_data
Module Contents
- wolfhece.hydrology.climate_data.transform_latlon_to_lambert72_list(lat_list: list[float], lon_list: list[float]) list[tuple[float, float]] [source]
Transform lists of EPSG:4258 coordinates to Lambert 72 coordinates.
Coordinates from IRM are in EPSG:4258, and we want to convert them to Lambert 72 (EPSG:31370).
- wolfhece.hydrology.climate_data.read_pixel_positions(data_dir: pathlib.Path = DATADIR) tuple[list[int], list[tuple[float, float]]] [source]
Read pixel positions from the metadata file.
- wolfhece.hydrology.climate_data.convert_pixels_to_squares(pixels: list[tuple[float, float]]) tuple[list[tuple[tuple[float, float], Ellipsis]], scipy.spatial.KDTree] [source]
From pixels coordinates, define squares around each pixel center.
Corners are defined as the average of the pixel center and its neighbors.
- wolfhece.hydrology.climate_data.read_historical_year_month(year: int, month: int, data_dir: pathlib.Path = DATADIR) pandas.DataFrame [source]
Read a specific year and month from the climate data.
Available variables are : - day - temp_max - temp_min - temp_avg - precip_quantity - humidity_relative - pressure - sun_duration - short_wave_from_sky - evapotrans_ref
From IRM’s Metadata description: - TEMP_MAX °C daily maximum temperature from 08:00LT on DATE_BEGIN to 08:00LT on DATE_END+1 - TEMP_MIN °C daily minimum temperature from 08:00LT on DATE_BEGIN-1 to 08:00LT on DATE_END - TEMP_AVG °C average temperature (average of TEMP_MAX and TEMP_MIN) - PRECIP_QUANTITY mm precipitation quantity from 08:00LT on DATE_BEGIN to 08:00LT on DATE_END+1 - HUMIDITY_RELATIVE percentage average relative humidity - PRESSURE hPa sea level pressure - SUN_DURATION average daily sunshine duration (hours/day) - SHORT_WAVE_FROM_SKY average daily global solar radiation (kWh/m2/day) - EVAPOTRANS_REF mm reference evapotranspiration ET0
- Parameters:
year (int) – Year to read
month (int) – Month to read
variable (str) – Variable to read (e.g., ‘temperature’, ‘precipitation’)
data_dir (Path) – Directory where the data is stored
- Returns:
DataFrame containing the data for the specified year and month
- wolfhece.hydrology.climate_data.scan_climate_files(data_dir: pathlib.Path = DATADIR) list[pathlib.Path] [source]
Scan the directory for climate data files.
- Parameters:
data_dir (Path) – Directory where the data is stored
- Returns:
List of paths to climate data files
- wolfhece.hydrology.climate_data.find_first_available_year_month(data_dir: pathlib.Path = DATADIR) int [source]
Find the first available year in the climate data files.
- Parameters:
data_dir (Path) – Directory where the data is stored
- Returns:
First available year as an integer
- wolfhece.hydrology.climate_data.find_last_available_year_month(data_dir: pathlib.Path = DATADIR) int [source]
Find the last available year in the climate data files.
- Parameters:
data_dir (Path) – Directory where the data is stored
- Returns:
Last available year as an integer
- wolfhece.hydrology.climate_data.read_between(data_dir: pathlib.Path = DATADIR, start_year: int = 1961, start_month: int = 1, end_year: int = 2025, end_month: int = 6) pandas.DataFrame [source]
Read climate data files into a single DataFrame.
- Parameters:
data_dir (Path) – Directory where the data is stored
- Returns:
DataFrame containing all climate data