Skip to content

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

@jypeter

Description

@jypeter

@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()

Metadata

Metadata

Labels

bughighHighest priority issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions