NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
You probably can use Jython for this. The "loadBundle()" method's second argument is a dictionary in the form: datasource:filename There is no "fileset" equivalent provided in the Jython IDV scripting, so you would have to use the Jython library to get a list of files to use....but, otherwise, this looks quite doable in Jython. Something like this, perhaps: import glob, string list=glob.glob("*.nc") for file in list: loadBundle("${islpath}/test.xidv", {".*" : file} ); pause(); k = string.rindex(file, "/"); fn = file[k+1:] writeImage( "${islpath}/+fn"); (not tested, of course....just an idea....) Good luck. tom On Tue, Apr 6, 2010 at 12:49 PM, Jun Chen <jchen@xxxxxxxxxx> wrote: > Possible can be done using python scripting? > > -jun > > -----Original Message----- > From: Stuart Wier [mailto:wier@xxxxxxxxxx] > Sent: Tuesday, April 06, 2010 10:20 AM > To: Jun Chen; idvdevelopers@xxxxxxxxxxxxxxxx > Subject: Re: [idvdevelopers] ISL scripting > > > > Jun Chen wrote: >> Following that example isl file multiplefiles.isl: >> >> <isl offscreen="false"> >> <fileset pattern=".*\.nc"> >> <echo message="File: ${file}"/> >> <bundle file="${islpath}/test.xidv"> >> <!-- This sets the data file in the bundle to the ${file} --> >> <setfiles datasource=".*" file="${file}"/> >> </bundle> >> <pause seconds="20"/> >> </fileset> >> </isl> >> >> I want to dynamically generate each image file based on each file >> ${file}, but that file contains path and link from a location I only >> have read permission, my question is: >> >> How can I extract the (only) file name (without file extension) from >> ${file}? >> Say ${file}="/myserver/mydirectory/myfile1.nc" >> >> Is there any way I can extract just myfile1 from ${file}? >> >> So I can add: >> >> <image file="${islpath}/${myfilename}.png" /> >> >> Above, ${myfilename} should change corresponding to ${file} >> >> Please help. >> >> I am new to IDV, and found it's very useful, but poor documentation. >> >> > > Use shell scripting to create your file names and then use the shell to > write your isl file dynamically. > > ISL is not a replacement for the shell. > > _______________________________________________ > idvdevelopers mailing list > idvdevelopers@xxxxxxxxxxxxxxxx > For list information, to unsubscribe, visit: > http://www.unidata.ucar.edu/mailing_lists/ > > -- Tom Whittaker University of Wisconsin-Madison Space Science & Engineering Center (SSEC) Cooperative Institute for Meteorological Satellite Studies (CIMSS) 1225 W. Dayton Street Madison, WI 53706 USA ph: +1 608 262 2759
idvdevelopers
archives: