Hi Jay and Bob -
You are wondering correctly. Indeed, my problem is related to inquiry #2296 and the Forum thread at it has originated from. As it turns out, it is generic to the construction of RGB composites, and to the methods combineRGB/mycombineRGB used to return the composited image.
With combineRGB no further RGB processing is possible in the same session/tab after the first job, be it with the GUI or a script.
With mycombineRGB with the GUI further RGB work is possible, but a script ends in
visad.TypeException: FieldImpl.setSample: bad range type
Note that the script eror only occurs when processing 2+ RGBs.
A typical and relatively simple (no RGB formula is called) sample script:
Code: Select all
def sequence_NCO2h08(timeFirstImage,numImages,skipFactor):
""" HansPeter Roesli
2016-05-08
Uses directly 'combineRGB' method with bands VIS0.64, VIS0.86, NIR2.3
Creates a sequence of NCO2 RGBs from an ADDE server
edit 'addeParams' and 'getADDEImageSubset' for your purpose
no post-processing done
Arguments:
timeFirstImage: string [yyyy-MM-dd HH:mmz] (z=UTC e.g.)
numImages: number of images to process
skipFactor: number of native time steps to skip
Returns:
display of specified image sequence
"""
from visad import DateTime
from visad.meteorology import ImageSequenceImpl as ImS
account=('project','project#')
addeParamsSubset=dict(
server='geoarc.ssec.wisc.edu',
dataset='AHIM08',
descriptor='FD',
coordinateSystem=CoordinateSystems.LATLON,
location=(40,100), #specify center point of image
place=Places.CENTER,
size=(100,100), # number of (lines, elements)
mag=(1,1), # 'zoom' level
unit='ALB', # choose 'TEMP' or 'BRIT' or 'ALB'
accounting=account,
showUrls=False,
)
addeParams=addeParamsSubset
imageSeq=[] # make empty list that will hold image sequence
firstImageDT=DateTime.createDateTime(timeFirstImage,'yyyy-MM-dd HH:mmz')
for i in range(numImages):
try:
currentDT=DateTime( firstImageDT.getReal().getValue() +
i*skipFactor*600.0) # !!!native time step in[s] !!!
timeZone=currentDT.getFormatTimeZone()
dayString=currentDT.formattedString('yyyyDDD',timeZone)
timeString=currentDT.formattedString('HH:mm:ss',timeZone)
VIS06=loadADDEImage(day=dayString,
time=(timeString,timeString),band=3,**addeParams)
VIS08=loadADDEImage(day=dayString,
time=(timeString,timeString),band=4,**addeParams)
NIR23=loadADDEImage(day=dayString,
time=(timeString,timeString),band=6,**addeParams)
print i+1,' ',dayString,timeString
except:
print i+1,' ',dayString,timeString,' (partially) missing frame'
else:
image=combineRGB(ImS([NIR23]),ImS([VIS08]),ImS([VIS06]))
imageSeq.append(image)
imDisplay=firstDisplay()
imageLoop=makeTimeSequence(imageSeq)
imLayer=imDisplay.createLayer('RGB Composite',imageLoop)
print 'done'
return
cheers, HP