ECOv002-calval-tables 1.1.0__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 (19) hide show
  1. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/ECOv002_calval_tables.py +14 -25
  2. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/PKG-INFO +1 -1
  3. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/PKG-INFO +1 -1
  4. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/pyproject.toml +1 -1
  5. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/__init__.py +0 -0
  6. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/combined_eco_flux_EC_filtered.csv +0 -0
  7. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/metadata_ebc_filt.csv +0 -0
  8. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables/version.py +0 -0
  9. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/SOURCES.txt +0 -0
  10. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/dependency_links.txt +0 -0
  11. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/requires.txt +0 -0
  12. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/ECOv002_calval_tables.egg-info/top_level.txt +0 -0
  13. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/LICENSE +0 -0
  14. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/README.md +0 -0
  15. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/setup.cfg +0 -0
  16. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/tests/test_import_ECOv002_calval_tables.py +0 -0
  17. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/tests/test_import_dependencies.py +0 -0
  18. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/tests/test_load_calval_table.py +0 -0
  19. {ecov002_calval_tables-1.1.0 → ecov002_calval_tables-1.2.0}/tests/test_load_metadata_ebc_filt.py +0 -0
@@ -1,7 +1,9 @@
1
+ import os
1
2
 
3
+ import numpy as np
2
4
  import pandas as pd
3
- import os
4
5
  import geopandas as gpd
6
+
5
7
  from shapely.geometry import Point
6
8
 
7
9
  def load_combined_eco_flux_ec_filtered() -> pd.DataFrame:
@@ -40,36 +42,23 @@ def load_calval_table() -> gpd.GeoDataFrame:
40
42
  gpd.GeoDataFrame: Combined GeoDataFrame of EC flux data and site metadata for validation analysis.
41
43
  """
42
44
  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
45
  tower_data_df = load_combined_eco_flux_ec_filtered()
47
46
 
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
-
47
+ # Merge all columns from both tables, matching tower_data_df.ID to tower_locations_gdf["Site ID"]
62
48
  merged_df = pd.merge(
63
- left=model_inputs_df,
64
- right=tower_static_data_gdf,
49
+ tower_data_df,
50
+ tower_locations_gdf,
65
51
  left_on="ID",
66
- right_on="ID",
67
- how="left"
52
+ right_on="Site ID",
53
+ how="left",
54
+ suffixes=("", "_meta")
68
55
  )
69
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
+
70
62
  # Convert merged DataFrame to GeoDataFrame
71
63
  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
64
  return gdf
75
- return gdf
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ECOv002-calval-tables
3
- Version: 1.1.0
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ECOv002-calval-tables
3
- Version: 1.1.0
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
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "ECOv002-calval-tables"
6
- version = "1.1.0"
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 = [