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

landmask generation for non-regular lat/lon grid #1010

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

lee1043
Copy link
Contributor

@lee1043 lee1043 commented Dec 21, 2023

Let the function takes lon and lat key for data array name in case not standard.

Example usage:

mask = create_land_sea_mask(ds, lon_key="lon", lat_key="lat")

@lee1043
Copy link
Contributor Author

lee1043 commented Dec 21, 2023

@acordonez could you please review and try?

from pcmdi_metrics.utils import create_land_sea_mask

f_nt_n = "/home/ordonez4/seaice/data/icecon_ssmi_nt_n_edited.nc"
obs = xc.open_dataset(f_nt_n)

mask = create_land_sea_mask(obs, lon_key="lon", lat_key="lat")

mask.plot()

output

@lee1043 lee1043 self-assigned this Dec 21, 2023
@lee1043 lee1043 marked this pull request as ready for review December 21, 2023 01:36
@lee1043 lee1043 added the bug label Dec 21, 2023
@acordonez
Copy link
Collaborator

@lee1043 This is working well for me - The mask is doing a good job of removing the lakes:

Original:
Screenshot 2023-12-21 at 8 37 40 AM

Masked:
Screenshot 2023-12-21 at 8 37 48 AM

@lee1043
Copy link
Contributor Author

lee1043 commented Dec 21, 2023

@acordonez thank you for checking! Could you please approve the PR?

@lee1043 lee1043 merged commit 8d7d16c into main Dec 21, 2023
5 checks passed
@lee1043 lee1043 deleted the bug/1009_lee1043_landmask branch December 21, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: land sea mask incorrectly generated for non-regular lat/lon grid
2 participants