CImage:WcsToXy


The WcsToXy method uses the world coordinate system ("WCS") calibration of the image to convert the specified world coordinates to pixel coordinates. If the WCS calibration is equatorial, then the coordinates passed to this method are specified in decimal degrees. The type of WCS type used by the image may be obtained using GetWcsType and WcsIsEq.

Syntax

x, y = CImage:WcsToXy( nWcsX, nWcsY )

bullet.gif    nWcsX and nWcsY are the world coordinates expessed as decimal numbers. If the image has an equatorial calibration, then nWcsX and nWcsY correspond to right ascension and declination in units of decimal degrees.

bullet.gif    x and y are pixel coordinates in pixel units.

bullet.gif    On success, this method returns 2 numbers.

bullet.gif    On failure, this method returns 0,0.

Remarks

This method requires the passed coordinates to be expressed as numbers. If the image WCS is of the equatorial type, then right ascension and declination are both specified in decimal degrees according to the FITS standard. If your equatorial coordinates use HMS and DMS format, like "HH:MM:SS.SSS" and "-DD:MM:SS.SSS", they must first be converted to decimal degrees as follows:

bullet.gif    Right ascension (or longitude or time) specified as a string in hours, minutes, and seconds may be converted to decimal degrees using HmsToDeg.

bullet.gif    Declination specified as a string in degrees, minutes, and seconds may be converted to degrees using DmsToDeg.

Related Topics

CImage class, GetWcsType, WcsIsEq, WcsStrToXy, XyToWcs, XyToWcsStr, GetWcsType, Image Coordinate System, Subpixel Coordinate Definition


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