select img in imgsequence by time

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

select img in imgsequence by time

Post by joleenf »

From the imageSequenceImpl documentation (http://www.ssec.wisc.edu/visad-docs/javadoc/visad/meteorology/ImageSequenceImpl.html). It seems that this code should work:

Code: Select all

imgVIS=selectData()
product=[]
l=imgVIS.getImageTimes()
counter=0
for dt in l:
   vis=imgVIS.getImage(dt)
   product.append(<code that creates a product from vis>))


but selecting by dateTime does not work, instead, the index method works:

Code: Select all

# cycle through images

imgVIS=selectData()
product=[]
l=imgVIS.getImageTimes()
counter=0
for dt in l:
   vis=imgVIS.getImage(counter)
   product.append(<code that creates a product from vis>))
   counter=counter+1


Why is that?

Thanks,
Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: select img in imgsequence by time

Post by Rick »

Hi Joleen,

We agree that the first example should work. The format of the date/times returned from getImageTimes looks correct and is of the correct type. I'll write up an inquiry.

Rick
Post Reply