hget.c
WCSTools
subroutines
to extract values for variables from FITS header string
Subroutines
hgeti2 (hstring,keyword,ival) returns short integer
hgeti4 (hstring,keyword,ival) returns long integer
hgetr4 (hstring,keyword,rval) returns real
hgetra (hstring,keyword,ra) returns double RA in degrees
hgetdec (hstring,keyword,dec) returns double Dec in degrees
hgetr8 (hstring,keyword,dval) returns double
hgetl (hstring,keyword,lval) returns logical int (0=F, 1=T)
hgets (hstring,keyword, lstr, str) returns character string
hgetm (hstring,keyword, lstr, str) returns multi-keyword character string
hgetdate (hstring,keyword,date) returns date as fractional year
hgetc (hstring,keyword) returns character string
blsearch (hstring,keyword) returns pointer to blank lines before header entry
ksearch (hstring,keyword) returns pointer to header string entry
str2ra (in) converts string to right ascension in degrees
str2dec (in) converts string to declination in degrees
strsrch (s1, s2) finds string s2 in null-terminated string s1
strnsrch (s1, s2, ls1) finds string s2 in ls1-byte string s1
hlength (header,lhead) sets length of FITS header for searching
notnum (string) returns 0 if string is a number, else 1
isnum (string) returns 1 if string is a number, else 0
Set maximum length of header so it doesn't have to be null-terminated.
- header
- FITS header
- lhead
- Maximum length of FITS header
hgeti4 (char *hstring, char *keyword, int *ival)
Extract 4-byte (int or sometimes long) value for variable from a FITS header
string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- ival
- int value (returned if keyword is found)
Extract short value for variable from FITS header string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- ival
- short value (returned if keyword is found)
Extract 4-byte floating point value for variable from FITS header string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- rval
- float value (returned if keyword is found)
Extract 8-byte floating point right ascension in degrees from FITS header string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- dval
- Right ascension in degrees (returned)
Extract 8-byte floating point declination in degrees from FITS header string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- dval
- Declination in degrees (returned)
Extract 8-byte floating point value for variable from FITS header string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- dval
- double value (returned)
Extract logical value (int 0 or 1) for variable from FITS header string
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- ival
- int value set to 0 if value is T, 1 if value
is F (returned)
Extract 8-byte floating point date from a FITS header string in the
old format (dd/mm/yy, dd/mm/yyyy, dd-mm-yy, or dd-mm-yyyy) or the new,
Y2K-compliant format (yyyy-mm-ddThh:mm:ss),
and return it as a year and fraction.
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- dval
- double value as yyyy.frac (returned)
Extract number of decimal places for value in FITS header string
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- ndec
- Number of decimal places in keyword value.
Extract string value for variable from FITS header string */
Return int 1 if keyword is found, else int 0
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
- lstr
- Maximum size of str in characters
- str
- Character string (returned)
Extract character value for variable from FITS header string
returns pointer to static character value or null
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword0
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
Find entry for keyword keyword in FITS header string hstring.
The keyword may have a maximum of eight letters.
A pointer to the beginning of the 80-character header entry containing the
keyword is returned, or NULL is returned if the keyword is not found
- hstring
- character string containing FITS header information
in the format keyword= value [/comment]
- keyword0
- Character string containing the name of the header keyword for which to
return the value. if "[n]" is present, the n'th token in the value is
returned. The first 8 characters must be unique.
Return the right ascension as double degrees given a string in sexagesimal hours
(hh:mm:ss.ssss). If string contains no colons, it is assumed to be
in fractional degrees which are returned as a double with no other conversion.
- in
- Character string as hh:mm:ss.sss or dd.ffffff
Return the declination as double degrees given a string in sexagesimal degrees
(dd:mm:ss.ssss). If string contains no colons, it is assumed to be
in fractional degrees which are returned as a double with no other conversion.
- in
- Character string as dd:mm:ss.sss or dd.ffffff
Return a pointer to the first occurrence of null-terminated string s2
in null-terminated string s1. If it is not found, return a null
pointer.
- s1
- String to search
- s2
- String to look for
Return a pointer to the first occurrence of null-terminated string s2
in string s1 of maximum length ls1. If it is not found,
return a null pointer.
- s1
- String to search
- s2
- String to look for
- ls1
- Length of string being searched in bytes
Return 1 if string is not a number, else 1
- string
- Character string
Return 1 if string is a number, else 1
- string
- Character string
[WCSTools]
[WCSTools Subroutines]
[WCS Subroutines]