Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://lnfm1.sai.msu.ru/~pav/dists/fitshdr/fitshdr.1.html
Дата изменения: Tue Dec 21 16:35:56 2010 Дата индексирования: Mon Oct 1 23:27:44 2012 Кодировка: Поисковые слова: rosat |
Fitshdr
utility allows to display or modify FITS headers
(FITS MultiExtentionsFiles included).
In 'dump' mode (see below): allows to see/dump/display FITS-headers
information. In 'edit' mode: permits to modify existent FITS-file headers.
ATTENTION:
"existent FITS-file headers" means, that all modifications will be done
directly
in the FITS-file, which was specified for editing!
You can't, for example, expand existent header (You can't change size of
header). And, no backups!
More simple,
fitshdr
is some sort of binary editor. If You are looking for more "traditional"
editors, check
fitshdr_edit
and
fitshdr_expand
man pages.
NNNN:HEADER_LINE
where NNNN - file offset for this header line, HEADER_LINE - header line string. Offset specification could be omitted (skipped). As offset positive integer (NNNN%80 == 0) is expected. Special (relative) offsets +NNNN and -NNNN are supported. Two input header's lines
+0:HEADER_LINE and HEADER_LINEare equivalent. The only difference... 1st line is permitted if --line-offsets is used, but not the 2nd one!
``END'' FITS-header card.
The ``END'' FITS-header card has special meaning.
The processing of the ``normal'' FITS-card does the following:
- 80 bites will be written to the file (started from NNNN offset).
- The file pointer will be pointed to the next FITS-card.
In contract, the processing of the input
FITS-card ``NNNN:END'' does:
- 80 bites will be written to the file (started from NNNN offset).
- The tail of current FITS-block will be filled by spaces.
- The file pointer will be pointed to the beginning of the next FITS-header, if exists.
ATTENTION: FITS-header line (card) "END" (without offset) does last action only! Means: the only file offset will be changed after processing input FITS-header line "END" without offset! If You want to avoid such behavior, use "+0:END" header line instead.
Comment lines.
Input header lines with ";" symbol in first position are ignored by
fitshdr
in 'edit' mode.
Simplest example. To display FITS-headers information:
fitshdr file.fits
where file.fits - existent FITS-file name. As the result, You'll see something like:
;;; 0: HEADER No.0 ;;; 0: BLOCK No.0 SIMPLE = T BITPIX = 32 NAXIS = 0 AUTHOR = 'Name of author' / comment here CRDELT1 = 10.0 CRDELT2 = 21.0 / this is an example HISTORY header No.0: 1st history line 123456789012345678901234567 COMMENT Sat Sep 25 21:17:34 CEST 2004 / by fitshdr_edit ;;; 2880: BLOCK No.1. . .
Next step. We want to add lines offsets for each header line and suppress blocks' offsets output. In this case:
fitshdr --line-offsets --no-block-offsets file.fits
In this case we'll have:
;;; 0: HEADER No.0 0:SIMPLE = T 80:BITPIX = 32 160:NAXIS = 0 400:AUTHOR = 'Name of author' / comment here 480:CRDELT1 = 10.0 560:CRDELT2 = 21.0 / this is example 720:HISTORY header No.0: 1st history line 123456789012345678901234567 880:COMMENT Sat Sep 25 21:17:34 CEST 2004 / by fitshdr_edit. . .
Another useful example. How to display headers' information in case if FITS-file was gzip-ed:
gunzip < file.fits.gz | fitshdr
Now, about editing... Again, simplest example. We want to change header line with offset 720. In this case:
echo "720:CRPIX1 = 10. / comment" | fitshdr --edit file.fits
The line (see previous example)
HISTORY header No.0: 1st history line 123456789012345678901234567
was substituted by
CRPIX1 = 10.0 / comment
As You can see, input line was formated before writing.
Now more complex example. We want to edit interactively FITS-headers.
fitshdr --line-offsets file.fits > tmp.hdr emacs tmp.hdr fitshdr --line-offsets --header=tmp.hdr --edit file.fits
First, header was written in file tmp.hdr. After this temporary file was
changed in emacs editor. And after this new header was written back to
FITS-file.
NOTE:
This is just an example. Better for such purposes use
fitshdr_edit
script.
More useful/"realistic" example. We want (by some reason) change in headers name of keyword.
fitshdr --empty-lines file.fits | \ sed "s/^FILTER /FILTER1/" | \ fitshdr --edit file.fits
In this example, the FILTER keyword was substituted by FILTER1. Keyword's value was not changed (only name of keyword was changed).
On success, zero is returned and non-zero, if an error occurred.
fitshdr_edit(1), fitshdr_expand(1)
Email bug reports to
fitshdr@sai.msu.ru.
Be sure to include the word ``fitshdr'' somewhere in the
``Subject:'' field.