Skip to content
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

Problems with 0.5 to -0.5 longitude grids #274

Open
durack1 opened this issue Nov 16, 2017 · 0 comments
Open

Problems with 0.5 to -0.5 longitude grids #274

durack1 opened this issue Nov 16, 2017 · 0 comments
Milestone

Comments

@durack1
Copy link
Member

durack1 commented Nov 16, 2017

I've just tried to plot up a variable using vcs and it appears to fall over with the longitude values which extend from

Out[13]: 
array([   0.5,    1.5,    2.5,    3.5,    4.5,    5.5,    6.5,    7.5,
...
         -7.5,   -6.5,   -5.5,   -4.5,   -3.5,   -2.5,   -1.5,   -0.5], dtype=float32)

The file plotted in vcs looks like:
171116_to
Whereas in ferret (admittedly correcting the plot colour ranges to deal with the badly defined missing values) it looks like:
171116_to-ferret

The example script to reproduce this (in vcs) is:

import os,vcs
import cdms2 as cdm

In [4]: fH = cdm.open('171116_to.nc')
In [5]: to = fH('to')
In [6]: to
Out[6]: 
to
masked_array(data =
 [[ 0.28999999  0.361       0.421      ..., -0.033       0.109       0.228     ]
 [ 0.27900001  0.331       0.377      ..., -0.009       0.103       0.20299999]
 [ 0.30000001  0.32499999  0.35600001 ...,  0.111       0.16599999  0.223     ]
 ..., 
 [ 4.70300007  4.96600008  5.19299984 ...,  4.25600004  4.65100002
   5.01399994]
 [ 3.69400001  3.95499992  4.19299984 ...,  3.70600009  4.0710001
   4.40399981]
 [ 2.33699989  2.60899997  2.88000011 ...,  2.78200006  3.10800004
   3.41199994]],
             mask =
 False,
       fill_value = 1e+20)
In [7]: x = vcs.init(bg=True,geometry=(800,600))
In [8]: x.plot(to)
/export/durack1/anaconda2/envs/uvcdat2120/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)
/export/durack1/anaconda2/envs/uvcdat2120/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)
Out[9]: 
In [9]: x.png('171116_to.png')
In [10]: to.getGrid()
Out[10]: 
Grid has Python id 0x7f368ff66d10.
Gridtype: generic
Grid shape: (132, 360)
Order: yx

The file and data required is attached below
171116_to.nc.zip

@doutriaux1 ping

@doutriaux1 doutriaux1 added this to the Next Release milestone Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants