ECOv002-calval-tables 1.3.0__py3-none-any.whl → 1.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,65 +1,5 @@
1
- import os
2
-
3
- import numpy as np
4
- import pandas as pd
5
- import geopandas as gpd
6
-
7
- from shapely.geometry import Point
8
-
9
- def load_combined_eco_flux_ec_filtered() -> pd.DataFrame:
10
- """
11
- Load the filtered eddy covariance (EC) flux dataset used for ECOSTRESS Collection 2 ET product validation.
12
- This dataset contains site-level, quality-controlled flux measurements that serve as ground truth for evaluating ECOSTRESS evapotranspiration estimates.
13
- Returns:
14
- pd.DataFrame: DataFrame of filtered EC flux data for validation analysis.
15
- """
16
- return pd.read_csv(os.path.join(os.path.dirname(__file__), 'combined_eco_flux_EC_filtered.csv'))
17
-
18
-
19
- def load_metadata_ebc_filt() -> gpd.GeoDataFrame:
20
- """
21
- Load the metadata for the filtered eddy covariance (EC) flux sites used in the ECOSTRESS Collection 2 validation study.
22
- This table provides site information (location, climate, land cover, etc.) for interpreting and grouping the flux data in the validation analysis.
23
- Returns:
24
- pd.DataFrame: DataFrame of site metadata for the filtered EC flux dataset.
25
- """
26
- df = pd.read_csv(os.path.join(os.path.dirname(__file__), 'metadata_ebc_filt.csv'))
27
-
28
- if 'Lat' not in df.columns or 'Long' not in df.columns:
29
- raise ValueError("metadata_ebc_filt.csv must contain 'Lat' and 'Long' columns.")
30
-
31
- geometry = [Point(xy) for xy in zip(df['Long'], df['Lat'])]
32
- gdf = gpd.GeoDataFrame(df, geometry=geometry, crs="EPSG:4326")
33
-
34
- return gdf
35
-
36
- def load_calval_table() -> gpd.GeoDataFrame:
37
- """
38
- Load the combined ECOSTRESS Collection 2 validation table, which includes both the filtered eddy covariance flux data
39
- and the associated site metadata.
40
-
41
- Returns:
42
- gpd.GeoDataFrame: Combined GeoDataFrame of EC flux data and site metadata for validation analysis.
43
- """
44
- tower_locations_gdf = load_metadata_ebc_filt()
45
- tower_data_df = load_combined_eco_flux_ec_filtered()
46
-
47
- # Merge all columns from both tables, matching tower_data_df.ID to tower_locations_gdf["Site ID"]
48
- merged_df = pd.merge(
49
- tower_data_df,
50
- tower_locations_gdf,
51
- left_on="ID",
52
- right_on="Site ID",
53
- how="left",
54
- suffixes=("", "_meta")
55
- )
56
-
57
- merged_df["time_UTC"] = merged_df["eco_time_utc"]
58
- merged_df["ST_K"] = np.array(merged_df.LST)
59
- merged_df["ST_C"] = merged_df.ST_K - 273.15
60
- merged_df["Ta_C"] = np.array(merged_df.Ta)
61
- merged_df["SWin_Wm2"] = np.array(merged_df.Rg)
62
-
63
- # Convert merged DataFrame to GeoDataFrame
64
- gdf = gpd.GeoDataFrame(merged_df, geometry=merged_df["geometry"], crs="EPSG:4326")
65
- return gdf
1
+ from .load_tables import *
2
+ from .error_funcs import *
3
+ from .plot_funcs import *
4
+ from .ec_lib import *
5
+ from .plot_single_model import *