Skip to content

Commit

Permalink
acs_area_statistics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Gen Tolhurst committed Jul 12, 2024
1 parent df8992a commit 691fc69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acs_area_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ def acs_regional_stats(
lat_weights = lat_weights.drop_vars(redundant_coords)
mask = mask.drop_vars(redundant_coords)

ds_masked = ds.where(mask)[var]

# create your weighted 3D xr.Dataset
if var is None:
try:
Expand All @@ -242,6 +240,8 @@ def acs_regional_stats(
except:
print(f"Please enter var. One of {list(ds.keys())}")
return None

ds_masked = ds.where(mask)[var]
ds_weighted = ds[var].weighted(mask * lat_weights)

# if calculating stats over all dims:
Expand Down

0 comments on commit 691fc69

Please sign in to comment.