#24 Isosurface fails with numarray

open
nobody
None
5
2014-08-15
2006-02-22
Anonymous
No

Choosing Visualize->Isosurface after selecting numarray
in Options->Preferences breaks...

Traceback (most recent call last):
File "t3.py", line 55, in ?
nv0_0.Set("Options", {'Data min': 0.0, 'Colormap':
'', 'Data max': 0.0, 'Height': 0.20000000000000001,
'Radius': 1.0, 'Values': '0.0,0.0'})
File "/home/ap/ncvtk/src/nvIsoSurfaceGui.py", line
188, in Set
self.pipeline.SetOption(k, v)
File "/home/ap/ncvtk/src/nvIsoSurface.py", line 241,
in SetOption
z=self.field.z, ff=ff)
File "/home/ap/ncvtk/src/nvIsoSurface.py", line 147,
in SetPoints
self.xx[i,...] = z32_1 * xx.astype(N.Float32)
ValueError: type must be either a 1-length string, or a
python type object

------------------------
#!/usr/bin/env python
# Ncvtk script generated on Wed Feb 22 09:28:25 2006 in
/home/ap/ncvtk/src

import Tkinter
try:
# allows one to run under src/ directory
from nvTopManager import nvTopManager
from nvMainGui2 import nvMainGui2
import nvSettings
except:
# correct path after proper installation (ie
running setup.py install)
from ncvtk.nvTopManager import nvTopManager
from ncvtk.nvMainGui2 import nvMainGui2
import ncvtk.nvSettings as nvSettings

root = Tkinter.Tk()

nvSettings.data = {'balloon font size': '12', 'balloon
font family': 'Arial', 'projection': 'Sphere',
'time': '^(time|Time|TIME|.*time|.*Time|.*TIME)',
'nz_max_sample': 2, 'nt_max_sample': 4, 'gap epsilon':
0.01, 'font size': '12', 'coastline': True, 'option
epsilon': 1.0000000000000001e-05, 'Directory':
'./', 'double valid max': 1e+308, 'double valid min':
-1e+308, 'rendering window geometry': '600x635-0+60',
'balloon font weight': 'normal', 'lat':
'^(.?la|.?La|.?LA|y|Y|j|J|.?north)', 'font weight':
'bold', 'array': 'numarray', 'short valid min': -32768,
'lon': '^(.?lo|.?Lo|.?LO|x|X|i|I|.?east)', 'short
valid max': 32768, 'geolonlat': False, 'longitude
range': 360.0, 'float valid max':
9.9999999999999998e+37, 'elev':
'^(z|Z|elev|Elev|ELEV|level|Level|LEVEL|phalf|pfull)',
'Data directory': '/net/ap/Linux.i686/ncvtk/data',
'Colormap directory':
'/net/ap/Linux.i686/ncvtk/colormaps/', 'float valid
min': -9.9999999999999998e+37, 'font family': 'Arial'}

top = nvTopManager(root=root,
filenames=['/net/ap/ncvtk_data/zetac2/1982feb01h12:00:00.nc'])

top.SetTime(0)

t = top.OptionsPreferences()
t.SetDefaults({'Valid Range Max':
9.9999999999999998e+37, 'Elevation': 0, 'Colormap':
'jet', 'Fields': '', 'Data Max':
9.9999999999999998e+37, 'Auto Data Min/Max': 0, 'Valid
Range Min': -9.9999999999999998e+37, 'Global Data
Min/Max': 0, 'Colorbar': 0, 'Time': 0, 'Data Min':
-9.9999999999999998e+37, 'Height': 1.0})
t.Set("nt_max_sample", 4)
t.Set("projection", 'Sphere')
t.Set("Data directory", '/net/ap/Linux.i686/ncvtk/data')
t.Set("nz_max_sample", 2)
t.Set("gap epsilon", 0.01)
t.Set("longitude range", 360.0)
t.Set("coastline", True)
t.Set("option epsilon", 1.0000000000000001e-05)
t.Set("Directory", './')
t.Set("array", 'numarray')
t.Set("double valid max", 1e+308)
t.Set("double valid min", -1e+308)
t.Set("lat", '^(.?la|.?La|.?LA|y|Y|j|J|.?north)')
t.Set("short valid max", 32768)
t.Set("geolonlat", False)
t.Set("lon", '^(.?lo|.?Lo|.?LO|x|X|i|I|.?east)')
t.Set("rendering window geometry", '600x635-0+60')
t.Set("short valid min", -32768)
t.Set("float valid max", 9.9999999999999998e+37)
t.Set("elev",
'^(z|Z|elev|Elev|ELEV|level|Level|LEVEL|phalf|pfull)')
t.Set("time", '^(time|Time|TIME|.*time|.*Time|.*TIME)')
t.Set("Colormap directory",
'/net/ap/Linux.i686/ncvtk/colormaps/')
t.Set("float valid min", -9.9999999999999998e+37)

nv0_0 = top.viz[0].VisualizeIso_Surface()
nv0_0.SetDefaults({'Data min': '0.0', 'Colormap': '',
'Fields': '<None>', 'Data max': '0.0', 'Height': '0.2',
'Radius': '1.0', 'Values': '0.0,0.0'})
nv0_0.Set("Options", {"Fields" : 'qcond'})
nv0_0.Set("Options", {'Data min': 0.0, 'Colormap': '',
'Data max': 0.0, 'Height': 0.20000000000000001,
'Radius': 1.0, 'Values': '0.0,0.0'})
nv0_0.Set("Field", 'qcond')

root.mainloop()

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks