ECOv002-calval-tables 1.0.1__tar.gz → 1.2.0__tar.gz

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.
Files changed (20) hide show
  1. ecov002_calval_tables-1.2.0/ECOv002_calval_tables/ECOv002_calval_tables.py +64 -0
  2. ecov002_calval_tables-1.2.0/ECOv002_calval_tables/version.py +3 -0
  3. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/PKG-INFO +4 -2
  4. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/SOURCES.txt +6 -1
  5. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/PKG-INFO +4 -2
  6. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/README.md +3 -1
  7. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/pyproject.toml +1 -1
  8. ecov002_calval_tables-1.2.0/tests/test_import_ECOv002_calval_tables.py +2 -0
  9. ecov002_calval_tables-1.2.0/tests/test_import_dependencies.py +12 -0
  10. ecov002_calval_tables-1.2.0/tests/test_load_calval_table.py +14 -0
  11. ecov002_calval_tables-1.2.0/tests/test_load_metadata_ebc_filt.py +15 -0
  12. ecov002_calval_tables-1.0.1/ECOv002_calval_tables/ECOv002_calval_tables.py +0 -22
  13. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/__init__.py +0 -0
  14. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/combined_eco_flux_EC_filtered.csv +0 -0
  15. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/metadata_ebc_filt.csv +0 -0
  16. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/dependency_links.txt +0 -0
  17. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/requires.txt +0 -0
  18. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/top_level.txt +0 -0
  19. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/LICENSE +0 -0
  20. {ecov002_calval_tables-1.0.1 → ecov002_calval_tables-1.2.0}/setup.cfg +0 -0
@@ -0,0 +1,64 @@
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
+
62
+ # Convert merged DataFrame to GeoDataFrame
63
+ gdf = gpd.GeoDataFrame(merged_df, geometry=merged_df["geometry"], crs="EPSG:4326")
64
+ 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.2.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)
@@ -5,8 +5,13 @@ ECOv002_calval_tables/ECOv002_calval_tables.py
5
5
  ECOv002_calval_tables/__init__.py
6
6
  ECOv002_calval_tables/combined_eco_flux_EC_filtered.csv
7
7
  ECOv002_calval_tables/metadata_ebc_filt.csv
8
+ ECOv002_calval_tables/version.py
8
9
  ECOv002_calval_tables.egg-info/PKG-INFO
9
10
  ECOv002_calval_tables.egg-info/SOURCES.txt
10
11
  ECOv002_calval_tables.egg-info/dependency_links.txt
11
12
  ECOv002_calval_tables.egg-info/requires.txt
12
- ECOv002_calval_tables.egg-info/top_level.txt
13
+ ECOv002_calval_tables.egg-info/top_level.txt
14
+ tests/test_import_ECOv002_calval_tables.py
15
+ tests/test_import_dependencies.py
16
+ tests/test_load_calval_table.py
17
+ tests/test_load_metadata_ebc_filt.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ECOv002-calval-tables
3
- Version: 1.0.1
3
+ Version: 1.2.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)
@@ -1,8 +1,10 @@
1
1
 
2
- # ECOSTRESS Collection 2 Calibration/Validation Data Tables (Python Package)
2
+ # ECOSTRESS Collection 2 Calibration/Validation Data Tables
3
3
 
4
4
  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.
5
5
 
6
+ 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.
7
+
6
8
  ## Authors
7
9
 
8
10
  Zoe Pierrat (she/her)
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "ECOv002-calval-tables"
6
- version = "1.0.1"
6
+ version = "1.2.0"
7
7
  description = "Priestley-Taylor Jet Propulsion Laboratory Soil Moisutre Evapotranspiration Model"
8
8
  readme = "README.md"
9
9
  authors = [
@@ -0,0 +1,2 @@
1
+ def test_import_ECOv002_calval_tables():
2
+ import ECOv002_calval_tables
@@ -0,0 +1,12 @@
1
+ import pytest
2
+
3
+ # List of dependencies
4
+ dependencies = [
5
+ "pandas",
6
+ "geopandas"
7
+ ]
8
+
9
+ # Generate individual test functions for each dependency
10
+ @pytest.mark.parametrize("dependency", dependencies)
11
+ def test_dependency_import(dependency):
12
+ __import__(dependency)
@@ -0,0 +1,14 @@
1
+ import unittest
2
+ import geopandas as gpd
3
+ from ECOv002_calval_tables import load_calval_table
4
+
5
+ class TestLoadCalvalTable(unittest.TestCase):
6
+ def test_returns_geodataframe_with_valid_geometry(self):
7
+ gdf = load_calval_table()
8
+ self.assertIsInstance(gdf, gpd.GeoDataFrame)
9
+ self.assertIn('geometry', gdf.columns)
10
+ self.assertTrue(all(gdf.geometry.geom_type == 'Point'))
11
+ self.assertTrue(gdf.geometry.is_valid.all())
12
+
13
+ if __name__ == "__main__":
14
+ unittest.main()
@@ -0,0 +1,15 @@
1
+ import unittest
2
+ import geopandas as gpd
3
+ from ECOv002_calval_tables import load_metadata_ebc_filt
4
+
5
+ class TestLoadMetadataEbcFilt(unittest.TestCase):
6
+ def test_returns_geodataframe_with_valid_geometry(self):
7
+ gdf = load_metadata_ebc_filt()
8
+ self.assertIsInstance(gdf, gpd.GeoDataFrame)
9
+ self.assertIn('geometry', gdf.columns)
10
+ # Check all geometries are valid Points
11
+ self.assertTrue(all(gdf.geometry.geom_type == 'Point'))
12
+ self.assertTrue(gdf.geometry.is_valid.all())
13
+
14
+ if __name__ == "__main__":
15
+ unittest.main()
@@ -1,22 +0,0 @@
1
-
2
- import pandas as pd
3
- import os
4
-
5
- def load_combined_eco_flux_ec_filtered() -> pd.DataFrame:
6
- """
7
- Load the filtered eddy covariance (EC) flux dataset used for ECOSTRESS Collection 2 ET product validation.
8
- This dataset contains site-level, quality-controlled flux measurements that serve as ground truth for evaluating ECOSTRESS evapotranspiration estimates.
9
- Returns:
10
- pd.DataFrame: DataFrame of filtered EC flux data for validation analysis.
11
- """
12
- return pd.read_csv(os.path.join(os.path.dirname(__file__), 'combined_eco_flux_EC_filtered.csv'))
13
-
14
-
15
- def load_metadata_ebc_filt() -> pd.DataFrame:
16
- """
17
- Load the metadata for the filtered eddy covariance (EC) flux sites used in the ECOSTRESS Collection 2 validation study.
18
- This table provides site information (location, climate, land cover, etc.) for interpreting and grouping the flux data in the validation analysis.
19
- Returns:
20
- pd.DataFrame: DataFrame of site metadata for the filtered EC flux dataset.
21
- """
22
- return pd.read_csv(os.path.join(os.path.dirname(__file__), 'metadata_ebc_filt.csv'))