CImage:KwdGetDmsEx


The KwdGetDmsEx method returns a DMS (Degrees, Minutes, and Seconds) string for a keyword in the image header. Also returned is a status flag which indicates whether the keyword was present. Use this method to read a keyword not in the standard angle format which uses : as the field delimiter. To return a keyword value specified in hours, minutes, and seconds, use KwdGetHmsEx The related KwdGetDMS method returns the DMS value without a status flag.

Syntax

sDMSValue, bSuccess = CImage:KwdGetDmsEx( sKwd )

bullet.gif    sKwd is the keyword name.

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

bullet.gif    On success, bSuccess is true.

bullet.gif    On failure, bSuccess is false and sDMSValue is 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":

sLong, bFound = I:KwdGetDmsEx("SITELONG")

-- read the keyword value

if bFound then

 

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

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

else

 

  Printf( "Site Longitude not found" )

-- SITELONG was not found

end

 

Related Topics

CImage class

KwdGetDmsEx

KefGetDMS

KwdGetHMS

KwdGetStr


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