<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi Arlindo,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I am experiencing the same problem with python returning AttributeError: 'NoneType' object has no attribute 't'. I'm on the latest version of pygrads version 1.1.8. </div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I'm trying to work through the following example.</div><div style="font-family:arial,sans-serif;font-size:13px">
<pre style="white-space:pre-wrap;background-color:rgb(249,249,249);padding:1em;line-height:1.1em;border:1px dashed rgb(47,111,171)"> [] ga-> clear
[] ga-> uv = ga.exp('ua*ua+va*va')
[] ga-> speed = sqrt(uv)
[] ga-> dd speed</pre><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"> I looked into it and I believe the issue is when you execute the </div>
<div style="font-family:arial,sans-serif;font-size:13px">speed = sqrt(uv) command of the example. I believe the sqrt function is not properly instantiating the GaGrid object by not passing it the GaHandle object or by not setting the meta data after instantiating the GaGrid object.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">If you look at the uv object you see that the associated meta data is set, but when you look at the speed object its not set. Here is an example of what I am seeing.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>Successfully opened <Contents/Resources/SampleDatasets/model.ctl> as File 1</div><div>
<br></div><div> [1] ga-> uv = ga.exp('ua*ua+va*va')</div><div>/usr/lib/python2.6/site-packages/pygrads-1.1.8-py2.6.egg/grads/numtypes.py:131: DeprecationWarning: object.__init__() takes no parameters</div><div>
ma.MaskedArray.__init__(self,data, **kwargs)</div><div><br></div><div> [2] ga-> speed = sqrt(uv)</div><div><br></div><div> [3] ga-> uv.grid</div><div> Out[3]: <grads.numtypes.GaGrid at 0x29fe890></div><div>
<br></div><div> [4] ga-> speed.grid</div><div> Out[4]: <grads.numtypes.GaGrid at 0x29fea10></div><div><br></div><div> [5] ga-> uv.grid.denv</div><div> Out[5]: </div><div><grads.gahandle.GaHandle object at 0x29fe990></div>
<div>==================================</div><div> Handle name = dims</div><div>==================================</div><div> xi = (1, 73)</div><div> ei = (1, 1)</div><div> zi = (1, 1)</div><div> rank = 2</div>
<div>e_state = fixed</div><div> ti = (1, 1)</div><div> tyme = [datetime.datetime(1987, 1, 1, 0, 0), datetime.datetime(1987, 1, 1, 0, 0)]</div><div> lon = (0.0, 360.0)</div><div> ne = 1</div><div> nx = 73</div>
<div> ny = 46</div><div> nz = 1</div><div> ens = ('1', '1')</div><div> rc = 0</div><div> dfile = 1</div><div> nt = 1</div><div> yi = (1, 46)</div><div>t_state = fixed</div><div>z_state = fixed</div>
<div>x_state = varying</div><div> lev = (1000.0, 1000.0)</div><div> lat = (-90.0, 90.0)</div><div>y_state = varying</div><div> e = (1, 1)</div><div> name = dims</div><div> t = (1, 1)</div><div> time = ('00Z01JAN1987', '00Z01JAN1987')</div>
<div> y = (1.0, 46.0)</div><div> x = (1.0, 73.0)</div><div> z = (1, 1)</div><div><br></div><div><br></div><div> [6] ga-> speed.grid.denv</div><div><br></div><div> [7] ga-> uv.grid.lat</div><div> Out[7]: </div>
<div>array([-90., -86., -82., -78., -74., -70., -66., -62., -58., -54., -50.,</div><div> -46., -42., -38., -34., -30., -26., -22., -18., -14., -10., -6.,</div><div> -2., 2., 6., 10., 14., 18., 22., 26., 30., 34., 38.,</div>
<div> 42., 46., 50., 54., 58., 62., 66., 70., 74., 78., 82.,</div><div> 86., 90.], dtype=float32)</div><div><br></div><div> [8] ga-> speed.grid.lat</div><div><br></div><div> [9] ga-> </div></div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thus when you try to import speed it crashes because the meta data it needs to do the import is missing. </div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Kenneth</div><div class="" style="font-family:arial,sans-serif;font-size:13px"></div></div>