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

Landsea mask generation: add PCMDI method as an option #1063

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bug fix
  • Loading branch information
lee1043 committed Feb 28, 2024
commit 3ca0475c645b1d78ca839a8be004ad00d61cade5
5 changes: 4 additions & 1 deletion pcmdi_metrics/utils/create_land_sea_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def create_land_sea_mask(
# Mask the land-sea mask to match the dataset's coordinates
land_sea_mask = land_mask.mask(lon, lat=lat)

if not as_boolean:
if as_boolean:
# Convert the 0/nan land-sea mask to a boolean mask
land_sea_mask = xr.where(land_sea_mask, False, True)
else:
# Convert the boolean land-sea mask to a 0/1 mask
land_sea_mask = xr.where(land_sea_mask, 0, 1)

Expand Down
Loading