[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20051018: IDV version 1.2 available for download

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: 20051018: IDV version 1.2 available for download
  • Date: Wed, 19 Oct 2005 07:51:20 -0600

>From: "Valentijn Venus" <address@hidden>
>Organization: ITC
>Keywords: 200510181554.j9IFsa7s025205

Hi Valentijn-

>I get the error:
>
>Traceback (innermost last):
>  File "<string>", line 1, in ?
>  File "<string>", line 16, in addImageSequences
>NameError: addImages

addImages was your original jython procedure.  addImageSequences
just calls that:

def addImages (a,b):
  lineValuesA = a.getFloats()
  lineValuesB = b.getFloats()
  for i in xrange(a.getDomainSet().getLength()):
    value = lineValuesA[0][i] - lineValuesB[0][i]
    lineValuesA[0][i] = value*i
  newd = a.clone()
  newd.setSamples(lineValuesA)
  return newd

>on the following copy of your jython script:
>
>#
>#This is the default  editable user's jython library
>
>sys.add_package('GridUtil');
>
>def addImageSequences(a,b):
>  import ucar.unidata.data.grid.GridUtil as gu
>  if (gu.isTimeSequence(a)):
>     newA = a.clone()
>     for t in range(a.getDomainSet().getLength()):
>         print "t = ", t
>         subA = a.getSample(t)
>         subB = b.getSample(t)
>         newA.setSample(t,addImages(subA, subB))
>     return newA
>  else:
>     return addImages(a,b)  
>
>Probably it is the formatting, but is this solution also cattering for a
>time sequence of more than two images?

Yes.

Don Murray
NOTE: All email exchanges with Unidata User Support are recorded in the
Unidata inquiry tracking system and then made publicly available
through the web.  If you do not want to have your interactions made
available in this way, you must let us know in each email you send to us.