HiPS

HiPS

new HiPS(id, url, optionsopt)

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.
Source:
Parameters:
Name Type Attributes Description
id string Mandatory unique identifier for the layer. Can be an arbitrary name
url string | FileList | HiPSLocalFiles Can be:
  • An http url towards a HiPS.
  • A relative path to your HiPS
  • A special ID pointing towards a HiPS. One can found the list of IDs here
  • 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.
  • A javascript FileList pointing to the opened webkit directory is also accepted.
options HiPSOptions <optional>
The option for the survey

Members

setAlpha

Description:
Source:
Deprecated:
  • Yes
Old method for setting the opacity use HiPS#setOpacity instead

(static) Image#getOpacity

Description:
  • Get the opacity of the image layer
Source:
Get the opacity of the image layer

Methods

getAvailableFormats() → {Array.<string>}

Description:
  • Get the list of accepted tile format for that HiPS
Source:
Returns:
Returns the formats accepted for the survey, i.e. the formats of tiles that are availables. Could be PNG, WEBP, JPG and FITS.
Type
Array.<string>

getCuts() → {Array.<number>}

Description:
  • Returns the low and high cuts under the form of a 2 element array
Source:
Returns:
The low and high cut values for the HiPS.
Type
Array.<number>

getOpacity() → {number}

Description:
  • Get the opacity of the HiPS layer
Source:
Returns:
The opacity of the layer
Type
number

isPlanetaryBody() → {boolean}

Description:
  • Checks if the HiPS represents a planetary body. This method returns a boolean indicating whether the HiPS corresponds to a planetary body, e.g. the earth or a celestial body.
Source:
Returns:
Returns true if the HiPS represents a planetary body; otherwise, returns false.
Type
boolean

probe(prober) → {Array.<number>}

Description:
  • Returns the true pixels composing this HiPS. This method returns the true value coming from the tiles (whether it refers to colored or 1 channel fits ones). It does not take into account the apply of a transfer function, a colormap, cuts etc... i.e. it returns the true pixel values coming from the tiles. This method is called by HiPS#readPixel with a pixel prober on the view center. If you want to retrieve the pixels you directly see on the screen, then you might be more interested in Aladin#readCanvas instead.
Source:
Parameters:
Name Type Description
prober PixelProber | LineProber | GreatCircleArcProber A prob object. Only, `pixel`, `line` or `arc` are accepted.
Returns:
The pixel value(s) probed.
Type
Array.<number>

readPixel(xopt, yopt) → {number}

Description:
  • Returns the true pixel value for the pixel located at the given (x, y) pixel screen position. This method returns the true value coming from the tiles (color or 1 channel fits). It does not take into account the apply of a transfer function, a colormap, cuts etc... It only returns the true pixel value coming from the tile If you want to retrieve the pixels after apply of a transfer function, colormap, etc... i.e. if you are not looking for the real HiPS pixel values, then you might be more interested in Aladin#readPixel instead.
Source:
Parameters:
Name Type Attributes Description
x number <optional>
x screen pixel coordinate. Default is set to the view center, i.e. half the width in pixels of the aladin lite div.
y number <optional>
y screen pixel coordinate. Default is set to the view center, i.e. half the height in pixels of the aladin lite div.
Returns:
- The pixel value coming directly from the tiles
Type
number

setBlendingConfig(additiveopt)

Description:
  • Sets the blending mode when rendering the HiPS
Source:
Parameters:
Name Type Attributes Default Description
additive boolean <optional>
false When rendering this survey on top of the already rendered ones, the final color of the screen is computed like:

opacity * this_survey_color + (1 - opacity) * already_rendered_color for the default mode
opacity * this_survey_color + already_rendered_color for the additive mode

Additive mode allows you to do linear survey color combination i.e. let's define 3 surveys named s1, s2, s3. Each could be associated to one color channel, i.e. s1 with red, s2 with green and s3 with the blue color channel. If the additive blending mode is enabled, then the final pixel color of your screen will be: rgb = [s1_opacity * s1_color; s2_opacity * s2_color; s3_opacity * s3_color]

setBrightness(brightness)

Description:
  • Sets the brightness for the HiPS. This method updates the brightness of the HiPS.
Source:
Parameters:
Name Type Description
brightness number The brightness value to set for the HiPS. Between 0 and 1

setColormap(colormapopt, optionsopt)

Description:
  • Sets the colormap when rendering the HiPS.
Source:
Parameters:
Name Type Attributes Description
colormap string <optional>
The colormap label to use. See here for more info about colormaps. If null or undefined, the colormap type is not changed. Possible values are:
"blues"
"cividis"
"cubehelix"
"eosb"
"grayscale"
"inferno"
"magma"
"native"
"parula"
"plasma"
"rainbow"
"rdbu"
"rdylbu"
"redtemperature"
"sinebow"
"spectral"
"summer"
"viridis"
"ylgnbu"
"ylorbr"
"red"
"green"
"blue"
options Object <optional>
Options for the colormap
Properties
Name Type Attributes Default Description
stretch string <optional>
Stretching function of the colormap. Possible values are 'linear', 'asinh', 'log', 'sqrt', 'pow'. If no given, will not change it.
reversed boolean <optional>
false Reverse the colormap axis.

setContrast(contrast)

Description:
  • Sets the contrast for the HiPS. This method updates the contrast of the HiPS and triggers the update of metadata.
Source:
Parameters:
Name Type Description
contrast number The contrast value to set for the HiPS. Between 0 and 1

setCuts(minCut, maxCut)

Description:
  • Sets the gamma correction factor for the HiPS. This method updates the gamma of the HiPS.
Source:
Parameters:
Name Type Description
minCut number The low cut value to set for the HiPS.
maxCut number The high cut value to set for the HiPS.

setGamma(gamma)

Description:
  • Sets the gamma correction factor for the HiPS. This method updates the gamma of the HiPS.
Source:
Parameters:
Name Type Description
gamma number The saturation value to set for the HiPS. Between 0.1 and 10

setImageFormat(imgFormat)

Description:
  • Sets the image format for the HiPS. This method updates the image format of the HiPS, performs format validation, and triggers the update of metadata.
Source:
Parameters:
Name Type Description
imgFormat string The desired image format. Should be one of ["fits", "png", "jpg", "webp"].
Throws:
Throws an error if the provided format is not one of the supported formats or if the format is not available for the specific HiPS.
Type
string

setOpacity(opacity)

Description:
  • Sets the opacity factor when rendering the HiPS
Source:
Parameters:
Name Type Description
opacity number Opacity of the survey to set. Between 0 and 1

setOptions(options)

Description:
  • Set color options generic method for changing colormap, opacity, ... of the HiPS
Source:
Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
imgFormat number <optional>
Image format of the HiPS tiles. Possible values are "jpeg", "png", "webp" or "fits". Some formats might not be handled depending on the survey simply because tiles of that format have not been generated.
opacity number <optional>
1.0 Opacity of the survey or image (value between 0 and 1).
colormap string <optional>
"native" The colormap configuration for the survey or image.
stretch string <optional>
"linear" The stretch configuration for the survey or image.
reversed boolean <optional>
false If true, the colormap is reversed; otherwise, it is not reversed.
minCut number <optional>
The minimum cut value for the color configuration. If not given, 0.0 for JPEG/PNG surveys, the value of the property file for FITS surveys
maxCut number <optional>
The maximum cut value for the color configuration. If not given, 1.0 for JPEG/PNG surveys, the value of the property file for FITS surveys
additive boolean <optional>
false If true, additive blending is applied; otherwise, it is not applied.
gamma number <optional>
1.0 The gamma correction value for the color configuration.
saturation number <optional>
0.0 The saturation value for the color configuration.
brightness number <optional>
0.0 The brightness value for the color configuration.
contrast number <optional>
0.0 The contrast value for the color configuration.

setSaturation(saturation)

Description:
  • Sets the saturation for the HiPS. This method updates the saturation of the HiPS.
Source:
Parameters:
Name Type Description
saturation number The saturation value to set for the HiPS. Between 0 and 1

toggle()

Description:
  • Toggle the HiPS turning its opacity to 0 back and forth
Source: