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.
x, y = CImage:WcsToXy( nWcsX, nWcsY ) |
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.
x and y are pixel coordinates in pixel units.
On success, this method returns 2 numbers.
On failure, this method returns 0,0.
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:
Right ascension (or longitude or time) specified as a string in hours, minutes, and seconds may be converted to decimal degrees using HmsToDeg.
Declination specified as a string in degrees, minutes, and seconds may be converted to degrees using DmsToDeg.
CImage class, GetWcsType, WcsIsEq, WcsStrToXy, XyToWcs, XyToWcsStr, GetWcsType, Image Coordinate System, Subpixel Coordinate Definition
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.