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

Home » Public Forums » archive » How can I make the headers of two fits files same in IDL?
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 can I make the headers of two fits files same in IDL? [message #92999] Thu, 07 April 2016 21:11 Go to next message
Sonu Tabitha is currently offline  Sonu Tabitha
Messages: 29
Registered: April 2016
Junior Member
Is there any way to match the headers of two fits files?
Re: How can I make the headers of two fits files same in IDL? [message #93005 is a reply to message #92999] Fri, 08 April 2016 07:30 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Friday, April 8, 2016 at 12:11:54 AM UTC-4, Meegle_Jade wrote:
> Is there any way to match the headers of two fits files?

This question could mean many different things.

But to make the FITS header in a file test2.fits the same as in file test1.fits

h = headfits('test1.fits')
modfits,'test2.fits',0,h

using routines from http://idlastro.gsfc.nasa.gov/homepage.html
Re: How can I make the headers of two fits files same in IDL? [message #93006 is a reply to message #93005] Fri, 08 April 2016 08:21 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/8/16 8:30 AM, wlandsman wrote:
> On Friday, April 8, 2016 at 12:11:54 AM UTC-4, Meegle_Jade wrote:
>> Is there any way to match the headers of two fits files?
>
> This question could mean many different things.
>
> But to make the FITS header in a file test2.fits the same as in file test1.fits
>
> h = headfits('test1.fits')
> modfits,'test2.fits',0,h
>
> using routines from http://idlastro.gsfc.nasa.gov/homepage.html
>

I agree that this could mean many things. If by "match the headers of
two fits files" you mean check to see the differences between two
headers, then check out my routine MG_FITS_DIFF:

https://github.com/mgalloy/mglib/blob/master/src/fits/mg_fit s_diff.pro

You can ignore specified keywords as well.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Re: How can I make the headers of two fits files same in IDL? [message #93017 is a reply to message #92999] Mon, 11 April 2016 02:26 Go to previous messageGo to next message
Sonu Tabitha is currently offline  Sonu Tabitha
Messages: 29
Registered: April 2016
Junior Member
On Friday, April 8, 2016 at 9:41:54 AM UTC+5:30, Meegle_Jade wrote:
> Is there any way to match the headers of two fits files?

Does this change the BITPIX and NAXIS values?
Re: How can I make the headers of two fits files same in IDL? [message #93020 is a reply to message #93017] Mon, 11 April 2016 06:06 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Monday, April 11, 2016 at 5:26:41 AM UTC-4, Meegle_Jade wrote:
> On Friday, April 8, 2016 at 9:41:54 AM UTC+5:30, Meegle_Jade wrote:
>> Is there any way to match the headers of two fits files?
>
> Does this change the BITPIX and NAXIS values?

No. You would have to first do this yourself with CHECK_FITS,/UPDATE
Re: How can I make the headers of two fits files same in IDL? [message #93026 is a reply to message #92999] Tue, 12 April 2016 20:31 Go to previous messageGo to next message
Sonu Tabitha is currently offline  Sonu Tabitha
Messages: 29
Registered: April 2016
Junior Member
On Friday, April 8, 2016 at 9:41:54 AM UTC+5:30, Meegle_Jade wrote:
> Is there any way to match the headers of two fits files?

Infact I have to make the header of fits file 'exponential.fits'same as that of 'empirical.fits'. I gave the following code for that

im = readfits('empirical.fits',h)
hdr = 'exponential.fits'
check_FITS, im, hdr, /UPDATE
end

I saved it as FITSMATCH.pro. On executing I am getting the following error

Library file does not contain a procedure or function.
% Compiled module: FITSMATCH.
% Attempt to call undefined procedure/function: 'FITSMATCH'.
% Execution halted at: $MAIN$
Re: How can I make the headers of two fits files same in IDL? [message #93027 is a reply to message #93026] Tue, 12 April 2016 22:14 Go to previous messageGo to next message
Sonu Tabitha is currently offline  Sonu Tabitha
Messages: 29
Registered: April 2016
Junior Member
On Wednesday, April 13, 2016 at 9:01:37 AM UTC+5:30, Meegle_Jade wrote:
> On Friday, April 8, 2016 at 9:41:54 AM UTC+5:30, Meegle_Jade wrote:
>> Is there any way to match the headers of two fits files?
>
> Infact I have to make the header of fits file 'exponential.fits'same as that of 'empirical.fits'. I gave the following code for that
>
> im = readfits('empirical.fits',h)
> hdr = 'exponential.fits'
> check_FITS, im, hdr, /UPDATE
> end
>
> I saved it as FITSMATCH.pro. On executing I am getting the following error
>
> Library file does not contain a procedure or function.
> % Compiled module: FITSMATCH.
> % Attempt to call undefined procedure/function: 'FITSMATCH'.
> % Execution halted at: $MAIN$

Or is there any way to do it with write_fits?
Re: How can I make the headers of two fits files same in IDL? [message #93033 is a reply to message #93026] Wed, 13 April 2016 06:21 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
You need to add

pro fitsmatch


as the first line
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: wplot not zooming
Next Topic: Looping over odd values only

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

Current Time: Wed Oct 08 09:19:18 PDT 2025

Total time taken to generate the page: 0.00543 seconds