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

implement a faster way to create a LandMask #54

Closed
amoodie opened this issue Apr 26, 2021 · 1 comment
Closed

implement a faster way to create a LandMask #54

amoodie opened this issue Apr 26, 2021 · 1 comment

Comments

@amoodie
Copy link
Contributor

amoodie commented Apr 26, 2021

Below is an outline for a faster alternative implementation to a LandMask. This method does not use the OAM, and so it is much faster. However, it is not scale-free like the OAM, so it requires an additional scale parameter. Luckily this is easy enough to set, based on the inlet channel width (or some characteristic channel width).

hack_landmask = dm.mask.ElevationMask(
    golf['eta'][-1, :, :],
    elevation_threshold=0)
hack_landmask._mask = morphology.binary_closing(hack_landmask._mask, morphology.disk(5))

5 is the scale parameter here, setting the size of the morphological structural element for the closing.

left is OAP at 1.03 s, right is a hacky mask at 5.5 ms (~200 x faster)
image

@amoodie
Copy link
Contributor Author

amoodie commented Nov 11, 2021

closed with #63

@amoodie amoodie closed this as completed Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant