CImage:KwdExists CImage:KwdGetDmsEx

CImage:KwdGetDMS


The KwdGetDMS method returns a properly formatted string value for a DMS (degrees, minutes, and seconds) string in the image header. Use this to read keywords not in the standard format using : as the field delimiter. To return a keyword value specified in hours, minutes, and seconds, use KwdGetHmsEx. The related KwdGetDmsEx method is preferred, as it returns a status value in addition to the DMS value so that the script can determine whether the target keyword is present in the image.

Syntax

sDMSValue = CImage:KwdGetDMS( sKwd )

bullet.gif    sKwd is the keyword name.

bullet.gif    sDMSValue is the returned value of the keyword sKwd .

bullet.gif    On success, the method returns a string.

bullet.gif    On failure, the method returns nil.

Remarks

This method returns a properly formatted angle string after reading a keyword value containing degrees, minutes, and seconds ("DMS"). The DMS string may contain the following field delimiters:

     space, comma, colon, hyphen, slash, D, d, 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 angle string of the form +ddd:mm:ss.sss. The sign is returned only if the angle is negative.

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.

Example

Suppose a CImage named I exists and contains the keyword "SITELONG" which has a value in the format '-14 24 16.4'. The following script returns the value formatted as "-14:24:16.4":

s = I:KwdGetDMS("SITELONG")

-- read the keyword value

Printf( Site Longitude= '%s'", s )

-- prints local Hour Angle = -14:24:16.400

Related Topics

CImage class

KwdGetDmsEx

KwdGetHMS

KwdGetStr


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