-
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
Fixed doWrap method for vectors #1602
Conversation
@doutriaux1 @sankhesh please review. @doutriaux1 how can I create a test that will force the code to duplicate the data? |
@williams13 if this works, this should fix all of the remaining issues with vector plots and projection. Please test it when you get a chance |
Will do! Thanks! From: Aashish Chaudhary <[email protected]mailto:[email protected]> @williams13https://github.com/williams13 if this works, this should fix all of the remaining issues with vector plots and projection. Please test it when you get a chance — |
@doutriaux1 all of the tests are passing. |
@aashish24 please add a test for it. How do you even know it works if you didn't test it? import cdms2
f=cdms2.open(file)
s=f(data,longitude=(0,360)) |
@aashish24 also your commit quality wasn't what you used us to. No description of what you changed and why. A bit disappointed here 😉 |
@aashish24 I just add a test that shows it is still broken. Run the file with either |
:) The changes I made should be obvious and since the other lines were not commented, I didn't comment new lines. I am planning to update these classes in the future. |
@doutriaux1 ah.. thanks for the test. that was my other question. |
@doutriaux1 your original test code is buggy, you are getting clt for both u and v. If I modified your code to get the actual vectors, I am getting the right plot. Here is the code: import cdms2
import vcs
import os
import sys
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
# -180 failks as well
lon1 = -180
u=f("u")
v=f("v")
u=u(longitude=(lon1,lon1+360.))
v=v(longitude=(lon1,lon1+360.))
x=vcs.init()
Vec = x.createvector()
p = x.createprojection()
p.type = "mercator"
Vec.projection = p
x.plot(u,v,Vec)
raw_input("press enter") |
Now I used the mercator. With Polar, I think vector plot will be really bad in general but I think that's a separate issue which I believe I mentioned earlier that vector plot in polar coordinates may require some more work. |
197a623
to
cb57da0
Compare
d214689
to
60add48
Compare
@doutriaux1 fixed the scaling issue that was causing vectors not to show up in polar coordinates. |
Goes with: CDAT/uvcdat-testdata#74 |
@doutriaux1 @sankhesh please approve |
@aashish24 my original code was NOT buggy, "u" and "v" are wrong in this file and do not get wrapped around by cdms2. Which is why I used "clt" twice, we don't care about how realstic the test is, only that is reproduces the features we are trying to fix. |
@aashish24 you need to at least flake8 it. I will review your test because I'm worried your change to "u" and "v" actually prevents it from reproducing the bug we are trying to fix. |
@doutriaux1 just using CLT twice would not produce any reasonable vectors. I don't understand why we cannot use u and v? for all other tests aren't we using u and v? I was able to reproduce the bug if I don't fix the scale factor. In case of POLAR coordinates the scales were off. |
@doutriaux1 I will fix the style issue. I didn't see them on garant and that's why I thought all is good. |
@doutriaux1 thanks. Is it possible to use better data? If we use clt twice then when projected, vectors will be drawn really bad or not drawn at all. |
Removed unused import
57798b8
to
60da528
Compare
@doutriaux1 flake8 should be fixed now (had unused import). Also, I tried with clt (for both u and v) works for me. Once you look at it, I can update the test to use clt |
Okay, tested with clt, vectors look awful but the code seems to be working. @doutriaux1 please let me know if the code is still broken. I saw another issue (not with vectors but with continental lines). |
@doutriaux1 should be all good. Please review. |
@doutriaux1 ping! |
@aashish24 catching up... slowly... |
@aashish24 still fails for ploar is that expected you say? |
Fixed doWrap method for vectors ok let's revisit the polar in another issue
@doutriaux1 if you use just clt and polar, yes since it will spread them weirdly. If i just use u and v (no wrapping) it does look reasonable but please have a closer look at polar one. All other projections looks great to me. |
@doutriaux1 thanks 👍 😄 : |
No description provided.