|
|
|
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   |
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  |
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-----
|
|
|