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

Home » Public Forums » archive » How to add several *.fit files (matrices) into one output *.fit file?
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
How to add several *.fit files (matrices) into one output *.fit file? [message #63325] Thu, 06 November 2008 07:20 Go to next message
Griffons is currently offline  Griffons
Messages: 15
Registered: November 2008
Junior Member
Hello Everyone,

Anyone would know how to add several *.fit files (matrices) into one
output *.fit file using IDL?

Thank you.

Griffons
Re: How to add several *.fit files (matrices) into one output *.fit file? [message #63386 is a reply to message #63325] Thu, 06 November 2008 13:40 Go to previous messageGo to next message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"Paolo" <pgrigis@gmail.com> wrote in message
news:0c8e6af6-73c6-43a7-9c20-304c73d763fb@l33g2000pri.google groups.com...
...
> Normally I use something as
> file=dir+filename
> such that when I need to move the files somewhere else
> I only need to change the dir in one place.

Along those lines, a get_thisdatapath()
routine can be very helpful. Especially as it grows,
one can add keywords to leave previous behaviour untouched,
while adding new behaviours (such as reading new versions of the
same dataset, or adding new fields).

(where "thisdata" describes a particular dataset)

Cheers,
bob
Re: How to add several *.fit files (matrices) into one output *.fit file? [message #63396 is a reply to message #63325] Thu, 06 November 2008 11:50 Go to previous messageGo to next message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"Griffons" <griffons76@gmail.com> wrote in message
news:dd8c46c9-8ac9-435f-8822-b549d7ba118a@d10g2000pra.google groups.com...
...
> IDL> files=['S_08189493.fit','S_08189494.fit','S_08189495.fit',
> 'S_08189496.fit'] ;
> IDL> sum = READFITS( files[0], /NOSCALE)
> READFITS: ERROR - Unable to locate file S_08189493.fit

well, if you don't know where your files are, how is
IDL supposed to know?

This means that the file is not in your current directory.
Include the full path for the file, and it should work.

Cheers,
bob
Re: How to add several *.fit files (matrices) into one output *.fit file? [message #63409 is a reply to message #63325] Thu, 06 November 2008 09:53 Go to previous messageGo to next message
Christopher Thom is currently offline  Christopher Thom
Messages: 66
Registered: October 2006
Member
Quoth Wox:

> On Thu, 6 Nov 2008 09:14:30 -0800 (PST), Griffons
> <griffons76@gmail.com> wrote:
>
>> 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?
>
> files=['test1.fits','test2.fits',...] ; use e.g. file_search for this
> sum = READFITS( files[0], /NOSCALE)
> for i=1,n_elements(files)-1 do $
> sum += READFITS( files[i], /NOSCALE)
> writefits, 'sum_filename', sum
>
> Both readfits and writefits depend on some other procedures from the
> ASTRO library. Make sure you compiled them too.

And a minor point to add...be clear that you really want to specify the
/NOSCALE option. If the fits images have BSCALE and BZERO set in the
header, then you may want them scaled appropriately before summing...

cheers
chris
Re: How to add several *.fit files (matrices) into one output *.fit file? [message #63515 is a reply to message #63386] Fri, 07 November 2008 05:44 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

R.G. Stockwell schrieb:
> "Paolo" <pgrigis@gmail.com> wrote in message
> news:0c8e6af6-73c6-43a7-9c20-304c73d763fb@l33g2000pri.google groups.com...
> ...
>> Normally I use something as
>> file=dir+filename
>> such that when I need to move the files somewhere else
>> I only need to change the dir in one place.
>
> Along those lines, a get_thisdatapath()
> routine can be very helpful. Especially as it grows,
> one can add keywords to leave previous behaviour untouched,
> while adding new behaviours (such as reading new versions of the
> same dataset, or adding new fields).
>
> (where "thisdata" describes a particular dataset)
>
> Cheers,
> bob
>
>
>
>

or u set an env var pointing to the data dir or it's base dir. Sometimes
that is then easier to adjust in different environments.

cheers
Reimar



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFJFEZJ5aOc3Q9hk/kRAs6KAKCRiMggkqXB5hClbRyqOaYnGVCpHgCg llzQ
wO8ChoXC3pkVd4tg/Qosdl0=
=niTv
-----END PGP SIGNATURE-----
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: imsl_survival_glm
Next Topic: Is there a simple way to describe and plot a simple geometry

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

Current Time: Wed Oct 08 15:47:17 PDT 2025

Total time taken to generate the page: 0.00784 seconds