In [ ]:
type3=makeType("(lon[unit:degrees_east],lat[unit:degrees_north])")
d3=makeDomain(type3, 0, 360, 360, -90, 90, 180)
In [1]:
from visad import RealTupleType
llt=RealTupleType.LatitudeLongitudeTuple
In [2]:
e=[]
e.append([])
e.append([])
for lat in range(0,360,1):
for lon in range(90,-90,-1):
e[0].append(lon)
e[1].append(lat)
print(len(e[0]))
In [3]:
units=[Util.parseUnit("degrees_east"),Util.parseUnit("degrees_north")]
g2s=Gridded2DSet(llt,e,180,360,None,units,None)
g2s
g2s.getSetUnits()
In [4]:
ff=FlatField(FunctionType(llt,makeType("nonsense")),g2s)
ff2=ff.clone()
In [5]:
from math import sin
b=[]
for lons in range(0,360,1):
for lats in range(90,-90,-1):
b.append(sin(lons*3.414/180.0))
ff.setSamples([b])
In [21]:
dc=createDisplay('planviewcolor',ff)
In [11]:
csinfo=dc.getColorScaleInfo()
In [12]:
dc.setColorScaleVisible(True)
In [23]:
idv.removeAllDisplays()
In [24]:
showImg()