mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2025-12-25 12:25:52 -08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b2458ac8a | ||
|
|
02d97d7eba | ||
|
|
28c4a6144a | ||
|
|
e2e426493f | ||
|
|
f9f205f1d5 | ||
|
|
d070facc13 | ||
|
|
be0c84aa28 | ||
|
|
091effc92c |
3
.github/workflows/api_doc.yml
vendored
3
.github/workflows/api_doc.yml
vendored
@@ -6,7 +6,8 @@ on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
branches:
|
||||
- develop
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
16
.github/workflows/codemeta_validator.yml
vendored
Normal file
16
.github/workflows/codemeta_validator.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
name: test_codemeta
|
||||
|
||||
on:
|
||||
release:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: gitlab-registry.in2p3.fr/escape2020/wp3/eossr:v1.0
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: validate codemeta
|
||||
run: eossr-metadata-validator codemeta.json
|
||||
@@ -1,5 +1,10 @@
|
||||
# Changelogs
|
||||
|
||||
## 3.3.2
|
||||
|
||||
* [fixed] do not allow to query the properties several times for an imageHiPS
|
||||
* [fixed] Detecting raytracing rendering mode. Adapt the rendering mode in function of the fov value and the projection used. Some projections do have more distortions with wide FoVs so it is better to use the raytracing rendering mode when fov >= smaller FoV threshold.
|
||||
|
||||
## 3.3.0
|
||||
|
||||
* [fixed] multiple calls to setImageSurvey with the same survey object led to strange behaviour.
|
||||
|
||||
83
codemeta.json
Normal file
83
codemeta.json
Normal file
@@ -0,0 +1,83 @@
|
||||
{
|
||||
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
|
||||
"@type": "SoftwareSourceCode",
|
||||
"license": "https://spdx.org/licenses/GPL-3.0",
|
||||
"codeRepository": "https://github.com/cds-astro/aladin-lite",
|
||||
"dateCreated": "2013-05-01",
|
||||
"datePublished": "2013-05-01",
|
||||
"dateModified": "2023-01-31",
|
||||
"issueTracker": "https://github.com/cds-astro/aladin-lite/issues",
|
||||
"name": "Aladin Lite",
|
||||
"version": "3.3.2",
|
||||
"softwareVersion": "3.3.2",
|
||||
"description": "An astronomical HiPS visualizer in the browser.",
|
||||
"identifier": "10.5281/zenodo.7638833",
|
||||
"applicationCategory": "Astronomy, Visualization",
|
||||
"funding": "ESCAPE 824064",
|
||||
"referencePublication": "http://aspbooks.org/publications/532/007.pdf",
|
||||
"readme": "https://aladin.cds.unistra.fr/AladinLite/doc/",
|
||||
"releaseNotes": "https://aladin.cds.unistra.fr/AladinLite/doc/#release-notes",
|
||||
"funder": {
|
||||
"@type": "Organization",
|
||||
"name": "European Commission Framework Programme Horizon 2020 Research and Innovation action"
|
||||
},
|
||||
"keywords": [
|
||||
"IVOA",
|
||||
"Astronomy"
|
||||
],
|
||||
"programmingLanguage": [
|
||||
"Rust",
|
||||
"Javascript"
|
||||
],
|
||||
"relatedLink": [
|
||||
"https://aladin.cds.unistra.fr/"
|
||||
],
|
||||
"author": [
|
||||
{
|
||||
"@type": "Person",
|
||||
"@id": "https://orcid.org/0000-0002-7123-773X",
|
||||
"givenName": "Matthieu",
|
||||
"familyName": "Baumann",
|
||||
"email": "matthieu.baumann@unistra.fr",
|
||||
"affiliation": {
|
||||
"@type": "Organization",
|
||||
"name": "Universit\u00e9 de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Person",
|
||||
"@id": "https://orcid.org/0000-0001-5818-2781",
|
||||
"givenName": "Thomas",
|
||||
"familyName": "Boch",
|
||||
"email": "thomas.boch@astro.unistra.fr",
|
||||
"affiliation": {
|
||||
"@type": "Organization",
|
||||
"name": "Universit\u00e9 de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
}
|
||||
}
|
||||
],
|
||||
"maintainer": [
|
||||
{
|
||||
"@type": "Person",
|
||||
"@id": "https://orcid.org/0000-0002-7123-773X",
|
||||
"givenName": "Matthieu",
|
||||
"familyName": "Baumann",
|
||||
"email": "matthieu.baumann@unistra.fr",
|
||||
"affiliation": {
|
||||
"@type": "Organization",
|
||||
"name": "Universit\u00e9 de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Person",
|
||||
"@id": "https://orcid.org/0000-0001-5818-2781",
|
||||
"givenName": "Thomas",
|
||||
"familyName": "Boch",
|
||||
"email": "thomas.boch@astro.unistra.fr",
|
||||
"affiliation": {
|
||||
"@type": "Organization",
|
||||
"name": "Universit\u00e9 de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -25,8 +25,7 @@
|
||||
aladin.setBaseImageLayer("P/PanSTARRS/DR1/g", {imgFormat: "fits"});
|
||||
aladin.getBaseImageLayer().setColormap('redtemperature', {stretch: "Asinh"});*/
|
||||
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: 'CDS/P/SDSS9/color', fov: 60, target: '0 90', fullScreen: true, cooFrame: 'equatorial', showCooGridControl: true, showSimbadPointerControl: true, showCooGrid: true});
|
||||
aladin.setProjection('SIN');
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: 'CDS/P/SDSS9/color', fov: 150, target: '0 90', fullScreen: true, cooFrame: 'equatorial', showCooGridControl: true, showSimbadPointerControl: true, showCooGrid: true});
|
||||
|
||||
//let survey = aladin.createImageSurvey("P/PanSTARRS/DR1/g", null, null, null, null, );
|
||||
/*aladin.setBaseImageLayer("P/PanSTARRS/DR1/g");
|
||||
|
||||
@@ -1,34 +1,35 @@
|
||||
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
|
||||
</head>
|
||||
<body>
|
||||
<div id="aladin-lite-div" style="width: 500px; height: 400px"></div>
|
||||
<div id="aladin-lite-div" style="width: 500px; height: 500px"></div>
|
||||
|
||||
<script type="module">
|
||||
import A from '../src/js/A.js';
|
||||
|
||||
var aladin;
|
||||
A.init.then(() => {
|
||||
// Start up Aladin Lite
|
||||
let aladin = A.aladin('#aladin-lite-div', {target: 'Sgr a*', fov: 0.5, showContextMenu: true});
|
||||
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});
|
||||
// manage URL parameters
|
||||
let survey1 = aladin.getBaseImageLayer();
|
||||
survey1.setColormap('magma', {stretch: 'linear'});
|
||||
|
||||
let survey2 = aladin.newImageSurvey("CDS/P/2MASS6X/H");
|
||||
|
||||
let survey2 = aladin.newImageSurvey("CSIRO/P/RACS/mid/I");
|
||||
aladin.setImageLayer(survey2)
|
||||
survey2.setColormap('rdbu', {stretch: 'asinh'});
|
||||
|
||||
let survey3 = aladin.newImageSurvey("https://alasky.cds.unistra.fr/CFHTLS-T0007b/Deep/UALLSKY/");
|
||||
survey2.setColormap('rdbu', {stretch: 'linear'});
|
||||
|
||||
let survey3 = aladin.newImageSurvey("CSIRO/P/RACS/low/I");
|
||||
aladin.setImageLayer(survey3)
|
||||
survey3.setColormap('cubehelix', {stretch: 'asinh'});
|
||||
aladin.setImageLayer(survey3)
|
||||
aladin.setImageLayer(survey3)
|
||||
survey3.setColormap('cubehelix', {stretch: 'linear'});
|
||||
|
||||
aladin.setImageLayer(survey2);
|
||||
aladin.setImageLayer(survey3);
|
||||
aladin.setImageLayer(survey3);
|
||||
|
||||
//aladin.setOverlayImageLayer(survey2);
|
||||
aladin.setImageLayer(survey3)
|
||||
aladin.setImageLayer(survey2);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"homepage": "https://aladin.u-strasbg.fr/",
|
||||
"name": "aladin-lite",
|
||||
"type": "module",
|
||||
"version": "3.3.1",
|
||||
"version": "3.3.2",
|
||||
"description": "An astronomical HiPS visualizer in the browser",
|
||||
"author": "Thomas Boch and Matthieu Baumann",
|
||||
"license": "GPL-3",
|
||||
|
||||
@@ -3,7 +3,7 @@ name = "aladin-lite"
|
||||
description = "Aladin Lite v3 introduces a new graphical engine written in Rust with the use of WebGL"
|
||||
license = "BSD-3-Clause"
|
||||
repository = "https://github.com/cds-astro/aladin-lite"
|
||||
version = "3.3.1"
|
||||
version = "3.3.2"
|
||||
authors = [ "baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr",]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -270,6 +270,8 @@ impl App {
|
||||
// Move the views of the different active surveys
|
||||
self.tile_fetcher.clear();
|
||||
// Loop over the surveys
|
||||
let raytracer = self.layers.get_raytracer();
|
||||
|
||||
for survey in self.layers.values_mut_hips() {
|
||||
if self.camera.get_texture_depth() == 0
|
||||
&& self
|
||||
@@ -290,7 +292,8 @@ impl App {
|
||||
let root_url = survey.get_config().get_root_url().to_string();
|
||||
let format = survey.get_config().get_format();
|
||||
|
||||
if let Some(tiles_iter) = survey.look_for_new_tiles(&mut self.camera) {
|
||||
if let Some(tiles_iter) = survey.look_for_new_tiles(&mut self.camera, &self.projection)
|
||||
{
|
||||
for tile_cell in tiles_iter.into_iter() {
|
||||
self.tile_fetcher.append(
|
||||
query::Tile::new(&tile_cell, creator_did.clone(), root_url.clone(), format),
|
||||
|
||||
@@ -10,6 +10,7 @@ use crate::HEALPixCoverage;
|
||||
use std::ops::Range;
|
||||
|
||||
use al_api::cell::HEALPixCellProjeted;
|
||||
use al_core::log::console_log;
|
||||
|
||||
pub fn project(
|
||||
cell: HEALPixCellProjeted,
|
||||
|
||||
@@ -9,6 +9,7 @@ pub enum UserAction {
|
||||
use super::{fov::FieldOfView, view_hpx_cells::ViewHpxCells};
|
||||
use crate::healpix::cell::HEALPixCell;
|
||||
use crate::healpix::coverage::HEALPixCoverage;
|
||||
use crate::math::angle::ToAngle;
|
||||
use crate::math::{projection::coo_space::XYZWModel, projection::domain::sdf::ProjDef};
|
||||
use al_core::{info, inforec, log};
|
||||
|
||||
@@ -210,12 +211,31 @@ impl CameraViewPort {
|
||||
|
||||
pub fn get_hpx_cells<'a>(
|
||||
&'a mut self,
|
||||
depth: u8,
|
||||
mut depth: u8,
|
||||
frame: CooSystem,
|
||||
) -> impl Iterator<Item = &'a HEALPixCell> {
|
||||
self.view_hpx_cells.get_cells(depth, frame)
|
||||
}
|
||||
|
||||
pub fn is_raytracing(&self, proj: &ProjectionType) -> bool {
|
||||
// Check whether the tile depth is 0 for square projection
|
||||
// definition domains i.e. Mercator
|
||||
if self.is_allsky() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// check the projection
|
||||
match proj {
|
||||
ProjectionType::Tan(_) => self.aperture >= 100.0_f64.to_radians().to_angle(),
|
||||
ProjectionType::Mer(_) => self.aperture >= 200.0_f64.to_radians().to_angle(),
|
||||
ProjectionType::Stg(_) => self.aperture >= 200.0_f64.to_radians().to_angle(),
|
||||
ProjectionType::Sin(_) => false,
|
||||
ProjectionType::Ait(_) => false,
|
||||
ProjectionType::Mol(_) => false,
|
||||
ProjectionType::Zea(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn recompute_scissor(&self) {
|
||||
// Clear all the screen before updating the scissor
|
||||
//self.gl.scissor(0, 0, self.width as i32, self.height as i32);
|
||||
|
||||
@@ -529,9 +529,10 @@ impl HiPS {
|
||||
pub fn look_for_new_tiles<'a>(
|
||||
&'a mut self,
|
||||
camera: &'a mut CameraViewPort,
|
||||
proj: &ProjectionType,
|
||||
) -> Option<impl Iterator<Item = HEALPixCell> + 'a> {
|
||||
// do not add tiles if the view is already at depth 0
|
||||
let depth_tile = (camera.get_texture_depth() + self.get_config().delta_depth())
|
||||
let mut depth_tile = (camera.get_texture_depth() + self.get_config().delta_depth())
|
||||
.min(self.get_config().get_max_depth_tile())
|
||||
.max(self.get_config().get_min_depth_tile());
|
||||
let dd = self.get_config().delta_depth();
|
||||
@@ -550,6 +551,12 @@ impl HiPS {
|
||||
//let depth_tile = depth_tile.max(min_bound_depth);
|
||||
let survey_frame = self.get_config().get_frame();
|
||||
let mut already_considered_tiles = HashSet::new();
|
||||
|
||||
// raytracer is rendering and the shader only renders HPX texture cells of depth 0
|
||||
if camera.is_raytracing(proj) {
|
||||
depth_tile = 0;
|
||||
}
|
||||
|
||||
let tile_cells_iter = camera
|
||||
.get_hpx_cells(depth_tile, survey_frame)
|
||||
//.flat_map(move |cell| {
|
||||
@@ -601,13 +608,8 @@ impl HiPS {
|
||||
self.textures.contains_tile(cell)
|
||||
}
|
||||
|
||||
pub fn update(
|
||||
&mut self,
|
||||
raytracer: &RayTracer,
|
||||
camera: &mut CameraViewPort,
|
||||
projection: &ProjectionType,
|
||||
) {
|
||||
let raytracing = raytracer.is_rendering(camera);
|
||||
pub fn update(&mut self, camera: &mut CameraViewPort, projection: &ProjectionType) {
|
||||
let raytracing = camera.is_raytracing(projection);
|
||||
|
||||
let vertices_recomputation_needed =
|
||||
!raytracing && (self.textures.reset_available_tiles() | camera.has_moved());
|
||||
@@ -1011,6 +1013,7 @@ impl HiPS {
|
||||
camera: &CameraViewPort,
|
||||
raytracer: &RayTracer,
|
||||
cfg: &ImageMetadata,
|
||||
proj: &ProjectionType,
|
||||
) -> Result<(), JsValue> {
|
||||
// Get the coo system transformation matrix
|
||||
let selected_frame = camera.get_coo_system();
|
||||
@@ -1022,7 +1025,7 @@ impl HiPS {
|
||||
let w2v = c * (*camera.get_w2m());
|
||||
let v2w = w2v.transpose();
|
||||
|
||||
let raytracing = raytracer.is_rendering(camera);
|
||||
let raytracing = camera.is_raytracing(proj);
|
||||
let config = self.get_config();
|
||||
|
||||
self.gl.enable(WebGl2RenderingContext::BLEND);
|
||||
|
||||
@@ -239,11 +239,4 @@ impl RayTracer {
|
||||
0,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn is_rendering(&self, camera: &CameraViewPort) -> bool {
|
||||
// Check whether the tile depth is 0 for square projection
|
||||
// definition domains i.e. Mercator
|
||||
let depth = camera.get_texture_depth();
|
||||
camera.is_allsky() || depth == 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,6 +214,10 @@ impl Layers {
|
||||
self.background_color = color;
|
||||
}
|
||||
|
||||
pub fn get_raytracer(&self) -> &RayTracer {
|
||||
&self.raytracer
|
||||
}
|
||||
|
||||
pub fn draw(
|
||||
&mut self,
|
||||
camera: &mut CameraViewPort,
|
||||
@@ -222,7 +226,7 @@ impl Layers {
|
||||
projection: &ProjectionType,
|
||||
) -> Result<(), JsValue> {
|
||||
let raytracer = &self.raytracer;
|
||||
let raytracing = raytracer.is_rendering(camera);
|
||||
let raytracing = camera.is_raytracing(projection);
|
||||
|
||||
// Check whether a survey to plot is allsky
|
||||
// if neither are, we draw a font
|
||||
@@ -292,10 +296,10 @@ impl Layers {
|
||||
// 1. Update the survey if necessary
|
||||
let id = self.ids.get(layer).expect("Url should be found");
|
||||
if let Some(survey) = self.surveys.get_mut(id) {
|
||||
survey.update(&self.raytracer, camera, projection);
|
||||
survey.update(camera, projection);
|
||||
|
||||
// 2. Draw it if its opacity is not null
|
||||
survey.draw(shaders, colormaps, camera, raytracer, draw_opt)?;
|
||||
survey.draw(shaders, colormaps, camera, raytracer, draw_opt, projection)?;
|
||||
} else if let Some(image) = self.images.get_mut(id) {
|
||||
image.update(camera, projection)?;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*body { overscroll-behavior: contain; }*/
|
||||
|
||||
.aladin-container {
|
||||
position: relative;
|
||||
/*height: 100%;*/
|
||||
border: 0px solid #ddd;
|
||||
/* SVG inside divs add a 4px height: https://stackoverflow.com/questions/75751593/why-there-is-additional-4px-height-for-div-when-there-is-svg-inside-it */
|
||||
|
||||
@@ -15,7 +12,7 @@
|
||||
}
|
||||
|
||||
.aladin-imageCanvas {
|
||||
position: relative;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
@@ -174,6 +174,13 @@ export let ImageSurvey = (function () {
|
||||
ImageSurvey.prototype.setView = function(view) {
|
||||
let self = this;
|
||||
|
||||
// do not allow to call setView multiple times otherwise
|
||||
// the querying to the properties and the search to the best
|
||||
// HiPS node will be done again for the same imageHiPS
|
||||
if (self.view) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.view = view;
|
||||
|
||||
let isMOCServerToBeQueried = true;
|
||||
|
||||
@@ -351,9 +351,9 @@ export let View = (function () {
|
||||
this.aladinDiv.style.setProperty('line-height', 0);
|
||||
Utils.cssScale = undefined;
|
||||
|
||||
var computedWidth = parseFloat(this.aladinDiv.getBoundingClientRect().width) || 1.0;
|
||||
var computedHeight = parseFloat(this.aladinDiv.getBoundingClientRect().height) || 1.0;
|
||||
|
||||
var computedWidth = Math.floor(parseFloat(this.aladinDiv.getBoundingClientRect().width)) || 1.0;
|
||||
var computedHeight = Math.floor(parseFloat(this.aladinDiv.getBoundingClientRect().height)) || 1.0;
|
||||
|
||||
this.width = Math.max(computedWidth, 1);
|
||||
this.height = Math.max(computedHeight, 1); // this prevents many problems when div size is equal to 0
|
||||
|
||||
@@ -376,14 +376,11 @@ export let View = (function () {
|
||||
this.gridCtx.canvas.width = this.width;
|
||||
this.gridCtx.canvas.height = this.height;
|
||||
|
||||
|
||||
this.imageCtx = this.imageCanvas.getContext("webgl2");
|
||||
this.imageCtx.canvas.style.width = this.width + "px";
|
||||
this.imageCtx.canvas.style.height = this.height + "px";
|
||||
|
||||
this.wasm.resize(this.width, this.height);
|
||||
|
||||
|
||||
pixelateCanvasContext(this.imageCtx, this.aladin.options.pixelateCanvas);
|
||||
|
||||
// change logo
|
||||
|
||||
@@ -43,6 +43,7 @@ import { CtxMenuActionButtonOpener } from "../Button/CtxMenuOpener.js";
|
||||
.then((catalogs) => {
|
||||
catalogs.forEach((cat) => {
|
||||
CatalogQueryBox.catalogs[cat.obs_title] = cat;
|
||||
CatalogQueryBox.catalogs[cat.ID] = cat;
|
||||
});
|
||||
|
||||
inputText.update({autocomplete: {options: Object.keys(CatalogQueryBox.catalogs)}})
|
||||
|
||||
Reference in New Issue
Block a user