Skip to content

Commit 2395cb9

Browse files
committed
wcs basic doc + filelist doc
1 parent d61b56c commit 2395cb9

File tree

5 files changed

+77
-26
lines changed

5 files changed

+77
-26
lines changed

src/js/A.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ A.aladin = function (divSelector, options) {
112112
* @function
113113
* @name A.HiPS
114114
* @memberof A
115-
* @param {string|FileList|Object} id - Can be: <br/>
116-
* - an http url <br/>
117-
* - a relative path to your HiPS <br/>
118-
* - a special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here} <br/>
119-
* - 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/>
120-
* A javascript FileList pointing to the opened webkit directory is also accepted.
115+
* @param {string} id - Can be:
116+
* <ul>
117+
* <li>An http url towards a HiPS.</li>
118+
* <li>A relative path to your HiPS</li>
119+
* <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>
120+
* </ul>
121121
* @param {HiPSOptions} [options] - Options describing the survey
122122
* @returns {HiPS} - A HiPS image object
123123
*/

src/js/Aladin.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,10 +1500,13 @@ export let Aladin = (function () {
15001500
* @memberof Aladin
15011501
* @param {string} id - Mandatory unique identifier for the survey.
15021502
* @param {string} [name] - A convinient name for the survey, optional
1503-
* @param {string} url - Can be:
1503+
* @param {string|FileList|HiPSLocalFiles} url - Can be:
15041504
* <ul>
1505-
* <li>1. An url that refers to a HiPS.</li>
1506-
* <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>
1505+
* <li>An http url towards a HiPS.</li>
1506+
* <li>A relative path to your HiPS</li>
1507+
* <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>
1508+
* <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>
1509+
* A javascript {@link FileList} pointing to the opened webkit directory is also accepted.
15071510
* </ul>
15081511
* @param {string} [cooFrame] - Values accepted: 'equatorial', 'icrs', 'icrsd', 'j2000', 'gal', 'galactic'
15091512
* @param {number} [maxOrder] - The maximum HEALPix order of the HiPS, i.e the HEALPix order of the most refined tile images of the HiPS.
@@ -1534,10 +1537,13 @@ export let Aladin = (function () {
15341537
* @static
15351538
* @param {string} id - Mandatory unique identifier for the survey.
15361539
* @param {string} [name] - A convinient name for the survey, optional
1537-
* @param {string} url - Can be:
1540+
* @param {string|FileList|HiPSLocalFiles} url - Can be:
15381541
* <ul>
1539-
* <li>1. An url that refers to a HiPS.</li>
1540-
* <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>
1542+
* <li>An http url towards a HiPS.</li>
1543+
* <li>A relative path to your HiPS</li>
1544+
* <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>
1545+
* <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>
1546+
* A javascript {@link FileList} pointing to the opened webkit directory is also accepted.
15411547
* </ul>
15421548
* @param {string} [cooFrame] - Values accepted: 'equatorial', 'icrs', 'icrsd', 'j2000', 'gal', 'galactic'
15431549
* @param {number} [maxOrder] - The maximum HEALPix order of the HiPS, i.e the HEALPix order of the most refined tile images of the HiPS.
@@ -1581,7 +1587,7 @@ export let Aladin = (function () {
15811587
* <ul>
15821588
* <li>1. An url that refers to a HiPS</li>
15831589
* <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>
1584-
* <li>3. A {@link HiPS} HiPS object created from {@link A.HiPS}</li>
1590+
* <li>3. A {@link HiPS} HiPS object</li>
15851591
* <li>4. A {@link Image} Image object</li>
15861592
* </ul>
15871593
*/
@@ -1649,8 +1655,9 @@ export let Aladin = (function () {
16491655
* @memberof Aladin
16501656
* @param {string} id - Can be:
16511657
* <ul>
1652-
* <li>1. An url that refers to a HiPS.</li>
1653-
* <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>
1658+
* <li>An http url towards a HiPS.</li>
1659+
* <li>A relative path to your HiPS</li>
1660+
* <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>
16541661
* </ul>
16551662
* @param {HiPSOptions} [options] - Options for rendering the image
16561663
* @param {function} [success] - A success callback

src/js/AladinUtils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,17 @@ export let AladinUtils = {
153153
*/
154154
Sesame: {
155155
/**
156-
* find RA, DEC for any target (object name or position) <br/>
157-
* if successful, callback is called with an object {ra: ra-value, dec: dec-value} <br/>
156+
* Find RA, DEC for any target (object name or position) <br/>
157+
* if successful, callback is called with an object {ra: {@link number}, dec: {@link number}} <br/>
158158
* if not successful, errorCallback is called
159159
*
160160
* @function
161161
* @memberof AladinUtils.Sesame
162162
* @name resolveAstronomicalName
163163
*
164164
* @param {string} target - object name or position
165-
* @param {Function} callback - if successful, callback is called with an object {ra: <ra-value>, dec: <dec-value>}
166-
* @param {Function} errorCallback - if not successful, errorCallback is called
165+
* @param {Function} callback - if successful, callback is called with an object {ra: {@link number}, dec: {@link number}}
166+
* @param {Function} errorCallback - if not successful, errorCallback is called with the error
167167
*/
168168
resolveAstronomicalName: Sesame.getTargetRADec
169169
},

src/js/HiPS.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,18 @@ PropertyParser.isPlanetaryBody = function (properties) {
159159
*
160160
* JS {@link https://developer.mozilla.org/fr/docs/Web/API/FileList| FileList} API type
161161
*/
162+
163+
/**
164+
* @typedef {Object} HiPSLocalFiles
165+
*
166+
* @property {File} properties - The local properties file of the HiPS
167+
*
168+
* @description
169+
* Tiles are accessed like so: HIPSLocalFiles[norder][ipix] = {@link File};<br/>
170+
* The properties file is accessed with: HIPSLocalFiles["properties"]
171+
*/
172+
173+
162174
export let HiPS = (function () {
163175
/**
164176
* The object describing an image survey
@@ -167,12 +179,14 @@ export let HiPS = (function () {
167179
* @constructs HiPS
168180
*
169181
* @param {string} id - Mandatory unique identifier for the layer. Can be an arbitrary name
170-
* @param {string|FileList|Object} location - Can be:
171-
* - an http url <br/>
172-
* - a relative path to your HiPS <br/>
173-
* - a special ID pointing towards a HiPS. One can found the list of IDs {@link https://aladin.cds.unistra.fr/hips/list| here} <br/>
174-
* - 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/>
175-
* A javascript FileList pointing to the opened webkit directory is also accepted.
182+
* @param {string|FileList|HiPSLocalFiles} url - Can be:
183+
* <ul>
184+
* <li>An http url towards a HiPS.</li>
185+
* <li>A relative path to your HiPS</li>
186+
* <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>
187+
* <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>
188+
* A javascript {@link FileList} pointing to the opened webkit directory is also accepted.
189+
* </ul>
176190
* @param {HiPSOptions} [options] - The option for the survey
177191
*
178192
* @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.

src/js/Image.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ import { Utils } from "./Utils";
3131
import { AVM } from "./libs/avm.js";
3232
import { HiPS } from "./HiPS.js";
3333

34+
/**
35+
* @typedef {Object} WCS
36+
*
37+
* {@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
38+
*
39+
* @property {number} [NAXIS]
40+
* @property {string} CTYPE1
41+
* @property {string} [CTYPE2]
42+
* @property {number} [LONPOLE]
43+
* @property {number} [LATPOLE]
44+
* @property {number} [CRVAL1]
45+
* @property {number} [CRVAL2]
46+
* @property {number} [CRPIX1]
47+
* @property {number} [CRPIX2]
48+
* @property {string} [CUNIT1] - e.g. 'deg'
49+
* @property {string} [CUNIT2] - e.g. 'deg'
50+
* @property {number} [CD1_1]
51+
* @property {number} [CD1_2]
52+
* @property {number} [CD2_1]
53+
* @property {number} [CD2_2]
54+
* @property {number} [PC1_1]
55+
* @property {number} [PC1_2]
56+
* @property {number} [PC2_1]
57+
* @property {number} [PC2_2]
58+
* @property {number} [CDELT1]
59+
* @property {number} [CDELT2]
60+
* @property {number} [NAXIS1]
61+
* @property {number} [NAXIS2]
62+
*/
63+
3464
/**
3565
* @typedef {Object} ImageOptions
3666
*
@@ -48,7 +78,7 @@ import { HiPS } from "./HiPS.js";
4878
* @property {number} [saturation=0.0] - The saturation value for the color configuration.
4979
* @property {number} [brightness=0.0] - The brightness value for the color configuration.
5080
* @property {number} [contrast=0.0] - The contrast value for the color configuration.
51-
* @property {Object} [wcs] - an object describing the WCS of the image. In case of a fits image
81+
* @property {WCS} [wcs] - an object describing the WCS of the image. In case of a fits image
5282
* this property will be ignored as the WCS taken will be the one present in the fits file.
5383
* @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.
5484
*

0 commit comments

Comments
 (0)