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

Coordinates displayed in interactive mode are not good (2.12 and earlier) #251

Closed
jypeter opened this Issue Sep 11, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@jypeter

jypeter commented Sep 11, 2017

@doutriaux1 when you plot something and then use x.interact() in order to be able to click on the canvas and see the coordinates of the point you are clicking on, you can get slightly or really wrong coordinates. There is probably a wrong scaling factor, because:

  • you seem to get correct coordinates if you click on the lon=0, lat=0 point
  • the problem gets worse if you use ratio='autot'

I have used the lines at the bottom to generate 2 plots and then get screenshots when I was clicking on the bottom left corner (lon=-180, lat=-90). I have reported the bonus MaskedArrayFutureWarning in CDAT/genutil#14

The coordinates are wrong, but I think the reported values are correct. But you would have to plot some dummy data in order to really check that

Clicking when plotting the whole data
vcs_coord_pb_autot_a

Clicking when zooming on the data with bf.datawc(-90, 90, -120, 0)
vcs_coord_pb_autot_b

Clicking when plotting the whole data and NOT using autot
vcs_coord_pb_no-autot

>>> import cdms2, vcs
>>> f = cdms2.open(vcs.sample_data + '/clt.nc')
>>> clt = f('clt', time=slice(0,1), squeeze=1)
>>> x = vcs.init()
>>> bf = x.createboxfill()
>>> x.plot(bf, clt, ratio='autot')
/home/share/unix_files/cdat/miniconda2/envs/cdatm16/lib/python2.7/site-packages/numpy/ma/core.py:6385: MaskedArrayFutureWarning: In the future the default for ma.maximum.reduce will be axis=0, not the current None, to match np.maximum.reduce. Explicitly pass 0 or None to silence this warning.
  return self.reduce(a)
/home/share/unix_files/cdat/miniconda2/envs/cdatm16/lib/python2.7/site-packages/numpy/ma/core.py:6385: MaskedArrayFutureWarning: In the future the default for ma.minimum.reduce will be axis=0, not the current None, to match np.minimum.reduce. Explicitly pass 0 or None to silence this warning.
  return self.reduce(a)
<vcs.displayplot.Dp object at 0x2af9b8161a10>
>>> x.interact()
/home/share/unix_files/cdat/miniconda2/envs/cdatm16/lib/python2.7/site-packages/vcs/VTKPlots.py:129: UserWarning: Press 'Q' to exit interactive mode and continue script execution
  "Press 'Q' to exit interactive mode and continue script execution")
>>> x.clear()
>>> bf.datawc(-90, 90, -120, 0)
>>> x.plot(bf, clt, ratio='autot')
<vcs.displayplot.Dp object at 0x2af9b8161b48>
>>> x.interact()

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Sep 11, 2017

@jypeter I will take a look right away

@doutriaux1 doutriaux1 added this to the 3.0 milestone Sep 11, 2017

@doutriaux1 doutriaux1 added the bug label Sep 11, 2017

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Feb 21, 2018

@danlipsa this is all done in VTK these days. And indeed using ratio=autot leads to completely off values. Mind to take a look. It's coming from VTKPLot.py around line 234

@doutriaux1

This comment has been minimized.

Member

doutriaux1 commented Feb 21, 2018

nevermind I found the issue.

doutriaux1 added a commit that referenced this issue Feb 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment