CImage:KwdGetRaw
The KwdGetRaw method returns the "raw" value of any type of keyword as a string. Number and Boolean keyword values are returned as a string. Since FITS format requires string keyword values to be enclosed by ' ' characters, this function returns the enclosing ' ' characters if present. In contrast, KwdGetStr returns a string value without the enclosing ' ' characters. On failure, an empty string "" is returned for any type of keyword value. Strings may be tested for date+time or time strings using the String Type Functions functions.
No test is performed to determine if the keyword actually exists. To test whether the keyword exists, call KwdExists before this method.
sValue = CImage:KwdGetRaw( sKwd ) |
sKwd is the
keyword name.
sValue is
the returned value of sKwd.
On
success, the string value is returned, including the enclosing '
'.
On
failure, the method returns the empty string "".
An example of using this method is in a script that populates a CGridCtrl with a column containing a date+time or time value, after which one column is plotted against another. Plotting requires numeric values, hence strings cannot be plotted. Using this method, the date+time or time column values may be distinguished from columns containing strings.
The table below compares methods for returning a string keyword value with or without the enclosing ' ' characters.
CImage method: |
Returned value: |
KwdGetRaw |
'0000-00-00T00:00:00.0' |
KwdGetStr |
0000-00-00T00:00:00.0 |
KwdGetRaw |
'My object name' |
KwdGetStr |
My object name |
Suppose a CImage named I exists and contains a FILTER keyword with the value blue. The following script returns the value of FILTER:
|
-- get the keyword value (with enclosing ' ') |
|
-- prints FILTER='blue' |
|
|
|
-- get the keyword value (without enclosing ' ') |
|
-- prints FILTER=blue |
Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.