Stream: python-questions

Topic: GeoCAT plotting gallery


view this post on Zulip John Clyne (Jun 25 2020 at 00:22):

Hi All,

The GeoCAT team, with the help of some terrific summer interns, has been hard at work to expand the GeoCAT plotting gallery with documented examples that demonstrate how to plot geosciences data with Python, using Python packages such as Xarray, MatPlotLib, and Cartopy. We encourage you to check out the current gallery offerings:

https://geocat-examples.readthedocs.io/en/latest/

and would welcome suggestions for new plots. Most of the current plots are based on NCL examples, but ideas for novel plots are also encouraged.

The GeoCAT Team

view this post on Zulip Allison Baker (Jun 25 2020 at 16:17):

Do you have any that plot CAM-SE data?

view this post on Zulip John Clyne (Jun 26 2020 at 15:53):

Excellent question. Unfortunately the answer is no. Obviously CAM-SE data needs to be a priority for GeoCAT. We'd love to hear from anyone who has had experience plotting CAM-SE data using the Python ecosystem.

view this post on Zulip Stephen Yeager (Nov 18 2020 at 23:02):

What about GeoCAT examples for lat-lon contour plots of POP output that demonstrate how to deal with 2D curvilinear, non-monotonic mesh coordinates?

view this post on Zulip Matt Long (Nov 18 2020 at 23:04):

Not GeoCat, but this gist shows an approach to plotting contour plots on the POP grid:
https://gist.github.com/matt-long/50433da346da8ac17cde926eec90a87c

view this post on Zulip Allison Baker (Dec 21 2020 at 17:28):

Just following up to see if there is any progress on plotting CAM-SE data with GeoCAT tools? (Or other python tools)

view this post on Zulip John Clyne (Dec 22 2020 at 00:48):

There is a draft PR for an example that uses stock MatPlotLib to produce plots for both CAM-SE and MPAS-A grids here: https://github.com/NCAR/GeoCAT-examples/pull/264. @Orhan Eroglu may be able to comment about plans to clean this up and include it in the repo. However, it may still be useful to you in draft form. Note, the current example does not make use of a CAM-SE grid file, and simply uses Delaunay triangulation to triangulate the data. Obviously, it would be better to use the original grid if you have it. The MPAS examples included in this PR use the MPAS grid and might be a helpful reference.

Coincidentally, we're exploring submitting an Earth Cube proposal aimed at improving the tool landscape for visualizing/analyzing unstructured dat a from geoscience climate and weather models. Perhaps we should talk.

view this post on Zulip Allison Baker (Dec 22 2020 at 20:39):

Thanks - I'll take a look. It sounds similar to what I have tried (the Delaunay triangulation), and I think I may want to use the grid like MPAS, so that may be helpful! Yes let's talk about your proposal - you may be interested in out ldcpy tool: https://github.com/NCAR/ldcpy

view this post on Zulip Orhan Eroglu (Dec 24 2020 at 19:30):

Hi @Allison Baker our draft PR is yet to be finalized to merge into our repo, but MPAS grid with its current version may be of some use for you. We are turning our attention more to the unstructured grids recently, and as John mentioned, we are in the middle of a proposal plan. So, let us talk some time, probably in the new year (Though I am in office on December 28th and 29th)?

Btw, I skimmed through your ldcpy tutorial notebooks, and there seems to be a lot of useful metrics that we can utilize. I will have a deeper look. Thanks for sharing!

view this post on Zulip Stephen Yeager (Aug 09 2021 at 23:55):

Hi @John Clyne @Orhan Eroglu @Allison Baker , I'm curious if there's been any progress on plotting unstructured CAM-SE data using GeoCAT? I recently posted a question on this topic pointing to this example notebook: /glade/u/home/yeager/analysis/python/Robinson.ipynb
This showcases problems encountered using matplotlib+cartopy for generating fast CAM-SE map plots.

view this post on Zulip Orhan Eroglu (Aug 10 2021 at 15:37):

Hi @Stephen Yeager there is good news that we were awarded the Project Raijin, which will be our data analysis and visualization efforts on unstructured grids. It is expected to start around mid-October; I will keep you posted on that.

Other than that, honestly, we couldn't further our existing draft PR work in our gallery. That's because, as we mentioned previously in this topic, the capabilities and performance of existing Python packages (matplotlib + cartopy) are limited, and we aimed increasing our efforts with Project Raijin.

I will be sure to look into your notebook (/glade/u/home/yeager/analysis/python/Robinson.ipynb); however, I couldn't recall it was mentioned. Could you please remind me if there were specific points of yours on that?

view this post on Zulip Stephen Yeager (Aug 10 2021 at 16:34):

@Orhan Eroglu I started a new thread under python-questions ("Robinson plot of CAM ne120") before finding this discussion. The notebook is mentioned in the new thread and simply showcases different problems encountered when using matplotlib+cartopy to plot CAM-SE data (different projections generate different problems).

view this post on Zulip Orhan Eroglu (Aug 10 2021 at 16:54):

Ok, I thought it was our "GeoCAT plotting gallery" topic. I will check your topic, your work, and the notebook.

view this post on Zulip John Clyne (Aug 13 2021 at 01:27):

@Stephen Yeager have you tried using the CAM-SE grid file to explicitly triangulate your data? I would suspect that the Delaunay triangulation is struggling with degenerate triangles that occur under different projections.

Re "fast" plotting: for higher resolution grids I'd suggest looking at Datashader rather than Matplotlib. The former was designed for performance with larger data sets, the latter was most definitely not. The GeoCAT team should have a Datashader example with 3.75km global MPAS data soon, at least in the form of a PR.

view this post on Zulip Allison Baker (Aug 13 2021 at 16:52):

@Stephen Yeager I personally have not made any progress on this, but am still interested. I will take a look at the example notebook.

view this post on Zulip Max Grover (Aug 13 2021 at 16:55):

I plotted up an example of using that dataset using holoviews + datashader... would it be okay to post this as an example on an ESDS blog post? I will be sure to give proper credit for the dataset!

view this post on Zulip Max Grover (Aug 13 2021 at 17:51):

Here is a screenshot from the notebook, using geoviews + datashader Screen-Shot-2021-08-13-at-11.50.55-AM.png

view this post on Zulip Max Grover (Aug 13 2021 at 17:58):

@John Clyne do you have a good test file to use? Otherwise @Stephen Yeager is it okay if I use this one?

view this post on Zulip Stephen Yeager (Aug 13 2021 at 20:02):

@Max Grover This looks great, thanks! No problem using the dataset I was using--it's just an anonymous TREFHT field.

view this post on Zulip Max Grover (Aug 13 2021 at 20:04):

Here is the example notebook with some added documentation... any feedback would be greatly appreciated! I can chat with the GeoCAT team about getting this example into the gallery...

view this post on Zulip Stephen Yeager (Aug 13 2021 at 20:16):

I might suggest you add %%time to the key cells doing the heavy lifting, like the call to triangulate.

view this post on Zulip Max Grover (Aug 13 2021 at 20:17):

Oh good point - yeah I can add that there and in the actual plotting cell.

view this post on Zulip Max Grover (Aug 13 2021 at 21:53):

Here is the blog post! Thanks @Stephen Yeager and the GeoCAT team for the inspiration and data https://ncar.github.io/esds/posts/cesm-datashader/


Last updated: Jan 30 2022 at 12:01 UTC