Skip to content

Commit

Permalink
Update monetio/sat/_tropomi_l2_no2_mm.py
Browse files Browse the repository at this point in the history
Co-authored-by: Zachary Moon <[email protected]>
  • Loading branch information
mbruckner-work and zmoon authored Nov 5, 2024
1 parent 4309ebd commit 8a454b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions monetio/sat/_tropomi_l2_no2_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ def get_extra(varname_, *, dct_=None, default_group="PRODUCT"):
# Tropopause pressure
ptrop = xr.full_like(itrop, np.nan, dtype=ds["preslev"].dtype)
for i in np.unique(itrop):
if i >= 0 and i < p.sizes["z"]:
ptrop = xr.where(itrop == i, p.isel(z=int(i)), ptrop)
if np.isnan(i) or i < 0 or i >= p.sizes["z"]:
continue
ptrop = xr.where(itrop == i, p.isel(z=int(i)), ptrop)
ds["troppres"] = ptrop
ds["troppres"].attrs.update({"long_name": "tropopause pressure", "units": "Pa"})

Expand Down

0 comments on commit 8a454b8

Please sign in to comment.