[fitsbits] moving headers.

Doug Mink dmink at cfa.harvard.edu
Wed Sep 24 13:08:52 EDT 2008


Douglas S. Brenner wrote:
> Hope I'm in the right place.  
> 
> I have a fits file with the desired header in the first HDU test.fits[0] 
> and the data in the second test.fits[1].  I need to combine it into one 
> file that works in ds9.  How do I do this? 

My WCSTools package (http://tdc-www.harvard.edu/software/wcstools/) has
a lot of header manipulation tools.  In this situation, you can take
advantage of the fact that most of its programs which deal with FITS images
automatically append the primary header to the header of any FITS extension
being looked at by itself.  I put a -s option in the imrot program to split
multiextension files keeping the primary header information in each new
no-longer-an-extension file.  You can use the -i option to keep that from
happening.  There is also a cphead program which can copy selected keywords
from one FITS file header to another, with an option to copy all of the
WCS keywords.

-Doug Mink



More information about the fitsbits mailing list