-
Notifications
You must be signed in to change notification settings - Fork 42
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
Curly vector plot #314
Comments
Hi Francis, |
Hello,
Thanks for replying !
I am only aware of this try by Kieran Hunt (U. Reading):
https://github.com/kieranmrhunt/curved-quivers
Which is I think a modification of standard MPL streamlines. I am not sure
if it can be made to work with maps. It was inspired by this stackoverflow
thread :
https://stackoverflow.com/questions/51843313/flow-visualisation-in-python-using-curved-path-following-vectors
Otherwise the curly vect seems pretty unique to NCL...
I'm attaching the figure of IPSL currents in the Arctic so you see what I
mean, perfect for ocean eddies too !
Thanks,
Francis
[image: Arctic.png]
…On Wed, Mar 3, 2021 at 10:17 PM Michaela Sizemore ***@***.***> wrote:
Hi Francis,
I don't think there is an explicit plan in place for implementing the
curly vector, but it could become part of later releases of GeoCAT
software. I've been looking into if there is an already established Python
version for curly vectors and it looks like currently the closest would be
streamlines (which as you probably know, is slightly different than the
curly vector from NCL). I'll bring this issue up with the rest of the team
later this week and see what they think about it and get back to you then!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#314 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATAQFLMOC7YCCL7COPSNVSTTB2RM3ANCNFSM4YKBS62Q>
.
|
@fcodron I've just been assigned to look into this. Could you in your own words (or with a sketch) show what you'd be looking for in a curly vector plot? |
Hello, Nice to hear you'll get into this ! Curly vectors are originally part of NCL visualization (don't know about IDL), where it's an option in vector plots. You can see an example image here : https://www.ncl.ucar.edu/Applications/Images/vector_4_lg.png The script used to create the figure is https://www.ncl.ucar.edu/Applications/Scripts/vector_4.ncl (key argument is the @vcGlyphStyle = "CurlyVector" option). The python "translation" here https://geocat-examples.readthedocs.io/en/latest/gallery/Vectors/NCL_vector_4.html#sphx-glr-gallery-vectors-ncl-vector-4-py I am not sure how exactly curly vectors were coded in NCL; they have a good documentation online but not the source code. At first glance it seems indeed similar to streamlines plot (streamplot), but with arrows at the end and a a length scaled by magnitude. I guess there would be defaults or options for density, scaling, and non-overlapping conditions. Some attempts for implementation are described in the stackoverflow discussion above, but ideally these would work also with map projections (Cartopy...). I think these curly vectors are particularly useful when the flow is constrained by borders, like ocean currents following (but not crossing) the coast. Francis |
the notes on the image are:
This seems to be what the ncl plot is doing. |
Hello, Your explanation sounds good ! Apart from the "cute" factor, I find that curly vectors are quite useful to get a good representation of the flow when there are large speed (shear) or direction (curvature) variations, that will be poorly sampled by a vector field. For example, there are often strong currents along coastlines; the curly / stream function representation will show the current following the coast, including around capes or bays, while vectors will have big arrows in different directions (depending on the grid and sampling), that will sometimes go into the continent... Here is another example map in the Arctic (left). And of course there are the beautiful NASA videos at Francis |
My vote for curly vectors! Cheers |
+1 curly vectors have been a much desired plotting for a long while in Python; would make a great addition -GeoCAT-examples (and maybe -viz) |
Yeah, it does seem like there's a good bit of interest in this type of plot and not a lot in terms of Python solutions. Unfortunately, pyngl relies upon NGL for this and there's not an out-of-the-box solution over in matplotlib (see matplotlib/matplotlib#20038), but perhaps that's all the more reason to address it in geocat-viz? There is an open issue over there as well in NCAR/geocat-viz#4. |
Hello,
Is there any plan to implement "curly vector" plots in some way for "standard" Python (matplotlib, cartopy...) ?
I guess through a modification of streamlines ?
This plot type is fairly unique to NCL (as far as I know), and very useful especially for oceanography plots, where strong currents tend to flow along the coastlines, and vectors ending over land are not very nice...
Thanks,
Francis
The text was updated successfully, but these errors were encountered: