World Coordinate System
WCS
- class WCS(header, images, options)
 Create a new coordinate reference system that emulates the WCS (World Coordinate System) used in astronomy.
- Arguments:
 header (object) -- JSON representation of the merged image header.
images (Array.<image>) -- Array of image extension metadata.
options (object) -- Options.
options.nzoom (number) -- Number of zoom levels.
- Returns:
 WCS -- Instance of a World Coordinate System.
- WCS.code
 Codename of the WCS coordinate reference system.
- static WCS._deltaLng(latLng, latLng0)
 Compute the longitude of a point with respect to a reference point.
- Arguments:
 latLng (leaflet.LatLng) -- World coordinates of the point.
latLng0 (leaflet.LatLng) -- World coordinates of the reference point.
- Returns:
 number -- Difference in longitude (in degrees) in the interval -180 to 180 deg.
- static WCS.distance(latlng1, latlng2)
 Compute the distance between two points on the sphere.
- Arguments:
 latlng1 (leaflet.LatLng) -- World coordinates of the first point.
latlng2 (leaflet.LatLng) -- World coordinates of the second point.
- Returns:
 number -- Spherical distance between the two points in degrees.
- static WCS.fovToZoom(map, fov, latlng)
 - Compute the zoom level that corresponds to a given FoV at the provided
 coordinates.
- Arguments:
 map (leaflet.Map) -- Leaflet map.
fov (number) -- Field of View in degrees.
latlng (leaflet.LatLng) -- World coordinates.
- Returns:
 number -- Zoom level.
- static WCS.getProjection(header, options)
 Extract the WCS projection code from a JSON-encoded image header.
- Arguments:
 header (object) -- JSON representation of the image header.
options (object) -- Projection options.
- Returns:
 string -- WCS projection code.
- static WCS.hmsDMSToLatLng(Coordinate)
 Convert an HMSDMS string to world coordinates.
- Arguments:
 Coordinate (string) -- string in HMSDMS.
- Returns:
 leaflet.LatLng|undefined -- World coordinates, or undefined if the input string could not be translated.
- static WCS.latLngToHMSDMS(latlng)
 - Convert world coordinates to an HMSDMS string
 (DMS code from the Leaflet-Coordinates plug-in).
- Arguments:
 latlng (leaflet.LatLng) -- Input world coordinates.
- Returns:
 string -- Coordinate string in HMSDMS.
- static WCS.multiLatLngToIndex(latlng)
 - Return index of chip closest to the given world coordinates in a
 multi-WCS setting.
- Arguments:
 latlng (leaflet.LatLng) -- Input world coordinates.
- Returns:
 number -- Index of the closest chip (extension).
- static WCS.multiLatLngToPoint(latlng, zoom)
 Multi-WCS version of the projection to layer coordinates.
- Arguments:
 latlng (leaflet.LatLng) -- Input world coordinates.
zoom (number) -- Zoom level.
- Returns:
 leaflet.Point -- Layer coordinates at the given zoom level.
- static WCS.multiPntToIndex(pnt)
 - Return index of chip closest to the given pixel coordinates in a
 multi-WCS setting.
- Arguments:
 pnt (leaflet.Point) -- Input (merged) pixel coordinates.
- Returns:
 number -- Index of the closest chip (extension).
- static WCS.multiPointToLatLng(pnt, zoom)
 Multi-WCS version of the de-projection from layer coordinates.
- Arguments:
 pnt (leaflet.Point) -- Input layer coordinates at the given zoom level.
zoom (number) -- Zoom level.
- Returns:
 leaflet.LatLng -- De-projected world coordinates.
- static WCS.multiProject(latlng)
 Multi-WCS astrometric projection.
- Arguments:
 latlng (leaflet.LatLng) -- Input world coordinates.
- Returns:
 leaflet.Point -- Projected (merged) pixel coordinates.
- static WCS.multiUnproject(pnt)
 Multi-WCS version of the astrometric de-projection.
- Arguments:
 pnt (leaflet.Point) -- Input (merged) pixel coordinates.
- Returns:
 leaflet.LatLng -- De-projected world coordinates.
- static WCS.parseCoords(str)
 Parse a string of world coordinates.
- Arguments:
 str (string) -- Input string.
- Returns:
 leaflet.LatLng|undefined -- World coordinates, or undefined if conversion failed.
- static WCS.pixelScale(zoom, latlng)
 Compute the layer pixel scale at the given world coordinates.
- Arguments:
 zoom (number) -- Zoom level.
latlng (leaflet.LatLng) -- World coordinates.
- Returns:
 number -- Layer pixel scale (in degrees per pixel).
- static WCS.rawPixelScale(latlng)
 Compute the image pixel scale at the given world coordinates.
- Arguments:
 latlng (leaflet.LatLng) -- World coordinates.
- Returns:
 number -- Pixel scale (in degrees per pixel).
- static WCS.scale(zoom)
 Convert zoom level to relative scale.
- Arguments:
 zoom (number) -- Zoom level.
- Returns:
 number -- Relative scale.
- static WCS.transform(pnt, zoom)
 Convert pixel (image) coordinates to layer coordinates.
- Arguments:
 pnt (leaflet.Point) -- Pixel coordinates.
zoom (number) -- Zoom level.
- Returns:
 leaflet.Point -- Layer coordinates at the given zoom level.
- static WCS.untransform(layerpnt, zoom)
 Convert layer coordinates to pixel (image) coordinates.
- Arguments:
 layerpnt (leaflet.Point) -- Layer coordinates.
zoom (number) -- Zoom level.
- Returns:
 leaflet.Point -- Pixel (image) coordinates
- static WCS.zoom(scale)
 Convert relative scale to zoom level.
- Arguments:
 scale (number) -- Relative scale.
- Returns:
 number -- Zoom level.
- static WCS.zoomToFov(map, zoom, latlng)
 Compute the FoV that corresponds to a given zoom level at the provided coordinates.
- Arguments:
 map (leaflet.Map) -- Leaflet map.
zoom (number) -- Zoom level.
latlng (leaflet.LatLng) -- World coordinates.
- Returns:
 number -- Field of View in degrees.
Projections
- class Projection(header, options)
 - Base class for the WCS (World Coordinate System) projections used in
 astronomy.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options.
- Returns:
 Projection -- Instance of a projection.
- Projection.defaultProjParam
 type: projParam
Default WCS projection parameters.
- static Projection._cpole()
 - Set up the celestial pole coordinates of the projection
 (delta_p, alpha_p). projection._natpole() should be called first.
- Returns:
 leaflet.LatLng -- Celestial coordinates of the pole.
- static Projection._getCenter(proj)
 Compute the pixel coordinates of the geometric image center.
- Arguments:
 proj (Projection) -- Projection for pixel coordinates.
- Returns:
 leaflet.Point -- Pixel coordinates of the image center.
- static Projection._invertCD(cd)
 Invert the CD Jacobian matrix of the linear part of the de-projection.
- Arguments:
 cd (Array.<Array.<number>>) -- CD Jacobian matrix.
- Returns:
 Array.<Array.<number>> -- Matrix inverse.
- static Projection._multiToPix(pnt)
 Convert sliced (merged) coordinates to pixel coordinates.
- Arguments:
 pnt (leaflet.Point) -- Sliced (merged) coordinates.
- Returns:
 leaflet.Point -- Pixel coordinates.
- static Projection._natpole()
 Set up the native pole coordinates of the projection (theta_p, phi_p).
- Returns:
 leaflet.LatLng -- Latitude and longitude of the pole.
- static Projection._paramUpdate(paramSrc)
 Update internal projection parameters from external properties. The internal projection parameter object is initialized if it does not exist.
- Arguments:
 paramSrc (projParam) -- Input projection parameters.
- static Projection._phiThetaToRADec(latlng)
 Convert native coordinates to celestial coordinates.
- Arguments:
 latlng (leaflet.LagLng) -- Native coordinates.
- Returns:
 leaflet.LatLng -- Celestial coordinates.
- static Projection._pixToMulti(pnt)
 Convert pixel coordinates to sliced (merged) coordinates.
- Arguments:
 pnt (leaflet.Point) -- Pixel coordinates.
- Returns:
 leaflet.Point -- Sliced (merged) coordinates.
- static Projection._pixToRed(pix)
 Convert pixel coordinates to reduced coordinates.
- Arguments:
 pix (leaflet.Point) -- Pixel coordinates.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static Projection._raDecToPhiTheta(latlng)
 Convert celestial coordinates to native coordinates.
- Arguments:
 latlng (leaflet.LagLng) -- Celestial coordinates.
- Returns:
 leaflet.LatLng -- Native coordinates.
- static Projection._readWCS(header)
 Update internal projection parameters from an image header.
- Arguments:
 header (object) -- JSON representation of the image header.
- static Projection._redToPix(red)
 Convert reduced coordinates to pixel coordinates.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.Point -- Pixel coordinates.
- static Projection._shiftWCS(projparam)
 Correct projection parameters for data slicing.
- Arguments:
 projparam (projParam) -- Projection parameters.
- static Projection.project(latlng)
 Project world coordinates to pixel (image) coordinates.
- Arguments:
 latlng (leaflet.LatLng) -- World coordinates.
- Returns:
 leaflet.Point -- Pixel (image) coordinates.
- static Projection.unproject(pnt)
 De-project pixel (image) coordinates to world coordinates.
- Arguments:
 pnt (leaflet.Point) -- Pixel coordinates.
- Returns:
 leaflet.LatLng -- World coordinates.
- class Conical(header, options)
 Base class for conic WCS (World Coordinate System) projections.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Projection}.
- Returns:
 Conical -- Instance of a conic projection.
- static Conical._phiRToRed(phiR)
 Convert conic (phi,R) coordinates to reduced coordinates.
- Arguments:
 phiR (leaflet.LatLng) -- (phi,R) conic coordinates in degrees.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static Conical._redToPhiR(red)
 Convert reduced coordinates to conic (phi,R) coordinates.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.LatLng -- (phi,R) conic coordinates in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=19}
- class Cylindrical(header, options)
 Base class for cylindrical WCS (World Coordinate System) projections.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Projection}.
- Returns:
 Cylindrical -- Instance of a cylindrical projection.
- static Cylindrical._projInit()
 Initialize a cylindrical projection.
- static Cylindrical._rToTheta(r)
 Convert cylindrical R coordinate to native theta angle.
- Arguments:
 r (number) -- R cylindrical coordinate in degrees.
- Returns:
 number -- Native theta angle in degrees.
- static Cylindrical._thetaToR(theta)
 Convert native theta angle to cylindrical R.
- Arguments:
 theta (number) -- Native theta angle in degrees.
- Returns:
 number -- R cylindrical coordinate in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=15}
- class Zenithal(header, options)
 Base class for zenithal WCS (World Coordinate System) projections.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Projection}.
- Returns:
 Zenithal -- Instance of a zenithal projection.
- static Zenithal._phiRToRed(phiR)
 Convert zenithal (phi,R) coordinates to reduced coordinates.
- Arguments:
 phiR (leaflet.LatLng) -- (phi,R) zenithal coordinates in degrees.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static Zenithal._projInit()
 Initialize a Zenithal projection.
- static Zenithal._redToPhiR(red)
 Convert reduced coordinates to zenithal (phi,R) coordinates.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.LatLng -- (phi,R) zenithal coordinates in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=9}
Built-in
- class PIX(header, options)
 Pixel (identity) projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Projection}.
- Returns:
 PIX -- Instance of a PIX projection.
- static PIX._projInit()
 Initialize a pixel (identity) projection.
- static PIX.project(latlng)
 - Project "world" pixel coordinates to (image) pixel coordinates
 (identity).
- Arguments:
 latlng (leaflet.LatLng) -- "World" pixel coordinates.
- Returns:
 leaflet.Point -- Pixel (image) coordinates.
- static PIX.unproject(pnt)
 - De-project (image) pixel coordinates to "world" pixel coordinates
 (identity).
- Arguments:
 pnt (leaflet.Point) -- Pixel (image) coordinates.
- Returns:
 leaflet.LatLng -- "World" pixel coordinates.
- class CAR(header, options)
 Cylindrical Plate carrée projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Cylindrical}.
- Returns:
 CAR -- Instance of a CAR projection.
- static CAR._phiRToRed(phiR)
 Convert CAR (phi,R) coordinates to reduced coordinates.
- Arguments:
 phiR (leaflet.LatLng) -- (phi,R) CAR coordinates in degrees.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static CAR._redToPhiR(red)
 Convert reduced coordinates to CAR (phi,R) coordinates.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.LatLng -- (phi,R) CAR coordinates in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=16}
- class CEA(header, options)
 Cylindrical Equal-Area projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Cylindrical}.
- Returns:
 CEA -- Instance of a CEA projection.
- static CEA._phiRToRed(phiR)
 Convert CEA (phi,R) coordinates to reduced coordinates.
- Arguments:
 phiR (leaflet.LatLng) -- (phi,R) CEA coordinates in degrees.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static CEA._redToPhiR(red)
 Convert reduced coordinates to CEA (phi,R) coordinates.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.LatLng -- (phi,R) CEA coordinates in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=15}
- class COE(header, options)
 Conic Equal-Area projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Conical}.
- Returns:
 COE -- Instance of a COE projection.
- static COE._projInit()
 Initialize a COE projection.
- static COE._rToTheta(r)
 Convert conic equal-area R coordinate to native theta angle.
- Arguments:
 r (number) -- R conic equal-area coordinate in degrees.
- Returns:
 number -- Native theta angle in degrees.
- static COE._thetaToR(theta)
 Convert native theta angle to conic equal-area R.
- Arguments:
 theta (number) -- Native theta angle in degrees.
- Returns:
 number -- R conic equal-area coordinate in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=20}
- class TAN(header, options)
 Gnomonic (tangential) projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Zenithal}.
- Returns:
 TAN -- Instance of a TAN projection.
- static TAN._rToTheta(r)
 Convert tangential R coordinate to native theta angle.
- Arguments:
 r (number) -- R tangential coordinate in degrees.
- Returns:
 number -- Native theta angle in degrees.
- static TAN._thetaToR(theta)
 Convert native theta angle to tangential R.
- Arguments:
 theta (number) -- Native theta angle in degrees.
- Returns:
 number -- R tangential coordinate in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=12}
- class TPV(header, options)
 Distorted gnomonic (tangential) projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Zenithal}.
- Returns:
 TPV -- Instance of a TPV projection.
- static TPV._dRedToRed(dred)
 Convert distorted reduced coordinates to reduced coordinates using a TPV polynomial.
- Arguments:
 dred (leaflet.Point) -- Distorted reduced coordinates.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static TPV._pixToRed(pix)
 Convert pixel coordinates to reduced coordinates, taking into account distortions.
- Arguments:
 pix (leaflet.Point) -- Pixel coordinates.
- Returns:
 leaflet.Point -- Reduced coordinates.
- static TPV._redToDRed(red)
 Convert reduced coordinates to distorted reduced coordinates using second order approximation to the inverted TPV polynomial.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.Point -- Distorted reduced coordinates.
- static TPV._redToPix(red)
 Convert reduced coordinates to pixel coordinates, taking into account geometric distortions.
- Arguments:
 red (leaflet.Point) -- Reduced coordinates.
- Returns:
 leaflet.Point -- Pixel coordinates.
See also
{@link https://fits.gsfc.nasa.gov/registry/tpvwcs/tpv.html}
- class ZEA(header, options)
 Zenithal Equal-Area projection.
- Arguments:
 header (object) -- JSON representation of the image header.
options (projParam) -- Projection options: see {@link Zenithal}.
- Returns:
 ZEA -- Instance of a ZEA projection.
- static ZEA._rToTheta(r)
 Convert zenithal equal-area R coordinate to native theta angle.
- Arguments:
 r (number) -- R zenithal equal-area coordinate in degrees.
- Returns:
 number -- Native theta angle in degrees.
- static ZEA._thetaToR(theta)
 Convert native theta angle to zenithal equal-area R.
- Arguments:
 theta (number) -- Native theta angle in degrees.
- Returns:
 number -- R zenithal equal-area coordinate in degrees.
See also
{@link https://www.atnf.csiro.au/people/mcalabre/WCS/ccs.pdf#page=14}