Namespace: A

A

Aladin Lite API namespace for creating celestial objects.
Source:

Example

// Usage example:
import { A } from 'aladin-lite';

const aladin = new A.aladin("#aladin-lite-div", { survey: 'your survey url', fov: 180, projection: 'SIN' });

Methods

(static) MOCFromCone(circle, optionsopt, successCallbackopt, errorCallbackopt) → {MOC}

Creates a new MOC (Multi-Order-Coverage) from an object describing a cone on the sky
Parameters:
Name Type Attributes Description
circle Object A object describing a cone in the sky
Properties
Name Type Description
ra number Right-ascension of the circle's center (in deg)
dec number Declination of the circle's center (in deg)
radius number Radius of the circle (in deg)
options MOCOptions <optional>
Display options for the MOC
successCallback function <optional>
Callback function when the MOC loads
errorCallback function <optional>
Callback function when the MOC fails loading
Source:
Returns:
Returns a new MOC object
Type
MOC

(static) MOCFromJSON(jsonMOC, optionsopt, successCallbackopt, errorCallbackopt) → {MOC}

Creates a new MOC (Multi-Order-Coverage) from a JSON-like dictionary (javascript Object)
Parameters:
Name Type Attributes Description
jsonMOC Object The MOC stores as a JSON-like dictionary
options MOCOptions <optional>
Display options for the MOC
successCallback function <optional>
Callback function when the MOC loads
errorCallback function <optional>
Callback function when the MOC fails loading
Source:
Returns:
Returns a new MOC object
Type
MOC
Example
var json = {"3":[517],
 "4":[2065,2066,2067,2112,2344,2346,2432],
  "5":[8221,8257,8258,8259,8293,8304,8305,8307,8308,8452,8456,9346,9352,9354,9736],
  "6":[32861,32862,32863,32881,32882,32883,32892,32893,33025,33026,33027,33157,33168,33169,33171,
  33181,33224,33225,33227,33236,33240,33812,33816,33828,33832,37377,37378,37379,37382,37388,
  37390,37412,37414,37420,37422,37562,38928,38930,38936,38948,38952],
  "7":[131423,131439,131443,131523,131556,131557,131580,131581,132099,132612,132613,132624,132625,132627,132637,
  132680,132681,132683,132709,132720,132721,132904,132905,132948,132952,132964,132968,133008,133009,133012,135252,135256,135268,135316,135320,135332,135336,148143,148152,148154,149507,149520
  ,149522,149523,149652,149654,149660,149662,149684,149686,149692,149694,149695,150120,150122,150208,150210,150216,150218,150240,150242,150243,155748,155752,155796,155800,155812,155816]};
var moc = A.MOCFromJSON(json, {opacity: 0.25, color: 'magenta', lineWidth: 3});
  aladin.addMOC(moc);

(static) MOCFromPolygon(polygon, optionsopt, successCallbackopt, errorCallbackopt) → {MOC}

Creates a new MOC (Multi-Order-Coverage) from an object describing a polygon on the sky
Parameters:
Name Type Attributes Description
polygon Object A object describing a polygon in the sky
Properties
Name Type Description
ra Array.<number> Right-ascensions of the polygon's vertices (in deg)
dec Array.<number> Declination of the polygon's vertices (in deg)
options MOCOptions <optional>
Display options for the MOC
successCallback function <optional>
Callback function when the MOC loads
errorCallback function <optional>
Callback function when the MOC fails loading
Source:
Returns:
Returns a new MOC object
Type
MOC

(static) MOCFromURL(url, optionsopt, successCallbackopt, errorCallbackopt) → {MOC}

Creates a new MOC (Multi-Order-Coverage) from an url
Parameters:
Name Type Attributes Description
url string The url to the MOC (e.g. stored as FITS file)
options MOCOptions <optional>
Display options for the MOC
successCallback function <optional>
Callback function when the MOC loads
errorCallback function <optional>
Callback function when the MOC fails loading
Source:
Returns:
Returns a new MOC object
Type
MOC

(static) Utils() → {AladinUtils}

Returns utils object This contains utilitary methods such as HEALPix basic or projection methods.
Source:
Returns:
Returns a new box window object.
Type
AladinUtils

(static) aladin(divSelector, optionsopt) → {Aladin}

Creates an Aladin Lite instance within the specified HTML element.
Parameters:
Name Type Attributes Description
divSelector string | HTMLElement The ID selector for the HTML element or the HTML element itself
options AladinOptions <optional>
Options for configuring the Aladin Lite instance.
Source:
Returns:
An instance of the Aladin Lite library.
Type
Aladin
Example
var aladin;
 A.init.then(() => {
     aladin = A.aladin('#aladin-lite-div', {fullScreen: true, cooFrame: "ICRSd", showSimbadPointerControl: true, showShareControl: true, showShareControl: true, survey: 'https://alasky.cds.unistra.fr/DSS/DSSColor/', fov: 180, showContextMenu: true});
 })

(static) box(options) → {Box}

Creates a box user interface for Aladin Lite.
Parameters:
Name Type Description
options Object Options for configuring the button.
Properties
Name Type Attributes Description
header Object <optional>
The header of the box
Properties
Name Type Attributes Default Description
draggable boolean <optional>
false Can move the window by dragging its title.
title string <optional>
A title name for the window
content HTMLElement | string | Widget <optional>
The content to be added to the button.
cssStyle CSSStyleSheet <optional>
The CSS styles to apply to the button.
position Object | string <optional>
The position of the button.
Source:
Returns:
Returns a new box window object.
Type
Box
Example
let box = A.box({
      header: {
          title: "My window",
          draggable: true,
      },
      // Adding a CSS class allowing you to position your window on the aladin lite view
      classList: ['myBox'],
      content: "This is the content of my window<br/> I can write proper html",
  })
  aladin.addUI(box)

(static) button(options) → {ActionButton}

Creates a user interface button for Aladin Lite
Parameters:
Name Type Description
options Object Options for configuring the button.
Properties
Name Type Attributes Default Description
toggled boolean <optional>
false Whether the button is initially toggled.
action function <optional>
The callback function to execute when the button is clicked.
title string <optional>
The title attribute for the button.
icon Object <optional>
An icon object for the button.
disable boolean <optional>
false Whether the button is initially disabled.
content HTMLElement | string | Widget <optional>
The content to be added to the button.
cssStyle CSSStyleSheet <optional>
The CSS styles to apply to the button.
tooltip Object <optional>
A tooltip.
position Object | string <optional>
The position of the button.
size string <optional>
The size of the button. Can be 'medium' or 'small'
Source:
Returns:
Returns a new button object representing the graphic overlay.
Type
ActionButton
Example
<!-- This example instanciates a customized button that when clicked, enters the user in
the polygonal selection mode. Once the polygon selection is done, the vertices are converted
to sky coords and a Multi-Order Coverage (MOC) is created from that list of sky coords. -->
<!doctype html>
<html>
<head>
</head>
<body>


<div id="aladin-lite-div" style="width: 512px; height: 512px"></div>

<script type="module">
    import A from aladin-lite;
    let aladin;
    A.init.then(() => {
        var aladin = A.aladin(
            '#aladin-lite-div',
            {
                survey: 'P/allWISE/color', // set initial image survey
                projection: 'AIT', // set a projection
                fov: 1.5, // initial field of view in degrees
                target: 'NGC 2175', // initial target
                cooFrame: 'icrs', // set galactic frame
                reticleColor: '#ff89ff', // change reticle color
                reticleSize: 64, // change reticle size
                showContextMenu: true,
            }
        );

        let btn = A.button({
            content: 'My button',
            classList: ['myButton'],
            tooltip: {cssStyle: {color: 'red'}, content: 'Create a moc in pink!', position: {direction: 'top'}},
            action(o) {
                aladin.select('poly', p => {
                    try {
                        let ra = []
                        let dec = []
                        for (const v of p.vertices) {
                            let [lon, lat] = aladin.pix2world(v.x, v.y);
                            ra.push(lon)
                            dec.push(lat)
                        }

                        let moc = A.MOCFromPolygon(
                            {ra, dec},
                            {name: 'poly', lineWidth: 3.0, color: 'pink'},
                        );
                        aladin.addMOC(moc)
                    } catch(_) {
                        alert('Selection covers a region out of the projection definition domain.');
                    }
                })
            }
        });

        aladin.addUI(btn)
    });
</script>
<style>
    .myButton {
        position: absolute;
        bottom: 0;
        left: 0;

        background-color: pink;
    }
</style>
</body>
</html>

(static) catalog(options) → {Catalog}

Represents a catalog with configurable options for display and interaction.
Parameters:
Name Type Description
options CatalogOptions Configuration options for the catalog.
Source:
Returns:
Type
Catalog

(static) catalogFromNED(target, radius, optionsopt, successCallbackopt, errorCallbackopt) → {Catalog}

Create a catalog from a NED cone search query
Parameters:
Name Type Attributes Description
target string | Object can be either a string representing a position or an object name, or can be an object with keys 'ra' and 'dec' (values being in decimal degrees)
Properties
Name Type Description
ra number Right Ascenscion in degrees of the cone's center
dec number Declination in degrees of the cone's center
radius number Radius of the cone in degrees
options CatalogOptions <optional>
Additional configuration options for the catalogue.
successCallback function <optional>
The callback function to execute on successful catalog creation.
errorCallback function <optional>
The callback function to execute on error during catalog creation.
Source:
Returns:
Type
Catalog
Example
A.catalogFromNED('09 55 52.4 +69 40 47', 0.1, {onClick: 'showPopup', shape: 'plus'})

(static) catalogFromSKAORucio(target, radiusDegrees, optionsopt, successCallbackopt, errorCallbackopt) → {Catalog}

Create a catalog from a SKAORucio cone search query
Parameters:
Name Type Attributes Description
target string | Object can be either a string representing a position or an object name, or can be an object with keys 'ra' and 'dec' (values being in decimal degrees)
Properties
Name Type Description
ra number Right Ascenscion in degrees of the cone's center
dec number Declination in degrees of the cone's center
radiusDegrees number Radius of the cone in degrees
options CatalogOptions <optional>
Additional configuration options for the catalogue.
successCallback function <optional>
The callback function to execute on successful catalog creation.
errorCallback function <optional>
The callback function to execute on error during catalog creation.
Source:
Returns:
Type
Catalog
Example
A.catalogFromSKAORucio('09 55 52.4 +69 40 47', 0.1, {onClick: 'showPopup', shape: 'plus'})

(static) catalogFromSimbad(target, radius, optionsopt, successCallbackopt, errorCallbackopt) → {Catalog}

Create a catalog from a SIMBAD cone search query
Parameters:
Name Type Attributes Description
target string | Object can be either a string representing a position or an object name, or can be an object with keys 'ra' and 'dec' (values being in decimal degrees)
Properties
Name Type Description
ra number Right Ascenscion in degrees of the cone's center
dec number Declination in degrees of the cone's center
radius number Radius of the cone in degrees
options Object | CatalogOptions <optional>
Additional configuration options for SIMBAD cone search. See the SIMBAD cone search parameters.
Properties
Name Type Attributes Default Description
limit number <optional>
The max number of sources to return
orderBy string <optional>
'nb_ref' Order the result by specific ref number
verbosity number <optional>
2 Verbosity, put 3 if you want all the column
successCallback function <optional>
The callback function to execute on successful catalog creation.
errorCallback function <optional>
The callback function to execute on error during catalog creation.
Source:
Returns:
A new instance of the Catalog class created from the SIMBAD cone search.
Type
Catalog
Example
A.catalogFromSimbad('09 55 52.4 +69 40 47', 0.1, {onClick: 'showTable', limit: 1000}, (cat) => {
     aladin.addCatalog(cat)
 });

(static) catalogFromSkyBot(ra, dec, radius, epoch, queryOptions, optionsopt, successCallbackopt, errorCallbackopt) → {Catalog}

Create a catalog from a SkyBot cone search query
Parameters:
Name Type Attributes Description
ra number Right Ascenscion in degrees of the cone's center
dec number Declination in degrees of the cone's center
radius number Radius of the cone in degrees
epoch string Requested epoch, expressed in Julian day or ISO dateTime
queryOptions Object options passed to SkyBot, see https://vo.imcce.fr/webservices/skybot/?conesearch
options CatalogOptions <optional>
Additional configuration options for the catalogue.
successCallback function <optional>
The callback function to execute on successful catalog creation.
errorCallback function <optional>
The callback function to execute on error during catalog creation.
Source:
Returns:
Type
Catalog

(static) catalogFromURL(url, optionsopt, successCallbackopt, errorCallbackopt, useProxyopt) → {Catalog}

Asynchronously creates a new catalog instance from the specified URL with additional options.
Parameters:
Name Type Attributes Default Description
url string The URL of the catalog.
options CatalogOptions <optional>
Additional configuration options for the catalog.
successCallback function <optional>
The callback function to execute on successful catalog creation.
errorCallback function <optional>
The callback function to execute on error during catalog creation.
useProxy boolean <optional>
false Indicates whether to use a proxy for loading the catalog.
Source:
Returns:
A new instance of the Catalog class created from the specified URL.
Type
Catalog
Example
// Create a catalog from a URL using the A.catalogFromURL method
const catalogURL = "https://example.com/catalog";
const catalogOptions = {
  name: "My Catalog",
  color: "#ff0000",
  sourceSize: 10,
  // ... other options
};

const myCatalog = A.catalogFromURL(
  catalogURL,
  catalogOptions,
  (catalog) => {
    // Catalog successfully loaded
    aladin.addCatalog(catalog)
  },
  (error) => {
    // Error loading catalog
    console.error("Error loading catalog:", error);
  },
);

(static) catalogFromVizieR(vizCatId, target, radius, optionsopt, successCallbackopt, errorCallbackopt) → {Catalog}

Create a catalog from a SKAORucio cone search query
Parameters:
Name Type Attributes Description
vizCatId string the id of the ViZieR catalog
target string | Object can be either a string representing a position or an object name, or can be an object with keys 'ra' and 'dec' (values being in decimal degrees)
Properties
Name Type Description
ra number Right Ascenscion in degrees of the cone's center
dec number Declination in degrees of the cone's center
radius number Radius of the cone in degrees
options CatalogOptions <optional>
Additional configuration options for the catalogue.
successCallback function <optional>
The callback function to execute on successful catalog creation.
errorCallback function <optional>
The callback function to execute on error during catalog creation.
Source:
Returns:
Type
Catalog
Example
const cat = A.catalogFromVizieR('I/311/hip2', 'M 45', 5, {onClick: 'showTable'});

(static) catalogHiPS(url, options) → {ProgressiveCat}

Creates progressive catalog object (i.e. Simbad/Gaia)
Parameters:
Name Type Description
url string Root url of the catalog
options CatalogOptions Options for configuring the catalogue.
Source:
Returns:
Returns a new Overlay object representing the graphic overlay.
Type
ProgressiveCat
Example
let gaia = A.catalogHiPS('http://axel.u-strasbg.fr/HiPSCatService/I/345/gaia2', {onClick: 'showTable', color: 'orange', name: 'Gaia', filter: myFilterFunction});
aladin.addCatalog(gaia)

(static) circle(ra, dec, radiusDeg, options) → {Circle}

Creates a circle shape
Parameters:
Name Type Description
ra number Right Ascension (RA) coordinate of the center in degrees.
dec number Declination (Dec) coordinate of the center in degrees.
radiusDeg number Radius in degrees.
options ShapeOptions Options for configuring the circle.
Source:
Returns:
Type
Circle

(static) coo(longitude, latitude, prec) → {Coo}

Creates a new coo from a longitude and latitude given in degrees
Parameters:
Name Type Description
longitude number longitude (decimal degrees)
latitude number latitude (decimal degrees)
prec number precision (8: 1/1000th sec, 7: 1/100th sec, 6: 1/10th sec, 5: sec, 4: 1/10th min, 3: min, 2: 1/10th deg, 1: deg
Source:
Returns:
Returns a new Coo object
Type
Coo

(static) ellipse(ra, dec, radiusRaDeg, radiusDecDeg, rotationDeg, options) → {Ellipse}

Creates an ellipse shape
Parameters:
Name Type Description
ra number Right Ascension (RA) coordinate of the center in degrees.
dec number Declination (Dec) coordinate of the center in degrees.
radiusRaDeg number the radius along the ra axis in degrees
radiusDecDeg number the radius along the dec axis in degrees
rotationDeg number the rotation angle in degrees
options ShapeOptions Options for configuring the ellipse.
Source:
Returns:
Type
Ellipse

(static) footprintsFromSTCS(stcs, optionsopt) → {Array.<(Polyline|Circle)>}

Parse shapes from a STC-S string
Parameters:
Name Type Attributes Description
stcs string The STC-S string describing the shapes
options ShapeOptions <optional>
Options for the shape
Source:
Returns:
Returns a list of shapes from the STC-S string
Type
Array.<(Polyline|Circle)>

(static) graphicOverlay(options) → {Overlay}

Creates a graphic overlay on the Aladin Lite view.
Parameters:
Name Type Description
options Object Options for configuring the graphic overlay.
Properties
Name Type Attributes Description
color string <optional>
The color of the graphic overlay.
lineWidth number <optional>
The width of the lines in the graphic overlay.
lineDash Array <optional>
The dash pattern for the lines in the graphic overlay.
Source:
Returns:
Returns a new Overlay object representing the graphic overlay.
Type
Overlay
Example
var overlay = A.graphicOverlay({ color: '#ee2345', lineWidth: 3, lineDash: [2, 4]});

(static) imageFITS(url, optionsopt) → {ImageFITS}

Creates a celestial source object with the given coordinates.
Parameters:
Name Type Attributes Description
url string Options describing the fits file. An url is mandatory
options ImageFITSOptions <optional>
Options describing the fits file. An url is mandatory
Source:
Returns:
- A HiPS image object
Type
ImageFITS
Example
const sourceObj = A.source(180.0, 30.0, data, options);

(static) imageHiPS(id, optionsopt) → {ImageHiPS}

Creates a HiPS image object
Parameters:
Name Type Attributes Description
id string Can be either an `url` that refers to a HiPS. Or it can be a "CDS ID" pointing towards a HiPS. One can found the list of IDs here.
options ImageHiPSOptions <optional>
Options describing the survey
Source:
Returns:
- A HiPS image object
Type
ImageHiPS

(async, static) init() → {Promise.<void>}

Initializes the Aladin Lite library, checking for WebGL2 support. This method must be called before instancing an Aladin Lite object.
Source:
Throws:
Throws an error if WebGL2 is not supported by the browser.
Type
string
Returns:
A promise that resolves once the initialization is complete.
Type
Promise.<void>
Example
// Usage example:
A.init
  .then(async () => {
    const aladinInstance = A.aladin('div', requestedOptions);
    // Perform further actions with the Aladin Lite instance
  })
  .catch(error => {
    console.error('Error initializing Aladin Lite:', error);
  });

(static) line(ra1, dec1, ra2, dec2, frameopt, options) → {Line}

Creates a line shape
Parameters:
Name Type Attributes Description
ra1 number Right Ascension (RA) coordinate of the center in degrees.
dec1 number Declination (Dec) coordinate of the center in degrees.
ra2 number Right Ascension (RA) coordinate of the center in degrees.
dec2 number Declination (Dec) coordinate of the center in degrees.
frame CooFrame <optional>
Frame in which the coordinates are given. If none, the frame used is icrs/j2000.
options ShapeOptions Options for configuring the line.
Source:
Returns:
Type
Line

(static) marker(ra, dec, optionsopt, dataopt) → {Source}

Creates a marker at the specified celestial coordinates.
Parameters:
Name Type Attributes Description
ra number Right Ascension (RA) coordinate in degrees.
dec number Declination (Dec) coordinate in degrees.
options MarkerOptions <optional>
Options for configuring the marker.
data Object <optional>
Additional data associated with the marker.
Source:
Returns:
A marker source object.
Type
Source
Example
const markerObj = A.marker(180.0, 30.0, data, options);

(static) polygon(radecArray, options) → {Polyline}

Creates a polygon object using an array of celestial coordinates (RA, Dec).
Parameters:
Name Type Description
radecArray Array.<Array.<number>> right-ascension/declination 2-tuple array describing the polyline's vertices in degrees
options ShapeOptions Options for configuring the polygon
Source:
Throws:
Throws an error if the number of vertices is less than 3.
Type
string
Returns:
Type
Polyline

(static) polyline(radecArray, options) → {Polyline}

Creates a polyline shape
Parameters:
Name Type Description
radecArray Array.<Array.<number>> right-ascension/declination 2-tuple array describing the polyline's vertices in degrees
options ShapeOptions Options for configuring the polyline.
Source:
Returns:
Type
Polyline

(static) source(ra, dec, dataopt, optionsopt) → {Source}

Creates a celestial source object with the given coordinates.
Parameters:
Name Type Attributes Description
ra number Right Ascension (RA) coordinate in degrees.
dec number Declination (Dec) coordinate in degrees.
data Object <optional>
Additional data associated with the source.
options SourceOptions <optional>
Options for configuring the source object.
Source:
Returns:
A celestial source object.
Type
Source
Example
const sourceObj = A.source(180.0, 30.0, data, options);

(static) vector(ra1, dec1, ra2, dec2, options) → {Line}

Creates a vector shape
Parameters:
Name Type Description
ra1 number Right Ascension (RA) coordinate of the center in degrees.
dec1 number Declination (Dec) coordinate of the center in degrees.
ra2 number Right Ascension (RA) coordinate of the center in degrees.
dec2 number Declination (Dec) coordinate of the center in degrees.
options ShapeOptions Options for configuring the vector.
Source:
Returns:
Type
Line