-
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
BUG #1947: isofill does not handle out of bounds levels correctly. #2027
Conversation
@doutriaux1 @aashish24 Please review. I did not add a new test here because we already had tests for this but they had wrong baselines. |
@doutriaux1 The confusing part here was that we color by the cell data generated by vtkBandedPolyDataContourFilter. These are the bands from 0 to len(l) - 1. But we can also color by the scalar in the original data - this is point data: this is what you've done in your PR, so that is why you had the fuzzy images. Your PR looked correct, but I did not understand initially how this was working before your change. I forgot about the bands generated by vtkBandedPolyDataContourFilter. |
c6ef91b
to
0c487ee
Compare
@danlipsa did you also test the last example I posted, I don't think this fixes it. import cdms2
import vcs
x=vcs.init()
f=cdms2.open("HadSST1870to99.nc")
s=f("sst")
print s.min(),s.max()
iso=x.createisofill()
iso.levels=[-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,35]
x.plot(s,iso) |
@doutriaux1 I run a selection in ParaView for all cells with scalar >= -6. This selects most cells - note ParaView does not show blanked cells because I save polygonal data which does not support blanking. This is the image generated by uvcdat - if you look carefully you'll see different colors at the top. So, I think the image is correct - it looks strange because most values are between -6 and 35. |
@doutriaux1 Actually, I think you are right, there is something going on here. Some black (the part that is shown blue here) should have been white. See the following image: |
@danlipsa yes that is odd. But at least the levels seem to be picked up correctly (on your first plot). I still don't see how it's possible from the code, but it seems to work. |
@danlipsa I merged |
0f26daa
to
e132a32
Compare
@doutriaux1 @aashish24 Please review. This solves all problems I know of. |
When smallest level is bigger than min scalar value or biggest level is smaller than max scalar value isofill creates the wrong image. Also, out of range (white color) was shown black.
e132a32
to
7211477
Compare
@danlipsa looks like it's working now. Thanks. But why do we do a |
@doutriaux1 putMaskOnVTKGrid needs to draw black (masked) any cell that has any points hidden. That is why I need pointtocell. You won't be able to do isolines/isofill for a point dataset. Both need interpolation which only works if you have cells - topology information. Otherwise the algorithm won't know which points to use for interpolation. |
@danlipsa I'm attaching a sample zipped nc file, that has coordinate info (lat/lon) but no bounds info (in CF format), vcs cannot plot it, but it should be able to, since we know the point data (lat/lon). It's definitely something for 3.0 anyway, just wanted to ask you about it now before I forget. |
@danlipsa I updated the baselines, it's good to be merged in as far as I'm concerned. If it's good with you as well, go ahead and merge please. |
When smallest level is bigger than min scalar value or biggest level
is smaller than max scalar value isofill creates the wrong image.