parseHdr: Parse FITS header

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/parseHdr.R

Description

Parse FITS header to extract keyword = variable pairs. Mostly useful for finding values given keyword name.

Usage

1
parseHdr(headerName)

Arguments

headerName

Header card images (vector)

Details

Uses strict FITS convention to identify keyword = variable pairs: a string '= ' in card image columns 9 and 10.

Value

Vector with elements keyword, variable for all pairs.

Note

Function eliminates leading and trailing spaces.

Author(s)

A. Harris

See Also

readFITSheader, modifyHeader

Examples

1
2
3
4
5
6
header <- newKwv('KEYWORD', 'VALUE', 'NOTE')
header <- addKwv('test1', 'plot size', header=header)
header <- addKwv('test2', 4294.95397809807, 'number', header=header)
header <- addKwv('test3', 4.29495397809807e50, 'big number', header=header)
header <- addKwv('test4', -4.29495397809807e50, 'big number', header=header)
parseHdr(header)

Example output

 [1] "KEYWORD"              "VALUE"                "TEST1"               
 [4] "plot size"            "TEST2"                "4294.9539780981"     
 [7] "TEST3"                "4.2949539780981e+50"  "TEST4"               
[10] "-4.2949539780981e+50"

FITSio documentation built on April 4, 2021, 1:06 a.m.