Skip to content

Commit

Permalink
update variable names to v2.2 data model
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Dec 5, 2024
1 parent 218e303 commit 354b088
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions python/ngen_config_gen/src/ngen/config_gen/models/cfe.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,49 +56,49 @@ def hydrofabric_linked_data_hook(
# beta exponent on Clapp-Hornberger (1978) soil water relations
# NOTE: it seems all values each layer of `bexp_soil_layers_stag` are the same.
self.data["soil_params_b"] = FloatUnitPair(
value=data["bexp_soil_layers_stag=1"],
value=data["mode.bexp_soil_layers_stag=1"],
unit=EMPTY,
)

# saturated hydraulic conductivity
# NOTE: it seems all values each layer of `dksat_soil_layers_stag` are the same.
self.data["soil_params_satdk"] = FloatUnitPair(
value=data["dksat_soil_layers_stag=1"],
value=data["geom_mean.dksat_soil_layers_stag=1"],
unit=M_PER_S,
)

# saturated capillary head
# NOTE: it seems all values each layer of `psisat_soil_layers_stag` are the same.
self.data["soil_params_satpsi"] = FloatUnitPair(
value=data["psisat_soil_layers_stag=1"],
value=data["geom_mean.psisat_soil_layers_stag=1"],
unit=METERS,
)

# this factor (0-1) modifies the gradient of the hydraulic head at the soil bottom. 0=no-flow.
self.data["soil_params_slop"] = FloatUnitPair(value=data["slope"], unit=M_PER_M)
self.data["soil_params_slop"] = FloatUnitPair(value=data["mean.slope"], unit=M_PER_M)

# saturated soil moisture content
# NOTE: it seems all values each layer of `smcmax_soil_layers_stag` are the same.
self.data["soil_params_smcmax"] = FloatUnitPair(
value=data["smcmax_soil_layers_stag=1"],
value=data["mean.smcmax_soil_layers_stag=1"],
unit=M_PER_M,
)

# wilting point soil moisture content
# NOTE: it seems all values each layer of `smcwlt_soil_layers_stag` are the same.
self.data["soil_params_wltsmc"] = FloatUnitPair(
value=data["smcwlt_soil_layers_stag=1"],
value=data["mean.smcwlt_soil_layers_stag=1"],
unit=M_PER_M,
)

# maximum storage in the conceptual reservoir
self.data["max_gw_storage"] = FloatUnitPair(value=data["gw_Zmax"], unit=METERS)
self.data["max_gw_storage"] = FloatUnitPair(value=data["mean.Zmax"], unit=METERS)

# the primary outlet coefficient
self.data["cgw"] = FloatUnitPair(value=data["gw_Coeff"], unit=M_PER_H)
self.data["cgw"] = FloatUnitPair(value=data["mean.Coeff"], unit=M_PER_H)

# exponent parameter (1.0 for linear reservoir)
self.data["expon"] = FloatUnitPair(value=data["gw_Expon"], unit=EMPTY)
self.data["expon"] = FloatUnitPair(value=data["mode.Expon"], unit=EMPTY)

def _v2_defaults(self) -> None:
"""
Expand Down
6 changes: 3 additions & 3 deletions python/ngen_config_gen/src/ngen/config_gen/models/pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ def hydrofabric_linked_data_hook(
if version != "2.0":
raise RuntimeError("only support v2 hydrofabric")

self.data["longitude_degrees"] = data["X"]
self.data["latitude_degrees"] = data["Y"]
self.data["site_elevation_m"] = data["elevation_mean"]
self.data["longitude_degrees"] = data["centroid_x"]
self.data["latitude_degrees"] = data["centroid_y"]
self.data["site_elevation_m"] = data["mean.elevation"]

def _v2_defaults(self) -> None:
self.data["yes_wrf"] = False
Expand Down

0 comments on commit 354b088

Please sign in to comment.