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

mask_2 #189

Merged
merged 19 commits into from
Sep 5, 2020
Merged

mask_2 #189

merged 19 commits into from
Sep 5, 2020

Conversation

hCraker
Copy link
Contributor

@hCraker hCraker commented Jul 28, 2020

Closes #188
image

@hCraker
Copy link
Contributor Author

hCraker commented Jul 28, 2020

In the NCL example, the contours appear over lakes. I have played around with zorder but have been unable to achieve the same result. @clairefio @michaelavs have either of you done this before?

@michaelavs
Copy link
Contributor

In the NCL example, the contours appear over lakes. I have played around with zorder but have been unable to achieve the same result. @clairefio @michaelavs have either of you done this before?

I did something semi-similar in my mask_5 example, but I was only drawing over land which covered the lakes so it may not work the same because I think you will be drawing over 2 separate objects. I believe I used this stack overflow question as a basis for my line of code, so It may be of use to you

@hCraker
Copy link
Contributor Author

hCraker commented Jul 29, 2020

I did something semi-similar in my mask_5 example, but I was only drawing over land which covered the lakes so it may not work the same because I think you will be drawing over 2 separate objects. I believe I used this stack overflow question as a basis for my line of code, so It may be of use to you

I think the issue stems from the LAND feature in cartopy covering where lakes are. I would have to find a feature that draws land masses but doesn't cover lakes, and I don't think cartopy has that. I could use a shapefile, but I don't know if it would be worth adding to the example since shapefiles are a bit complicated. I'll continue to work on this but if you and @clairefio could review this PR with this in mind, that would be helpful.

@clairefio
Copy link
Contributor

I did something semi-similar in my mask_5 example, but I was only drawing over land which covered the lakes so it may not work the same because I think you will be drawing over 2 separate objects. I believe I used this stack overflow question as a basis for my line of code, so It may be of use to you

I think the issue stems from the LAND feature in cartopy covering where lakes are. I would have to find a feature that draws land masses but doesn't cover lakes, and I don't think cartopy has that. I could use a shapefile, but I don't know if it would be worth adding to the example since shapefiles are a bit complicated. I'll continue to work on this but if you and @clairefio could review this PR with this in mind, that would be helpful.

The rest of the script looks good! Here's an interesting thread: https://stackoverflow.com/questions/13796315/plot-only-on-continent-in-matplotlib Maybe you could tweak this solution to plot contour data on the lakes?

@hCraker
Copy link
Contributor Author

hCraker commented Jul 29, 2020

The rest of the script looks good! Here's an interesting thread: https://stackoverflow.com/questions/13796315/plot-only-on-continent-in-matplotlib Maybe you could tweak this solution to plot contour data on the lakes?

Thank you for the suggestions, but that stack overflow thread uses matplotlib.basemap instead of cartopy. Thank you for searching for a solution.

hCraker and others added 3 commits July 30, 2020 10:49
@hCraker hCraker requested a review from michaelavs July 30, 2020 15:04
Copy link
Contributor

@michaelavs michaelavs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@hCraker hCraker requested review from clyne and jukent July 30, 2020 15:17
Copy link
Collaborator

@clyne clyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Terrific. Nice work!

@jukent
Copy link
Collaborator

jukent commented Aug 12, 2020

Here is an example of creating a custom cartopy shape feature:
https://geocat-examples.readthedocs.io/en/latest/gallery/Overlays/NCL_overlay_11a.html#sphx-glr-gallery-overlays-ncl-overlay-11a-py

You might need to make a new land file that excludes area in the lake feature.

@hCraker
Copy link
Contributor Author

hCraker commented Aug 12, 2020

Here is an example of creating a custom cartopy shape feature:
https://geocat-examples.readthedocs.io/en/latest/gallery/Overlays/NCL_overlay_11a.html#sphx-glr-gallery-overlays-ncl-overlay-11a-py

You might need to make a new land file that excludes area in the lake feature.

I will look into that and see what I can do. Thanks for the link

@hCraker
Copy link
Contributor Author

hCraker commented Aug 13, 2020

@jukent I've been having issues trying to mask only the land masses and not the lakes using cartopy and natural earth shape files. I tried looking for a shape file that already had what I wanted, but I couldn't find one. We may want to merge this PR as is and work on creating an appropriate shape file later.

Copy link
Collaborator

@jukent jukent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a shape file for land sans lakes seems like appropriate for a separate geocat-viz issue.

Copy link
Collaborator

@erogluorhan erogluorhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@erogluorhan erogluorhan added the ready to merge Work and reviews are all finished and approved label Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Work and reviews are all finished and approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mask_2
7 participants