Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile Speed Reporter #34

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
vdatum safety enhancements
  • Loading branch information
mpiannucci committed May 23, 2024
commit e6ee049116f34e80ae7043095a3f840e42df8a21
11 changes: 9 additions & 2 deletions xreds/extensions/vdatum.py
Original file line number Diff line number Diff line change
@@ -72,8 +72,15 @@ def transform_dataset(self, ds: xr.Dataset, config: dict) -> xr.Dataset:
return ds

target_zeta_var = config.get("water_level_var", "zeta")
target_datum_var = config.get("vdatum_var", "igld85tolwd")
target_datum_name = config.get("vdatum_name", "igld85")
target_datum_var = config.get("vdatum_var", None)
target_datum_name = config.get("vdatum_name", None)

if target_datum_var is None or target_datum_name is None:
logger.warning(
f"Dataset {ds.attrs.get('name', 'unknown')} does not have a vdatum_var or vdatum_name attribute. Skipping vdatum transformation"
)
return ds

out_datum_var = f"{target_zeta_var}_{target_datum_name}"

ds_transformed = transform_datum(ds, ds_vdatum, target_zeta_var, target_datum_var, target_datum_name, out_datum_var)