From 6424c1c469f7291cb1ee1f89466dad3e0964d6f5 Mon Sep 17 00:00:00 2001 From: blychs Date: Mon, 7 Oct 2024 17:39:54 -0600 Subject: [PATCH 1/2] Bugfix: missing colon in dz_m --- monetio/models/_camx_mm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monetio/models/_camx_mm.py b/monetio/models/_camx_mm.py index 455337d8..0ab6aa02 100644 --- a/monetio/models/_camx_mm.py +++ b/monetio/models/_camx_mm.py @@ -461,7 +461,7 @@ def _calc_midlayer_height_agl(dset): dz_m = xr.zeros_like(layer_height_agl) dz_m[:, 0, :, :] = layer_height_agl[:, 0, :, :].values - dz_m[:, 1:, :, :] = layer_height_agl[:, 1, :, :].values - layer_height_agl[:, :-1, :, :].values + dz_m[:, 1:, :, :] = layer_height_agl[:, 1:, :, :].values - layer_height_agl[:, :-1, :, :].values dz_m.attrs["long_name"] = "dz in meters" dz_m.attrs["var_desc"] = "Layer thickness in meters" return alt_agl_m_mid, layer_height_agl From 17ee9d87371e4b9d4714d003a5b859b40c87fb90 Mon Sep 17 00:00:00 2001 From: blychs Date: Mon, 7 Oct 2024 18:00:26 -0600 Subject: [PATCH 2/2] Make sure dz_m is in 3D data --- monetio/models/_camx_mm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monetio/models/_camx_mm.py b/monetio/models/_camx_mm.py index 0ab6aa02..a9f46b53 100644 --- a/monetio/models/_camx_mm.py +++ b/monetio/models/_camx_mm.py @@ -206,7 +206,7 @@ def add_met_data_3D(d_chem, d_met): "var_desc": "pressure", } if ("z" in d_met.variables) or ("ZGRID_M" in d_met.variables): - d_chem["alt_agl_m_mid"], d_chem["layer_height_agl"] = _calc_midlayer_height_agl(d_met) + d_chem["alt_agl_m_mid"], d_chem["dz_m"] = _calc_midlayer_height_agl(d_met) else: warnings.warn("No altitude AGL was found.")