Skip to content

Commit

Permalink
wcs basic doc + filelist doc
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatthieu3 committed Sep 19, 2024
1 parent d61b56c commit 2395cb9
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 26 deletions.
12 changes: 6 additions & 6 deletions src/js/A.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ A.aladin = function (divSelector, options) {
* @function
* @name A.HiPS
* @memberof A
* @param {string|FileList|Object} id - Can be: <br/>
* - an http url <br/>
* - a relative path to your HiPS <br/>
* - a special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here} <br/>
* - a dict storing a local HiPS files. This object contains a tile file: hips[order][ipix] = File and refers to the properties file like so: hips["properties"] = File. <br/>
* A javascript FileList pointing to the opened webkit directory is also accepted.
* @param {string} id - Can be:
* <ul>
* <li>An http url towards a HiPS.</li>
* <li>A relative path to your HiPS</li>
* <li>A special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* </ul>
* @param {HiPSOptions} [options] - Options describing the survey
* @returns {HiPS} - A HiPS image object
*/
Expand Down
25 changes: 16 additions & 9 deletions src/js/Aladin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1500,10 +1500,13 @@ export let Aladin = (function () {
* @memberof Aladin
* @param {string} id - Mandatory unique identifier for the survey.
* @param {string} [name] - A convinient name for the survey, optional
* @param {string} url - Can be:
* @param {string|FileList|HiPSLocalFiles} url - Can be:
* <ul>
* <li>1. An url that refers to a HiPS.</li>
* <li>Or it can be a "CDS ID" that refers to a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>An http url towards a HiPS.</li>
* <li>A relative path to your HiPS</li>
* <li>A special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>A dict storing a local HiPS files. This object contains a tile file: hips[order][ipix] = File and refers to the properties file like so: hips["properties"] = File. </li>
* A javascript {@link FileList} pointing to the opened webkit directory is also accepted.
* </ul>
* @param {string} [cooFrame] - Values accepted: 'equatorial', 'icrs', 'icrsd', 'j2000', 'gal', 'galactic'
* @param {number} [maxOrder] - The maximum HEALPix order of the HiPS, i.e the HEALPix order of the most refined tile images of the HiPS.
Expand Down Expand Up @@ -1534,10 +1537,13 @@ export let Aladin = (function () {
* @static
* @param {string} id - Mandatory unique identifier for the survey.
* @param {string} [name] - A convinient name for the survey, optional
* @param {string} url - Can be:
* @param {string|FileList|HiPSLocalFiles} url - Can be:
* <ul>
* <li>1. An url that refers to a HiPS.</li>
* <li>Or it can be a "CDS ID" that refers to a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>An http url towards a HiPS.</li>
* <li>A relative path to your HiPS</li>
* <li>A special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>A dict storing a local HiPS files. This object contains a tile file: hips[order][ipix] = File and refers to the properties file like so: hips["properties"] = File. </li>
* A javascript {@link FileList} pointing to the opened webkit directory is also accepted.
* </ul>
* @param {string} [cooFrame] - Values accepted: 'equatorial', 'icrs', 'icrsd', 'j2000', 'gal', 'galactic'
* @param {number} [maxOrder] - The maximum HEALPix order of the HiPS, i.e the HEALPix order of the most refined tile images of the HiPS.
Expand Down Expand Up @@ -1581,7 +1587,7 @@ export let Aladin = (function () {
* <ul>
* <li>1. An url that refers to a HiPS</li>
* <li>2. Or it can be a CDS identifier that refers to a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>3. A {@link HiPS} HiPS object created from {@link A.HiPS}</li>
* <li>3. A {@link HiPS} HiPS object</li>
* <li>4. A {@link Image} Image object</li>
* </ul>
*/
Expand Down Expand Up @@ -1649,8 +1655,9 @@ export let Aladin = (function () {
* @memberof Aladin
* @param {string} id - Can be:
* <ul>
* <li>1. An url that refers to a HiPS.</li>
* <li>Or it can be a "CDS ID" that refers to a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>An http url towards a HiPS.</li>
* <li>A relative path to your HiPS</li>
* <li>A special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* </ul>
* @param {HiPSOptions} [options] - Options for rendering the image
* @param {function} [success] - A success callback
Expand Down
8 changes: 4 additions & 4 deletions src/js/AladinUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@ export let AladinUtils = {
*/
Sesame: {
/**
* find RA, DEC for any target (object name or position) <br/>
* if successful, callback is called with an object {ra: ra-value, dec: dec-value} <br/>
* Find RA, DEC for any target (object name or position) <br/>
* if successful, callback is called with an object {ra: {@link number}, dec: {@link number}} <br/>
* if not successful, errorCallback is called
*
* @function
* @memberof AladinUtils.Sesame
* @name resolveAstronomicalName
*
* @param {string} target - object name or position
* @param {Function} callback - if successful, callback is called with an object {ra: <ra-value>, dec: <dec-value>}
* @param {Function} errorCallback - if not successful, errorCallback is called
* @param {Function} callback - if successful, callback is called with an object {ra: {@link number}, dec: {@link number}}
* @param {Function} errorCallback - if not successful, errorCallback is called with the error
*/
resolveAstronomicalName: Sesame.getTargetRADec
},
Expand Down
26 changes: 20 additions & 6 deletions src/js/HiPS.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ PropertyParser.isPlanetaryBody = function (properties) {
*
* JS {@link https://developer.mozilla.org/fr/docs/Web/API/FileList| FileList} API type
*/

/**
* @typedef {Object} HiPSLocalFiles
*
* @property {File} properties - The local properties file of the HiPS
*
* @description
* Tiles are accessed like so: HIPSLocalFiles[norder][ipix] = {@link File};<br/>
* The properties file is accessed with: HIPSLocalFiles["properties"]
*/


export let HiPS = (function () {
/**
* The object describing an image survey
Expand All @@ -167,12 +179,14 @@ export let HiPS = (function () {
* @constructs HiPS
*
* @param {string} id - Mandatory unique identifier for the layer. Can be an arbitrary name
* @param {string|FileList|Object} location - Can be:
* - an http url <br/>
* - a relative path to your HiPS <br/>
* - a special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here} <br/>
* - a dict storing a local HiPS. This object contains a tile file: hips[order][ipix] = File and refers to the properties file like so: hips["properties"] = File. <br/>
* A javascript FileList pointing to the opened webkit directory is also accepted.
* @param {string|FileList|HiPSLocalFiles} url - Can be:
* <ul>
* <li>An http url towards a HiPS.</li>
* <li>A relative path to your HiPS</li>
* <li>A special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here}</li>
* <li>A dict storing a local HiPS files. This object contains a tile file: hips[order][ipix] = File and refers to the properties file like so: hips["properties"] = File. </li>
* A javascript {@link FileList} pointing to the opened webkit directory is also accepted.
* </ul>
* @param {HiPSOptions} [options] - The option for the survey
*
* @description Giving a CDS ID will do a query to the MOCServer first to retrieve metadata. Then it will also check for the presence of faster HiPS nodes to choose a faster url to query to tiles from.
Expand Down
32 changes: 31 additions & 1 deletion src/js/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,36 @@ import { Utils } from "./Utils";
import { AVM } from "./libs/avm.js";
import { HiPS } from "./HiPS.js";

/**
* @typedef {Object} WCS
*
* {@link https://ui.adsabs.harvard.edu/abs/2002A%26A...395.1077C/abstract|FITS (Paper II)}, Calabretta, M. R., and Greisen, E. W., Astronomy & Astrophysics, 395, 1077-1122, 2002
*
* @property {number} [NAXIS]
* @property {string} CTYPE1
* @property {string} [CTYPE2]
* @property {number} [LONPOLE]
* @property {number} [LATPOLE]
* @property {number} [CRVAL1]
* @property {number} [CRVAL2]
* @property {number} [CRPIX1]
* @property {number} [CRPIX2]
* @property {string} [CUNIT1] - e.g. 'deg'
* @property {string} [CUNIT2] - e.g. 'deg'
* @property {number} [CD1_1]
* @property {number} [CD1_2]
* @property {number} [CD2_1]
* @property {number} [CD2_2]
* @property {number} [PC1_1]
* @property {number} [PC1_2]
* @property {number} [PC2_1]
* @property {number} [PC2_2]
* @property {number} [CDELT1]
* @property {number} [CDELT2]
* @property {number} [NAXIS1]
* @property {number} [NAXIS2]
*/

/**
* @typedef {Object} ImageOptions
*
Expand All @@ -48,7 +78,7 @@ import { HiPS } from "./HiPS.js";
* @property {number} [saturation=0.0] - The saturation value for the color configuration.
* @property {number} [brightness=0.0] - The brightness value for the color configuration.
* @property {number} [contrast=0.0] - The contrast value for the color configuration.
* @property {Object} [wcs] - an object describing the WCS of the image. In case of a fits image
* @property {WCS} [wcs] - an object describing the WCS of the image. In case of a fits image
* this property will be ignored as the WCS taken will be the one present in the fits file.
* @property {string} [imgFormat] - Optional image format. Giving it will prevent the auto extension determination algorithm to be triggered. Possible values are 'jpeg', 'png' or 'fits'. tiff files are not supported. You can convert your tiff files to jpg ones by using the fantastic image magick suite.
*
Expand Down

0 comments on commit 2395cb9

Please sign in to comment.