Re: how to retain header info even after writefits [message #70923] |
Fri, 21 May 2010 18:37  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On May 21, 3:35 pm, sid <gunvicsi...@gmail.com> wrote:
> Hi,
> I am having fits data, im reading it in this way.
> img=readfits('file.fit',h)
> Now if I do print,h it prints the header
> a=avg(img(0:1023,0:1023),1) ; im averaging over 1024 rows
> writefits,'file1.fit',a,h ; im writing into fits file
> Now if I do print,h it prints the header were the COMMENT(the header
> consists of 8 arrays out of which one array contains comment info)
> part of the header of the original(file.fit) is different from the
> one(file1.fit) which I got now.
How are they different?
You have changed the size and dimension of your array (by averaging
over the first dimension) so writefits.pro automatically changes the
NAXIS and NAXISi keywords, which must match the size and dimensions of
the stored array. Otherwise, the FITS header should not be changed
by your script. --Wayne
|
|
|
Re: how to retain header info even after writefits [message #70927 is a reply to message #70923] |
Fri, 21 May 2010 14:25   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On May 21, 3:35 pm, sid <gunvicsi...@gmail.com> wrote:
> Hi,
> I am having fits data, im reading it in this way.
> img=readfits('file.fit',h)
> Now if I do print,h it prints the header
> a=avg(img(0:1023,0:1023),1) ; im averaging over 1024 rows
> writefits,'file1.fit',a,h ; im writing into fits file
> Now if I do print,h it prints the header were the COMMENT(the header
> consists of 8 arrays out of which one array contains comment info)
> part of the header of the original(file.fit) is different from the
> one(file1.fit) which I got now.
> Is there any way to retain all arrays of the header same before and
> after writing to a new fits file.
I don't know why the COMMENT cards would be "different." We probably
need more information.
|
|
|
Re: how to retain header info even after writefits [message #71066 is a reply to message #70923] |
Sat, 22 May 2010 11:28  |
sid
Messages: 50 Registered: January 1995
|
Member |
|
|
On May 22, 6:37 am, wlandsman <wlands...@gmail.com> wrote:
> On May 21, 3:35 pm, sid <gunvicsi...@gmail.com> wrote:
>
>> Hi,
>> I am having fits data, im reading it in this way.
>> img=readfits('file.fit',h)
>> Now if I do print,h it prints the header
>> a=avg(img(0:1023,0:1023),1) ; im averaging over 1024 rows
>> writefits,'file1.fit',a,h ; im writing into fits file
>> Now if I do print,h it prints the header were the COMMENT(the header
>> consists of 8 arrays out of which one array contains comment info)
>> part of the header of the original(file.fit) is different from the
>> one(file1.fit) which I got now.
>
> How are they different?
>
> You have changed the size and dimension of your array (by averaging
> over the first dimension) so writefits.pro automatically changes the
> NAXIS and NAXISi keywords, which must match the size and dimensions of
> the stored array. Otherwise, the FITS header should not be changed
> by your script. --Wayne
extremely sorry its my mistake
sid
|
|
|