ECOv002-calval-tables 1.0.1__py3-none-any.whl → 1.1.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,6 +1,8 @@
1
1
 
2
2
  import pandas as pd
3
3
  import os
4
+ import geopandas as gpd
5
+ from shapely.geometry import Point
4
6
 
5
7
  def load_combined_eco_flux_ec_filtered() -> pd.DataFrame:
6
8
  """
@@ -12,11 +14,62 @@ def load_combined_eco_flux_ec_filtered() -> pd.DataFrame:
12
14
  return pd.read_csv(os.path.join(os.path.dirname(__file__), 'combined_eco_flux_EC_filtered.csv'))
13
15
 
14
16
 
15
- def load_metadata_ebc_filt() -> pd.DataFrame:
17
+ def load_metadata_ebc_filt() -> gpd.GeoDataFrame:
16
18
  """
17
19
  Load the metadata for the filtered eddy covariance (EC) flux sites used in the ECOSTRESS Collection 2 validation study.
18
20
  This table provides site information (location, climate, land cover, etc.) for interpreting and grouping the flux data in the validation analysis.
19
21
  Returns:
20
22
  pd.DataFrame: DataFrame of site metadata for the filtered EC flux dataset.
21
23
  """
22
- return pd.read_csv(os.path.join(os.path.dirname(__file__), 'metadata_ebc_filt.csv'))
24
+ df = pd.read_csv(os.path.join(os.path.dirname(__file__), 'metadata_ebc_filt.csv'))
25
+
26
+ if 'Lat' not in df.columns or 'Long' not in df.columns:
27
+ raise ValueError("metadata_ebc_filt.csv must contain 'Lat' and 'Long' columns.")
28
+
29
+ geometry = [Point(xy) for xy in zip(df['Long'], df['Lat'])]
30
+ gdf = gpd.GeoDataFrame(df, geometry=geometry, crs="EPSG:4326")
31
+
32
+ return gdf
33
+
34
+ def load_calval_table() -> gpd.GeoDataFrame:
35
+ """
36
+ Load the combined ECOSTRESS Collection 2 validation table, which includes both the filtered eddy covariance flux data
37
+ and the associated site metadata.
38
+
39
+ Returns:
40
+ gpd.GeoDataFrame: Combined GeoDataFrame of EC flux data and site metadata for validation analysis.
41
+ """
42
+ tower_locations_gdf = load_metadata_ebc_filt()
43
+ tower_IDs = list(tower_locations_gdf["Site ID"])
44
+ tower_names = list(tower_locations_gdf.Name)
45
+ tower_geometries = tower_locations_gdf.geometry
46
+ tower_data_df = load_combined_eco_flux_ec_filtered()
47
+
48
+ tower_static_data_gdf = gpd.GeoDataFrame({
49
+ "ID": tower_IDs,
50
+ "name": tower_names,
51
+ "geometry": tower_geometries
52
+ }, crs="EPSG:4326")
53
+
54
+ observation_tower_IDs = list(tower_data_df.ID)
55
+ observation_tower_times_UTC = tower_data_df.eco_time_utc
56
+
57
+ model_inputs_df = pd.DataFrame({
58
+ "ID": observation_tower_IDs,
59
+ "time_UTC": observation_tower_times_UTC
60
+ })
61
+
62
+ merged_df = pd.merge(
63
+ left=model_inputs_df,
64
+ right=tower_static_data_gdf,
65
+ left_on="ID",
66
+ right_on="ID",
67
+ how="left"
68
+ )
69
+
70
+ # Convert merged DataFrame to GeoDataFrame
71
+ gdf = gpd.GeoDataFrame(merged_df, geometry=merged_df["geometry"], crs="EPSG:4326")
72
+ # Optionally, drop rows with missing geometry if needed:
73
+ # gdf = gdf[gdf.geometry.notnull()]
74
+ return gdf
75
+ return gdf
@@ -0,0 +1,3 @@
1
+ from importlib.metadata import version
2
+
3
+ __version__ = version("ECOv002-calval-tables")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ECOv002-calval-tables
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: Priestley-Taylor Jet Propulsion Laboratory Soil Moisutre Evapotranspiration Model
5
5
  Author-email: Gregory Halverson <gregory.h.halverson@jpl.nasa.gov>, Zoe Pierrat <zoe.a.pierrat@jpl.nasa.gov>
6
6
  Project-URL: Homepage, https://github.com/gregory-halverson/ECOv002-calval-tables
@@ -21,10 +21,12 @@ Requires-Dist: twine; extra == "dev"
21
21
  Dynamic: license-file
22
22
 
23
23
 
24
- # ECOSTRESS Collection 2 Calibration/Validation Data Tables (Python Package)
24
+ # ECOSTRESS Collection 2 Calibration/Validation Data Tables
25
25
 
26
26
  This Python package provides calibration and validation data tables used in the evaluation of the ECOSTRESS Collection 2 Evapotranspiration (ET) data products. The included datasets and loader functions support reproducible research and validation workflows for ET modeling and remote sensing studies.
27
27
 
28
+ The CSV files used in this repository were sourced from the [@zoepierrat/ECOSTRESS_C2_L3_ET_Validation](https://github.com/zoepierrat/ECOSTRESS_C2_L3_ET_Validation) repository.
29
+
28
30
  ## Authors
29
31
 
30
32
  Zoe Pierrat (she/her)
@@ -0,0 +1,10 @@
1
+ ECOv002_calval_tables/ECOv002_calval_tables.py,sha256=7BZhZRcFYsVcsNtgYmmrTrVP0bFqIwvXgEqspN-Kvyc,2905
2
+ ECOv002_calval_tables/__init__.py,sha256=oO0pVascuJs247UwpXq2o23wQPThM1bWEwUhSYiNzMY,60
3
+ ECOv002_calval_tables/combined_eco_flux_EC_filtered.csv,sha256=uSRv1CBMJKUWBgtMlRHB1359kiUFUL1ez2c4m7C4DxU,745225
4
+ ECOv002_calval_tables/metadata_ebc_filt.csv,sha256=74AeCH5DG2Zu8ZFBXUZAW95hlsCjK9K3t6BWRRReR3s,13975
5
+ ECOv002_calval_tables/version.py,sha256=DOnf2BIAf7HAp9SIUIetrDgRoZDL0o7JuKSiC7_ZT_I,87
6
+ ecov002_calval_tables-1.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
7
+ ecov002_calval_tables-1.1.0.dist-info/METADATA,sha256=I6MyKw_lS1PHF5n8we7wwMk43HEknc48bHw4UvEYruI,3171
8
+ ecov002_calval_tables-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
9
+ ecov002_calval_tables-1.1.0.dist-info/top_level.txt,sha256=ePbA84g_XQHWQUAQEVo6gmyuW0WLUzPg2IfHyoGqUqg,22
10
+ ecov002_calval_tables-1.1.0.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- ECOv002_calval_tables/ECOv002_calval_tables.py,sha256=t06ICMGPlyhuB_9EUkuASu8P_jXYk8CKbTRfTi7JOn8,1094
2
- ECOv002_calval_tables/__init__.py,sha256=oO0pVascuJs247UwpXq2o23wQPThM1bWEwUhSYiNzMY,60
3
- ECOv002_calval_tables/combined_eco_flux_EC_filtered.csv,sha256=uSRv1CBMJKUWBgtMlRHB1359kiUFUL1ez2c4m7C4DxU,745225
4
- ECOv002_calval_tables/metadata_ebc_filt.csv,sha256=74AeCH5DG2Zu8ZFBXUZAW95hlsCjK9K3t6BWRRReR3s,13975
5
- ecov002_calval_tables-1.0.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
6
- ecov002_calval_tables-1.0.1.dist-info/METADATA,sha256=rFDwBUarZI1w2sFpcy_EE8p7fTW2hxNk9JUd20NoXGo,3010
7
- ecov002_calval_tables-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- ecov002_calval_tables-1.0.1.dist-info/top_level.txt,sha256=ePbA84g_XQHWQUAQEVo6gmyuW0WLUzPg2IfHyoGqUqg,22
9
- ecov002_calval_tables-1.0.1.dist-info/RECORD,,