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.

Syntax

sValue = CImage:KwdGetRaw( sKwd )

bullet.gif    sKwd is the keyword name.

bullet.gif    sValue is the returned value of sKwd.

bullet.gif    On success, the string value is returned, including the enclosing ' '.

bullet.gif    On failure, the method returns the empty string "".

Remarks

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.

Comparing keyword string methods

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

Example

Suppose a CImage named I exists and contains a FILTER keyword with the value blue. The following script returns the value of FILTER:

str1 = I:KwdGetRaw("FILTER")

-- get the keyword value (with enclosing ' ')

Printf( "FILTER=%s",str1)

-- prints FILTER='blue'

 

 

str2 = I:KwdGetStr("FILTER")

-- get the keyword value (without enclosing ' ')

Printf( "FILTER=%s",str2)

-- prints FILTER=blue

Related Topics

CImage class

KwdGetStr

KwdGetStrEx

KwdGetVal

KwdGetNum

KwdGetDMS

KwdGetHMS

String Type Functions


Mira Pro x64 Script User's Guide, v.8.77 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.