-
Notifications
You must be signed in to change notification settings - Fork 68
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
Compute vector scaling correctly #1988
Conversation
7836cd2
to
2095654
Compare
VTK does clamping and not remapping of input range to desired range which leads to undesirable visual effects.
2095654
to
1129e5b
Compare
@danlipsa @doutriaux1 please review |
Ref #1977 |
# [min, max] --> [0, 1]. | ||
glyphFilter.ClampingOn() | ||
glyphFilter.SetRange(0.01, 1.0) | ||
|
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.
It seems the original problem was triggered by this code. By clamping everything to 1, you end-up with vectors of the same size. I'll post an image generated with this code commented out.
I love the flies swarming look to this! |
@danlipsa yes, all of these problems are fixed in my PR. Please have a look at the new baselines and my commit message on the source of the problem. |
@aashish24 Why do you need to compute another scalar? You could use ScaleByVector isn't it? |
@aashish24 @doutriaux1 After a discussion with @aashish24 this LGTM as long as users know/are OK with a vector magnitude range remapping to hard-coded [0.1:1]. In the future we'll add options to vcs to show data as is, clamp it low and high, use linear rescalling (what @aashish24 does), use logarithmic rescalling. |
@danlipsa and I had a good conversation about it and I pointed out that there are few API parameters are missing at this point. I would like to propose those changes post 2.6 release. The options will be
For now, this branch takes care of the vector appearing of the same size because of clamping and keeping the old look and feel for most part. |
Forgot to mention that I am okay with taking out the linear range mapping from this branch (or have it not exposed) too, although that means that I would need to look into the uniform scaling factor more closely. |
Indeed this was a good discussion - we clarified the trade-offs for each approach and a path for fixing this properly. With @doutriaux1 input we can make a choice for the 2.6 release. I am also fine with either path we choose. |
@aashish24 while you're at it, we need to add the legend for vectors. use |
@doutriaux1 @danlipsa I am adding few options to the graphic method, I will push my changes today. |
@aashish24 thanks! Let me know when I can pull the trigger on a build. |
742681d
to
12dbc57
Compare
@doutriaux1 this branch is ready for another review. Please let me know if you have better names for the options. |
@@ -528,6 +535,26 @@ def _setalignment(self, value): | |||
self._alignment = value | |||
alignment = property(_getalignment, _setalignment) | |||
|
|||
|
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.
@aashish24 I would rather the set/get function to be in VCS_Validation functions, just in case we ever need to re-use it for something else and have here
scalerange = VCS_validation_functions.scalerange
see colormap above for example.
@aashish24 I made a few comments, building locally. |
@aashish24 see: https://open.cdash.org/viewTest.php?onlyfailed&buildid=4385643
|
thanks @doutriaux1. test_vcs_vectors_scale_options is failing because I didn't have bg=1 but all other ones are failing not because of my branch. |
@aashish24 how come the test suite got dirtied then? I though your new test suite had everything cleaned up? Beside some of these test do not fail on @danlipsa branch. |
5efb441
to
c8befa3
Compare
e645cf3
to
e3f7ede
Compare
@doutriaux1 I added the vector method to the dump json test and made sure that it is correct. Please have a look at the branch now. |
@doutriaux1 I don't know as some of these are not failing on my machine. I am doing a clean build of CDAT just to be sure. The DV3D tests are failing because of some key error. Some of the diagnostic tests are failing because of color map issues. Two of them might be failing because i made the bg=1 default if not specified. |
On master, I have these tests failing: The following tests FAILED: |
@aashish24 switching to the system python from the brew one (and rebuilding uvcdat) fixed the dv3d_ tests for me. What are the generated files for the stipple tests? |
@danlipsa let's file another bug issue and carry discussion on failing tests there. I will post information there. |
@aashish24 fine with me. |
thanks @danlipsa. @doutriaux1 if you have any other concern, I will make sure to address them quickly. |
rebuilding from scratch, will let you know. |
@aashish24! Really! How quicker could I have been! |
VTK does clamping and not remapping of input range to desired
range which leads to undesirable visual effects.