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
Add streamlines. #138
Add streamlines. #138
Conversation
Associated PRs: |
@doutriaux1 @aashish24 Please review. |
@danlipsa shouldn't streamlines have arrows? |
This is one of the most recent beautiful picture I have seen from vcs @williams13 @doutriaux1 @danlipsa this looks very cool.... I have few questions but let me first look at the code and then I will ping . |
Has someone looked at the nice vcs based (not sure) streamlines in the vacumm package gallery? Somebody from our group used it last week.
Lots of great stuff in Stephane's package :-)
I'm in the train, so can't give you the exact link
…On March 6, 2017 5:19:22 PM GMT+01:00, Charles Doutriaux ***@***.***> wrote:
@danlipsa shouldn't streamlines have arrows?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#138 (comment)
--
JYP @ SGS 5
|
@jypeter it's http://www.ifremer.fr/vacumm/ - we had that as one of the supported packages when things were being built from source.. Since moving to conda this should also be available to users - the |
@doutriaux1 By default they don't, but I can add them. I can push something today or tomorrow. |
@danlipsa that would be nice, and I think we probably want the arrows on by defaults. Also as @chaosphere2112 mentioned it would be nice to have the color of the streamline determined by the speed/norm of the vector they follow. What do you think? |
@jypeter cool thanks for sharing the info. vaccum looks similar to matplotlib (mpl) but mpl has scaling issues meaning that it can only rendering so many streamlines. Also, not sure about the API (feature comparison wise). On this note, how did he implement streamlines in vcs? Is it using UV-CDAT 2.8? |
@danlipsa and I talked about coloring in general (as @danlipsa also mentioned it for vector plots as well). As for the color, I think we want to have color by a scalar, if we have arrows, then not sure we want to color by vector (direction of streamlines) although a vector could be applied for coloring (though will require a lookup table that works with vector). For now we could add color by scalar (vtk supports it). |
@glpotter this is great, thanks for sharing it. I would opt for one arrow (at least for now) since I think too many arrows make the plot crowded but having a option in the future for many arrows would be nice. As far the color goes, we already captured that in our discussions I think. |
@durack1 you can see the example streamline code and plot (plot attached below) from vacumm in the gallery: http://www.ifremer.fr/vacumm/tests/test_plot_streamplot.html Looks like it uses cdms2 for reading the data, and basemap for plotting |
@aashish24 @doutriaux1 Take a look at the new streamline plots with arrows added at seeding points. One improvement I can see is that the triangles for the arrows are positioned with the tip at the anchor point. To look better they should be positioned with the triangle center at the anchor point. I'll add colors next. |
vcs/streamline.py
Outdated
except: | ||
pass # oh well we stick to default value | ||
# Tl | ||
i = code.find("Tl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danlipsa you get yank out all the code for reading in streamlines from .scr files since they didn't exist before and we wont generate .scr files for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doutriaux1 That is 'process_src' isn't it? I'll do that - thanks!
@aashish24 One arrow head per streamline is not enough. The plots that @durack1 and I have attached are what we want to have. |
@glpotter I was suggesting that it would be good to have an option. I personally think too many arrows gets crowded and make a streamline plot looks closer to a vector plot. I would think having some flexibility there would be helpful. |
vcs/Canvas.py
Outdated
@@ -247,7 +247,7 @@ def _determine_arg_list(g_name, actual_args): | |||
arglist[igraphics_method].g_nslabs)) | |||
else: | |||
if arglist[igraphics_method].lower() in ( | |||
'scatter', 'vector', 'xvsy', 'stream', 'glyph', '3d_vector', '3d_dual_scalar'): | |||
'scatter', 'vector', 'streamline', 'xvsy', 'stream', 'glyph', '3d_vector', '3d_dual_scalar'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (109 > 79 characters)
vcs/Canvas.py
Outdated
@@ -1792,6 +1792,49 @@ def vector(self, *args, **parms): | |||
arglist = _determine_arg_list('vector', args) | |||
return self.__plot(arglist, parms) | |||
|
|||
|
|||
def createstreamline(self, name=None, source='default'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E303 too many blank lines (2)
vcs/Canvas.py
Outdated
|
||
def streamline(self, *args, **parms): | ||
""" | ||
Generate a streamline plot given the data, streamline graphics method, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (82 > 79 characters)
vcs/Canvas.py
Outdated
def streamline(self, *args, **parms): | ||
""" | ||
Generate a streamline plot given the data, streamline graphics method, and | ||
template. If no streamline class object is given, then the 'default' streamline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (87 > 79 characters)
vcs/Canvas.py
Outdated
""" | ||
Generate a streamline plot given the data, streamline graphics method, and | ||
template. If no streamline class object is given, then the 'default' streamline | ||
graphics method is used. Similarly, if no template class object is given, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (81 > 79 characters)
vcs/Canvas.py
Outdated
.. doctest:: canvas_streamline | ||
|
||
>>> a=vcs.init() | ||
>>> a.show('streamline') # Show all the existing streamline graphics methods |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (92 > 79 characters)
vcs/Canvas.py
Outdated
>>> a.show('streamline') # Show all the existing streamline graphics methods | ||
*******************Streamline Names List********************** | ||
... | ||
*******************End Streamline Names List********************** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (82 > 79 characters)
@danlipsa do you mind preparing a jupyter notebook on how to use streamlines (with various options explained)? Thanks. |
@doutriaux1 the opacity problem visualized above was created with |
@aashish24 @danlipsa among other verified issue with latest vtk most vtk_ui tests fail to draw lines |
@danlipsa your baseline and the ones I run on my nox are widely different. Which machine did you generate the baselines on? Mac? |
@danlipsa also I notice there's no legend associated with streamlines. @glpotter @williams13 is that an issue? Is there legends for streamlines? |
@danlipsa ok this is weird, if i run your test as follow: python /git/uvcdat/testing/vcs/test_vcs_basic_gms.py --source=./uvcdat-testdata/baselines/vcs/test_vcs_basic_streamline_transparent.png --gm_type=streamline --transparent it passes, gm list gives:
if I run it inside nose, it fails but the gm list is identical!
gives:
files are: |
I’m not sure how you could tell the magnitude if there aren’t.
Gerald L. (Jerry) Potter Ph.D.
Data and Analysis Consultant
Phone: 707 315-8314
email: jerry.potter@gmail.com
… On Mar 27, 2017, at 2:45 PM, Charles Doutriaux ***@***.***> wrote:
@danlipsa <https://github.com/danlipsa> also I notice there's no legend associated with streamlines. @glpotter <https://github.com/glpotter> @williams13 <https://github.com/williams13> is that an issue? Is there legends for streamlines?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#138 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ANjM_DDWoEHolZlllZm3_bkrxfCh0ZxPks5rqC4EgaJpZM4MS1O4>.
|
+1 but Let's do it after we fix the circleci and any other issues that are pending for the release. |
this is a good point. I would add a legend only if we have colors that represents a scalar. wha you think @danlipsa @doutriaux1 would it be okay if @danlipsa push that a separate PR? Or should be do in the same PR. I think the change might be small enough so I am fine either way. |
So are you saying that at point the vtk_ui tests started failing. But how that is related to this branch? If the new VTK is available in VCS / UV-CDAT master and if the tests are failing then I think we should file a bug and fix it separately since this branch or the VTK used by this BRANCH didn't break it (it was broken before). If the VTK this branch is bringing is causing the VTK_UI tests to fail, then we have some issue. Although I think @chaosphere2112 disable few things from the vtk_ui but I do not remember all the details. |
@doutriaux1 @glpotter @williams13 @aashish24 There is a legend associated with streamlines colored by velocity magnitude. If there the streamlines are just one color there is no legend. |
Do you have a link with other jupyter notebook examples? Are they linked from the main uvcdat page? I was thinking to add an example to the Galery. |
@doutriaux1 With the new commits I have only these tests failing on my machine (Ubuntu 16.04). |
@doutriaux1 Note I have 2 extra fixes (from Sam and Sankhesh) in my branch which you have in your branch as well. |
@doutriaux1 @aashish24 I would merge this into master and go onto fixing the remaining issues there. This way, you can build conda nightly and people can test streamlines. What do you think? |
@danlipsa for jupyter notebook examples see: |
@aashish24 i agree that @danlipsa code did not break the ui, but this branch requires a VTK that breaks a few things. I'll open a separate issue. |
@doutriaux1 @aashish24 All vtk_ui pass on my machine with the new VTK (Ubuntu 16.04). |
@danlipsa does the current test suite include an opacity test? |
@durack1 There are several transparency/opacity tests that pass, but they might test something different than what you've seen: 100% tests passed, 0 tests failed out of 4 How can I reproduce your test? Is it the same script/data as in |
@danlipsa yep the #121 data and example is what you'd need.. The example above also pulls in the EzTemplate to plot the dual panels.. I've just had some system problems, but could forward you the script if it was helpful |
@durack1 Yes, please attach the script here so that I can compare with what you get. |
@doutriaux1 should that script (demo requested by @danlipsa above) go in another open issue? |
@durack1 Its fine to add it here. |
No description provided.