cannot do 2nd MODIS RGB

Errors and unexpected results
Post Reply
User avatar
hproe
Posts: 503
Joined: Sat Nov 27, 2010 3:46 pm

cannot do 2nd MODIS RGB

Post by hproe »

Hi -

Running a recent nighlty 1.6beta1, after having displayed RGB from MODIS 1km data (e.g. true colour), I cannot do a subsequent second one. Nothing happens, the CPU just turns active every now and then, the process cannot be stopped (red button) and MvC must be killed from the Task Manager (Windows 10). Display of single-band image works fine.

HP
User avatar
jayh
Posts: 415
Joined: Thu Jan 15, 2009 10:34 pm

Re: cannot do 2nd MODIS RGB

Post by jayh »

Hi HP-

Bob and I ran some tests with today's nightly. We can't reproduce your problem on my Mac or Bob's Windows 7 machine. We have a Windows 10 partition on a desktop, but only programmers have access currently. I will work on getting a user account.

In the meantime, we were wondering if your current problem might be related to inq. 2296? Could you give us some details on how you are accessing the MODIS file (Through realtime or local ADDE access, hydra, or the general files chooser)? Which RGB formula are you using? Which Display Type are you using (3-color RGB or RGB Composite)?

Thanks, Jay
User avatar
hproe
Posts: 503
Joined: Sat Nov 27, 2010 3:46 pm

Re: cannot do 2nd MODIS RGB

Post by hproe »

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
User avatar
jayh
Posts: 415
Joined: Thu Jan 15, 2009 10:34 pm

Re: cannot do 2nd MODIS RGB

Post by jayh »

Hi HP-

We were able to recreate your errors with the script provided (thanks!). combineRGB and mycombineRGB behaved as you described for us.

In doing some research on the bad range type error, this problem seems to be related to inq. 2282, and this associated forum thread.

We will keep you informed if we come up with solutions or workarounds. If you have any further information or questions, just let us know.

Thanks, Jay
Post Reply