Skip to content

Commit b87cb05

Browse files
Merge pull request #40 from gregory-halverson-jpl/main
v1.9.2 checking FLiES inputs
2 parents a3e30ea + 10459b1 commit b87cb05

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

BESS_JPL/BESS_JPL.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,34 @@ def BESS_JPL(
166166

167167
# Check for None values and size mismatches
168168
reference_size = None
169+
missing_radiative_transfer_variables = []
170+
need_radiative_transfer = False
171+
169172
for name, var in variables_to_check.items():
173+
if var is None:
174+
logger.info(f"{name}: None")
175+
else:
176+
logger.info(f"{name}: {var.shape}")
177+
170178
if var is None:
171179
logger.warning(f"Variable '{name}' is None.")
180+
missing_radiative_transfer_variables = missing_radiative_transfer_variables.append(name)
172181
else:
173182
# Get the size of the variable if it's a numpy array
174183
size = var.shape if isinstance(var, np.ndarray) else None
184+
175185
if reference_size is None:
176186
reference_size = size # Set the first non-None size as the reference
177187
elif size != reference_size:
178188
logger.warning(f"Variable '{name}' has a different size: {size} (expected: {reference_size}).")
189+
missing_radiative_transfer_variables = missing_radiative_transfer_variables.append(name)
190+
191+
if len(missing_radiative_transfer_variables) > 0:
192+
need_radiative_transfer = True
179193

180194
# check if any of the FLiES outputs are not given
181-
if None in (Rg, VISdiff, VISdir, NIRdiff, NIRdir, UV, albedo_visible, albedo_NIR):
195+
if need_radiative_transfer:
196+
logger.info(f"running FLiES for missing variables: {', '.join(missing_radiative_transfer_variables)}")
182197
# load cloud optical thickness if not provided
183198
if COT is None:
184199
COT = GEOS5FP_connection.COT(time_UTC=time_UTC, geometry=geometry, resampling=resampling)

BESS_JPL/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.9.1
1+
1.9.2

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=60", "setuptools-scm>=8.0", "wheel"]
33

44
[project]
55
name = "BESS-JPL"
6-
version = "1.9.1"
6+
version = "1.9.2"
77
description = "Breathing Earth System Simulator (BESS) Gross Primary Production (GPP) and Evapotranspiration (ET) Model Python"
88
readme = "README.md"
99
authors = [

0 commit comments

Comments
 (0)