Next: Writing header items
Up: Examples of using HDR from C
Previous: Examples of using HDR from C
This example
(hdrread.c)
shows how to read the value of a header item.
/* Local Variables: */
char item[] = "OBSERVER";
char value[40]; [1]
/* Try to read the value. */
hdrIn( "in", " ", item, 1, value, 40, istat ); [2]
/* And write it out */
printf( "This data was taken by %s.\n", value);
/* Free the image */
imgFree( "in", istat );
The following notes refer to the numbered statements:
- 1.
- A character ``string'' is declared to contain the value of the
header item.
- 2.
- The size of the string is passed as an additional argument when
calling hdrIn
(this argument is not present in the Fortran version).
Next: Writing header items
Up: Examples of using HDR from C
Previous: Examples of using HDR from C
IMG Simple Image Data Access
Starlink User Note 160
P.W. Draper
R.F. Warren-Smith
3 March 2003
E-mail:P.W.Draper@durham.ac.uk
Copyright © 2000-2003 Council for the Central Laboratory of the Research Councils