I am testing uvcdat 2.10 with currently displayed examples on gallery.
Target:
https://raw.githubusercontent.com/UV-CDAT/UV-CDAT_scientific_examples/master/plots/example_850mb_rh_ts_gph_jja_clim.png
However I am not able to reproduce this example which plots vector for sub region.
Below script is simple version of above example, including only vector part.
import vcs
import cdms2 as cdms
var = 'ua'
odir = '/cmip5_css02/data/cmip5/output1/NIMR-KMA/HadGEM2-AO/historical/mon/atmos/Amon/r1i1p1/'+var+'/1/' # Provide your data directory
nc = var+'_Amon_HadGEM2-AO_historical_r1i1p1_186001-200512.nc'
f = cdms.open(odir+nc)
u = f(var,lev=85000,time=slice(0,1))
f.close()
var = 'va'
odir = '/cmip5_css02/data/cmip5/output1/NIMR-KMA/HadGEM2-AO/historical/mon/atmos/Amon/r1i1p1/'+var+'/1/' # Provide your data directory
nc = var+'_Amon_HadGEM2-AO_historical_r1i1p1_186001-200512.nc'
f = cdms.open(odir+nc)
v = f(var,lev=85000,time=slice(0,1))
f.close()
# Set ploting range ---
lat1=-60
lat2=80
lon1=0
lon2=360
x = vcs.init()
vec = vcs.createvector()
vec.datawc_x1 = lon1
vec.datawc_x2 = lon2
vec.datawc_y1 = lat1
vec.datawc_y2 = lat2
x.plot(u,v,vec)
x.png('test.png')
Error occurs at below part. Without having below part, the script works with no error.
vec.datawc_x1 = lon1
vec.datawc_x2 = lon2
vec.datawc_y1 = lat1
vec.datawc_y2 = lat2
Error message given as below:
/export_backup/lee1043/anaconda2/envs/uvcdat-nightly/lib/python2.7/site-packages/numpy/ma/core.py:3349: MaskedArrayFutureWarning: setting an item on a masked array which has a shared mask will not copy the mask and also change the original mask array in the future.
Check the NumPy 1.11 release notes for more information.
self.__setitem__(slice(i, j), value)
Traceback (most recent call last):
File "test_vector.py", line 32, in <module>
x.plot(u,v,vec)
File "/export_backup/lee1043/anaconda2/envs/uvcdat-nightly/lib/python2.7/site-packages/vcs/Canvas.py", line 2690, in plot
a = self.__plot(arglist, keyargs)
File "/export_backup/lee1043/anaconda2/envs/uvcdat-nightly/lib/python2.7/site-packages/vcs/Canvas.py", line 4019, in __plot
returned_kargs = self.backend.plot(*arglist, **keyargs)
File "/export_backup/lee1043/anaconda2/envs/uvcdat-nightly/lib/python2.7/site-packages/vcs/VTKPlots.py", line 680, in plot
vtk_backend_grid, vtk_backend_geo, **kargs))
File "/export_backup/lee1043/anaconda2/envs/uvcdat-nightly/lib/python2.7/site-packages/vcs/vcsvtk/pipeline2d.py", line 300, in plot
vectors.GetRange(self._vectorRange, -1)
AttributeError: 'NoneType' object has no attribute 'GetRange'
I am testing uvcdat 2.10 with currently displayed examples on gallery.
Target:
https://raw.githubusercontent.com/UV-CDAT/UV-CDAT_scientific_examples/master/plots/example_850mb_rh_ts_gph_jja_clim.png
However I am not able to reproduce this example which plots vector for sub region.
Below script is simple version of above example, including only vector part.
Error occurs at below part. Without having below part, the script works with no error.
Error message given as below: