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

Home » Public Forums » archive » Re: How to add several *.fit files (matrices) into one output *.fit file?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to add several *.fit files (matrices) into one output *.fit file? [message #63410 is a reply to message #63404] Thu, 06 November 2008 09:37 Go to previous messageGo to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On Nov 6, 7:14 am, Griffons <griffon...@gmail.com> wrote:
> On Nov 6, 11:55 am, Wox <s...@nomail.com> wrote:
>
>> On Thu, 6 Nov 2008 08:46:31 -0800 (PST), Griffons
>
>> <griffon...@gmail.com> wrote:
>>> Hello,
>>> Thank you for your help.
>>> I mean adding as in summation. Let say you have 20 image files in a
>>> folder and want the output to be the sum into one file.
>
>> Well, then it's like Jeremy said, readfits to read all images and
>> writefits to write the sum. I'm not sure what the problem is...
>
> I downloaded readfits, writefits and the other files required.
> I am not sure what to do next.  I compiled and ran readfits and
> writefits,  but then what to do?

I would do something like this, where files is a string array of the
file names and nfiles is the number of files in that array:

im = mrdfits( files[0], 0, h, /silent)
for i = 1, nfiles - 1, 1 do begin
im += mrdfits(files[i], 0, h, /silent)
endfor

writefits,'outfile', im, h

The caveat to this is that the header of the output file is the header
of the last file only. Use something like file_search to create the
files array.

Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: solving equation consisting of points - sort of...
Next Topic: Re: Using make_rt with a custom DLL/DLM

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

Current Time: Thu Oct 09 20:26:16 PDT 2025

Total time taken to generate the page: 0.31963 seconds