Support unstructured plotting#4080
Conversation
|
Interesting... |
Is that interesting? In my experience CI containers have the absolute minimum installed. It's caused me no end of problems in the past. It is easy enough to have Nox install such a thing? |
|
@trexfeathers We may simply need to use our own custom container on CI with the appropriate system dependencies installed. That should be relatively straight forward. Or there may be something what we can use out-the-box... just needs a little bit of research - and I'm on that 😉 This is not something to be configured at the I just need to explore some options. This was always going to come up sooner or later, hence why I was keen to push this to understand any early issues. |
|
Ohhh this looks like just the very thing we need https://cirrus-ci.org/guide/docker-builder-vm/#dockerfile-as-a-ci-environment 😍 🥳 🚀 |
|
Correct me if I'm wrong:
|
|
@trexfeathers Clearly, yes. It's a dependency requirement. That's why ultimately we don't want This is exactly the same for any similar package, such as We still need to separate concerns here, to make |
pp-mo
left a comment
There was a problem hiding this comment.
Just a few initial tiny comments FYI.
I haven't really got to the core of this yet...
Loving it so far though 😁
b1f1b32 to
48f7024
Compare
|
In the C48 SST Spherical with NaN Threshold example above, am I seeing Australia on the back side of the sphere showing through Africa? |
|
@jamesp i've thresholded the NaN out, just for effect... the user can control whether this happens or not... but yeah, you can see through the holes to the antipode mesh underside. Trippy, huh? |
|
@trexfeathers I don't want to use anything from Also, the treatment of wrapping is all going to change as a first step after this PR, as we need a more robust treatment of tearing and re-joining the connectivity for any So at this point, this doesn't have to be bullet proof... well, that's what I was aiming for. I'll add a comment to the code that reflects this better 👍 |
|
Ping @jamesp I've also now got smoother slider rendering of the scene, and the cell picking is connected to the slider and auto-updates... so essentially you can do a quick-viz interactive zonal min/max/mean of anywhere. Also, now you can cell pick over NaNs, which wasn't working before. Note that the (This point of all of this is to garner feedback from users - it's all customisable, and pretty much anything-ish is possible - but I just want something that is ball-park useful) |
|
BTW I also have texture mapping up my sleeve... and it's looking really, really good. This will allow you to wrap (texture map) any raster image over the mesh geometry... be that a hi-res image of the Earth or a picture of your favourite pet 😉 ... then you can plot cube mesh data over the texture map to complete a really rich visualisation. So imagine the above two plots, but with the grey masked NaN land regions replaced with something like https://github.com/pyvista/pyvista/blob/master/pyvista/examples/2k_earth_daymap.jpg. The reason why it's not included here is that after a bit of research I discovered that you need to create an overlapping seam in the connectivity, otherwise you end up with texture mapping smearing across meridian cells due to texture mapping interpolation. Now I know what to do, I just need to do it... at that point we can make texture mapping available as an initial plotting feature. |
|
Can confirm all of @pp-mo's comments are now addressed. I'm currently attempting a full review of everything that's here. It's all a bit new to me so may take a few hours. |
|
@trexfeathers Here's an early bird example of texture mapping, but with interpolation smearing. Note that there is unwanted color blending of the data with the texture map within a cell, but this is easily remedied. I've also used a kdtree to fast find the 180th meridian cells and drawn a path (white liine) from the north pole round to the south pole on the 180th meridian. Note the texture map smearing in the immediate eastern cell, due to interpolation. The approaches to fix this are to either not have a fully connected mesh i.e., a minuscule tear (:-1:), or have an overlapping mesh with a seam i.e., duplicate cell node points at the 180th meridian (:+1:). |
c81d97e to
3c2ce5c
Compare
c866d2f to
f1b497a
Compare
|
@bjlittle just shout when you're done with the CI experiments and I will merge. |
b3ea699 to
7c308ee
Compare
@trexfeathers I'm going to take you at your word, and you have also explicitly approved this PR 👍 |



🚀 Pull Request
Description
This PR introduces
pyvistaplotting support of unstructured UGRID meshes.This is an initial foray into visualisation of unstructured meshes to garner feedback. I suspect it will strongly seed the conversation and direction that we may or may not take, but it certainly showcases the potential of what could possibly come.
That said, it is highly experimental code, so I've not invested any time in testing, other than to confirm visually and functionally that it's doing what I intended. And that's okay by me (for now).
This PR also includes the extra dependencies to support
pyvista, but I've also included the colorcet and the gorgeous cmocean perceptually uniform colormaps.Why use more words, when I can let the plotting do the talking...
C48 SST Mollweide
C48 SST Mollweide with Threshold >295K
C48 SST Spherical
C48 SST Spherical with NaN Threshold
C48 SST Spherical Interactive
Consult Iris pull request check list