PRO extract_header_keyword, header, keyword, keyval, keytype, status, errstr ; Description: This module extracts the value and type of a header keyword specified by ; "keyword" from a string array "header" containing an image header. If the ; header keyword is present and unique in the header, and the value of the ; header keyword is extracted successfully, then the module returns the ; value of the header keyword as the parameter "keyval", the IDL type ; of the keyword as the parameter "keytype", and sets the value of the ; parameter "status" to "1". If the header is missing the required header ; keyword, or the header has multiple entries for the required header ; keyword, then the module returns a value of "0" for the parameter "status" ; and an error string via the parameter "errstr". ; ; Input Parameters: ; ; header - STRING VECTOR - A vector containing the entries of the image header. ; keyword - STRING - The header keyword whose value is to be extracted. ; ; Output Parameters: ; ; keyval - SAME TYPE AS IN HEADER - The value of the required header keyword. ; keytype - INTEGER - The IDL variable type code of the value of the required header ; keyword. ; status - INTEGER - If the header keyword is present and unique in the header, and ; the value of the header keyword is extracted successfully, then ; the module sets the value of the parameter "status" to "1". If ; the header is missing the required header keyword, or the header ; has multiple entries for the required header keyword, then the ; module returns a value of "0" for the parameter "status". ; errstr - STRING - If the parameter "status" is returned with a value of "0", then ; "errstr" is returned with the corresponding error string. ; ; Author: Dan Bramich (dan.bramich@hotmail.co.uk) ; ; History: ; ; 14/01/2009 - Return the header keyword value IDL variable type (dmb). ; 19/05/2008 - Module created (dmb) ;Check that "header" is a non-empty string vector ;Check that "keyword" is a non-empty scalar string ;Extract the header keyword from the header ;If the keyword is missing from the header, then return an error ;If the keyword is duplicated in the header, then return an error ;Set "keyval" to the value of the header keyword, set "keytype" to the corresponding IDL ;variable type code, and set "status" to "1"