I/O with file lists [message #71418] |
Mon, 21 June 2010 11:48  |
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  |
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  |
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?
|
|
|