CImage:KwdGetHmsEx
The KwdGetHmsEx method returns an HMS (Hours, Minutes, and Seconds) string for a keyword in the image header. Also returned is a status flag that indicates whether the keyword was present. Use this method to read a keyword not in the standard time format which use : as the field delimiter. To return a keyword value specified in degrees, minutes, and seconds, use KwdGetDmsEx.
sHMSValue, bSuccess = CImage:KwdGetHmsEx( sKwd ) |
sKwd is the keyword name.
sHMSValue is the returned value of the keyword sKwd .
On success, bSuccess is true.
On failure, bSuccess is false and sHMSValue is nil.
This method returns a properly formatted time string after reading a keyword value containing hours, minutes, and seconds ("HMS"). The HMS string may contain the following field delimiters:
space, comma, colon, hyphen, slash, H, h, M, m, S, s, ', "
A preceding minus sign (or hyphen) is handled properly but embedded hyphens are treated as delimiters. The result is formatted into a standard time string of the form hh:mm:ss.sss.
If the specified keyword does not exist, then 0:00:00.000 is returned. To test whether the keyword exists, call KwdExists before this method.
Suppose a CImage named I exists and contains the keyword "RA" which has the incorrect format '12 24 45' (the time fields are supposed to be separated by : characters). The following script returns the value formatted as "12:24:45,000":
|
-- read the keyword value |
|
|
|
-- prints Right Ascension= 12:24:45.000 |
|
|
|
-- RA not found in the image header |
|
|
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.