I have a jython scrip which loops over a bunch of adde requests.
Some times this loop hangs up. (I need to go into the task manager and kill
java.exe to escape).
It looks like it stops when no data is avalable on the server to match the
request. I would have hoped for an exception or at least a time out. As you
can see the script has a try/except structure, but the adde: request just stops.
Is there some other way to indicate to the adde request to stop waiting if
the server never responds? Shouldn't the server send some message when there
is not possible data?
this is the particular request:
adde://suomi.ssec.wisc.edu/pointdata?group=cimssp&descr=wndgoesW&parm=lat lon di
r spd pw itim tlat tlon iday&select='TYPE IR; LAT 34.0 44.0;LON 67.0 87.0'&num=a
ll&pos=1
It is part of a larger script below
Thanks for any suggestions
G. Garrett Campbell Ph.D.
Cooperative Institute for Research in the Atmosphere
Colorado State Univ.
from visad.python.JPythonMethods import *
from visad import RealTupleType, FunctionType, FlatField, RealType
from visad import *
from visad import ScalarMap, FlowControl, Display, ConstantMap
from visad.bom import BarbRendererJ3D
from visad.data.mcidas import PointDataAdapter, BaseMapAdapter
from visad.python.JPythonMethods import *
from java.lang import Math
from subs import *
from graph import *
from ggc import *
import SaveWind
def archWind(select):
wes=select[0]
eas=select[1]
nor=select[2]
sou=select[3]
position=int(select[5])
if(select[4] == 8.):sat="E"
if(select[4] == 10.):sat="W"
print select,sat
try:
request=
"adde://suomi.ssec.wisc.edu/pointdata?group=cimssp&descr=wndgoes"+sat+"&parm=lat
lon dir spd pw itim tlat tlon iday&select='TYPE IR; LAT "+str(sou)+"
"+str(nor)+";LON "+str(-eas)+" "+str(-wes)+"'&num=all&pos="+str(position)
print request
data = load(request)
# dumpTypes(data)
dum=data.getFloats(0)
vals=[]
for i in range(len(dum)):
vals.append([])
for j in range(len(dum[i])):
vals[i].append(dum[i][j])
thhmmss=vals[5][0]
dav = vals[8][0]
dy=int(dav)
itav=int(thhmmss)
filename="f:/DiskD/visad/blosoom/"+sat+str(dy)+str(itav)+".wnd"
print filename," len ",len(dum[0])
SaveWind(vals,select,request,filename)
# filename="c:/apps/visad/res/"+sat+str(dy)+str(itav)+".flf"
# print filename
# SaveWind(data,select,filename)
# for some obscure reason, flatfield will not serialize
return 1
except:
print " problem",sat,position
return 0
select=[]
select.append(-77.-10.)
select.append(-77.+10.)
select.append(39.+5.)
select.append(39.-5.)
select.append(10.)
select.append(5.)
select.append(0.)
select[4]=8.
for position in range(1,8):
select[5]=position
n=archWind(select)
select[4]=10.
for position in range(1,8):
select[5]=position
n=archWind(select)