comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » I/O with file lists
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
I/O with file lists [message #71418] Mon, 21 June 2010 11:48 Go to next message
spacermase is currently offline  spacermase
Messages: 13
Registered: June 2010
Junior Member
Hello all,

I'm running an image conversion procedure, vcr2fits.pro, which
requires two arguments, the image name and the name of the .fits file
that will be created. Due to the large number of images that need to
be converted, I'd like to be able to run it in batches, and have
created lists of file names and output names (rather unimaginatively
named input.list and output.list, respectively). This is probably a
newbie question, but what's the best way to read these lists into IDL
so vcr2fits can process them? With IRAF, for example, this is done by
entering '@input.list' and '@output.list' into the input and output
parameters- I am hoping that an equivalent exists for IDL.

Suggestions?
Re: I/O with file lists [message #71495 is a reply to message #71418] Tue, 22 June 2010 08:28 Go to previous message
Nikola is currently offline  Nikola
Messages: 53
Registered: November 2009
Member
On Jun 21, 8:48 pm, spacermase <thomsonmasonfis...@gmail.com> wrote:
> Hello all,
>
> I'm running an image conversion procedure, vcr2fits.pro, which
> requires two arguments, the image name and the name of the .fits file
> that will be created. Due to the large number of images that need to
> be converted, I'd like to be able to run it in batches, and have
> created lists of file names and output names (rather unimaginatively
> named input.list and output.list, respectively). This is probably a
> newbie question, but what's the best way to read these lists into IDL
> so vcr2fits can process them? With IRAF, for example, this is done by
> entering '...@input.list' and '...@output.list' into the input and output
> parameters- I am hoping that an equivalent exists for IDL.
>
> Suggestions?

If I understand correctly, you don't have a list with file names, but
you want to create it? If yes, I normally use FILE_SEARCH function to
generate a list of images that have to be processed:

list = FILE_SEARCH(directory+'*.fits')

Once you have it, you can run

FOR i = 0, nimages DO your_pro(list(i))

Check IDL help for the details of FILE_SEARCH:
http://star.pst.qub.ac.uk/idl/FILE_SEARCH.html
Re: I/O with file lists [message #71499 is a reply to message #71418] Tue, 22 June 2010 04:47 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Are you looking for something like the following?

readcol,'input.list',infile,f='A' ;Read input file names into
strings
readcol,'output.list',outfile,f='A',count=n
for i=0,n-1 do vcr2fits,infile[i],outfile[i]


On Jun 21, 2:48 pm, spacermase <thomsonmasonfis...@gmail.com> wrote:
> Hello all,
>
> I'm running an image conversion procedure, vcr2fits.pro, which
> requires two arguments, the image name and the name of the .fits file
> that will be created.  Due to the large number of images that need to
> be converted, I'd like to be able to run it in batches, and have
> created lists of file names and output names (rather unimaginatively
> named input.list and output.list, respectively).  This is probably a
> newbie question, but what's the best way to read these lists into IDL
> so vcr2fits can process them?  With IRAF, for example, this is done by
> entering '...@input.list' and '...@output.list' into the input and output
> parameters- I am hoping that an equivalent exists for IDL.
>
> Suggestions?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Selecting data from two separate arrays
Next Topic: Re: USERSYM custom symbol help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:35:08 PDT 2025

Total time taken to generate the page: 0.00690 seconds