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

Gibs python use cases #30

Merged
merged 11 commits into from
Dec 17, 2024
Merged

Gibs python use cases #30

merged 11 commits into from
Dec 17, 2024

Conversation

grallewellyn
Copy link
Contributor

@grallewellyn grallewellyn commented Dec 10, 2024

Relevant use cases we identified in our ticket that I implemented in this PR:

Other notes:

I verified that mapping wmts raster data with cartopy gives the same result as creating the jpg with gdal_translate from the .xml file.

Unfortunately, the animated gif example cannot be rendered in the docs page like the existing ipyleaflet example

I know you can’t see the changes from Git in this PR, but I like ReviewNB for looking at changes to notebooks

@jtroberts I wasn't sure who else to add as a reviewer for this PR

@grallewellyn grallewellyn assigned jtroberts and unassigned jtroberts Dec 10, 2024
@grallewellyn grallewellyn requested review from jtroberts and grabermtw and removed request for jtroberts December 10, 2024 17:42
@grallewellyn
Copy link
Contributor Author

grallewellyn commented Dec 10, 2024

We decided in the GITC standup meeting that Alex and Matt would be the best to review
No rush @grabermtw with AGU this week

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@grallewellyn
Copy link
Contributor Author

I made the following updates suggested by Joe:

  • Should change reproject to instead use EPSG:9822
  • Note for ipyleaflet and animated example that it won't render
  • swap Visualize WMTS Raster Data By Cartopy to be above Visualize WMTS Raster Data By GDAL
  • For overlaying example, use GHRSST_L4_MUR_Sea_Surface_Temperature instead of VIIRS
  • Make raster cropping better resolution by increasing size=(1200, 600), for global extents tiff
  • "NOTE The available options for the format parameter are: image/png, image/tiff, image/jpeg" should be in a comment instead of a markdown cell

@jtroberts I tried to fix the properties about a tiff file cell with rasterio, but when I download the request to

https://gibs.earthdata.nasa.gov/wms/epsg4326/best/wms.cgi?version=1.3.0&service=WMS&request=GetMap&
format=image/tiff&STYLE=default&bbox=-90,-180,90,180&CRS=EPSG:4326&
HEIGHT=512&WIDTH=512&TIME=2021-11-25&layers=MODIS_Terra_SurfaceReflectance_Bands143

rasterio.open gives me height, width as 512 x 512 which is different than the 163840 x 81920 you said it should be. This is probably because the url requests height and width as 512. Do we still want to include the rasterio properties example?

Also, this is what the new reprojected image looks like:
Screenshot 2024-12-12 at 9 20 35 AM
It is EPSG:3857 to EPSG:9921

@jtroberts
Copy link
Member

rasterio.open gives me height, width as 512 x 512 which is different than the 163840 x 81920 you said it should be.

That makes sense given that you specified HEIGHT=512&WIDTH=512. I would change WIDTH=1024 to keep the image in the correct proportion. In that case, the expected output size should be 1024 x 512.

It is EPSG:3857 to EPSG:9921

How about we use EASE Grid instead since it is a more common equal-area global projection? So EPSG:3857 to EPSG:6933.

@grallewellyn
Copy link
Contributor Author

That makes sense given that you specified HEIGHT=512&WIDTH=512. I would change WIDTH=1024 to keep the image in the correct proportion. In that case, the expected output size should be 1024 x 512.

Okay made that change

Okay, I changed to EPSG:6933 and this is the reprojected image
Screenshot 2024-12-12 at 11 37 56 AM

Copy link
Member

@jtroberts jtroberts left a comment

Choose a reason for hiding this comment

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

Changes look good to me! My last suggestion is to render that reprojected image in the notebook for reference but not a big deal.

@grallewellyn
Copy link
Contributor Author

Added showing the reprojected image to the notebook

Copy link
Contributor

@grabermtw grabermtw left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jtroberts jtroberts requested a review from apdeluca December 17, 2024 00:56
@grallewellyn grallewellyn merged commit f2dd2bd into main Dec 17, 2024
@grallewellyn grallewellyn deleted the GIBS-python-use-cases branch December 17, 2024 17:34
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

Successfully merging this pull request may close these issues.

3 participants