Welcome to iraf.net Friday, May 03 2024 @ 04:14 PM GMT
mdurre |
01/29/2014 05:13AM (Read 2851 times)
|
|
|
Status: offline
Registered: 10/14/2013
Posts: 4
|
Hi, I've got a multi-extension fits file; I want to extract all the header information from the primary extension and combine it with the data in the next extension, i.e. the primary extension header has all the interesting information. To get the header, I can use fxheader or imheader, but I don't know how to set the next extension header "in bulk". Can anyone help?
|
|
|
|
fitz |
01/29/2014 03:58PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
It sounds like you're describing what the FITS kernel 'inherit' mechanism does, i.e. it inherits keywords from the PHU when looking at extensions. This is off by default but you can enable it by adding the 'inherit' flag to the extension number, for example
cl\$this->_split2($m[0]) imhead foo.fits[1,inherit] long+
will merge the PHU and EHU headers into a single output. Let me know if I missed the point of your question.
|
|
|
|
mdurre |
01/30/2014 01:09AM
|
|
|
Status: offline
Registered: 10/14/2013
Posts: 4
|
Hi Fitz,
Yes almost. What I'm doing is:
PHP Formatted Code
fxheader foo .fits lo + > h .txt
tail h .txt nl =-2 > hh .txt // Gets rid of a couple of heading lines
fxdummyh newfoo .fits hdr_file =hh .txt
My problem then comes when I try to get the first extension data and insert it as the primary section data, e.g.
PHP Formatted Code
fxextract foo .fits temp .fits g =1 p -
fxinsert temp .fits newfoo .fits g =0
this doesn't work, I get the same as file foo.fits, i.e. I get a dummy primary data and my "real" data is in extension 1, with useless header data.
What I really need is to get a file with structure
PHU | PDATA | HDR1 | DATA1
and get a file with structure
PHU | DATA1
|
|
|
|
| |
|
Content generated in: 0.10 seconds |
|