From b0bf7da8b1ad4e82a494ed3d5b320a3e74618c37 Mon Sep 17 00:00:00 2001 From: Matthieu Baumann Date: Tue, 6 Aug 2024 11:42:35 +0200 Subject: [PATCH] add error ellipse example for 2mass --- CHANGELOG.md | 6 +++++- examples/al-error-ellipse.html | 28 ++++++++++++++++++++++++++++ package.json | 2 +- src/core/src/camera/viewport.rs | 3 ++- src/js/URLBuilder.js | 14 ++++++++++++-- src/js/View.js | 24 +++++++++++------------- 6 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 examples/al-error-ellipse.html diff --git a/CHANGELOG.md b/CHANGELOG.md index f46b67c5..c0df1152 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,15 @@ * [feat] Add support for name removing in `removeOverlay` method * [test] Add support of playwright. Instructions in the readme for running the test matching snapshots [PR #176] +## 3.5.0-beta + +* [enhancement] add `options.colnames` to A.catalogFromVizieR + ## 3.4.5-beta * [feat] add `layerChanged` event when a layer is added or removed * [deprecate] of `select` event, use `objectsSelected` event instead -* [ui] add the ability to switch the tile format to download +* [ui] add the ability to switch the tile format to download ## 3.4.3-beta diff --git a/examples/al-error-ellipse.html b/examples/al-error-ellipse.html new file mode 100644 index 00000000..dcb5c9e6 --- /dev/null +++ b/examples/al-error-ellipse.html @@ -0,0 +1,28 @@ + + + + + + +
+ + + + + diff --git a/package.json b/package.json index 92335000..b62214db 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "homepage": "https://aladin.u-strasbg.fr/", "name": "aladin-lite", "type": "module", - "version": "3.4.6-beta", + "version": "3.5.0-beta", "description": "An astronomical HiPS visualizer in the browser", "author": "Thomas Boch and Matthieu Baumann", "license": "GPL-3", diff --git a/src/core/src/camera/viewport.rs b/src/core/src/camera/viewport.rs index d5a6bfd5..5d5feae4 100644 --- a/src/core/src/camera/viewport.rs +++ b/src/core/src/camera/viewport.rs @@ -432,7 +432,7 @@ impl CameraViewPort { };*/ let w_screen_px = self.width as f64; - let smallest_cell_size_px = 1.0; + let smallest_cell_size_px = self.dpi as f64; let mut depth_pixel = 29 as usize; let hpx_cell_size_rad = @@ -445,6 +445,7 @@ impl CameraViewPort { depth_pixel = depth_pixel - 1; } + depth_pixel += 1; const DEPTH_OFFSET_TEXTURE: usize = 9; self.texture_depth = if DEPTH_OFFSET_TEXTURE > depth_pixel { 0_u8 diff --git a/src/js/URLBuilder.js b/src/js/URLBuilder.js index 16ae0ff2..c2149588 100644 --- a/src/js/URLBuilder.js +++ b/src/js/URLBuilder.js @@ -98,10 +98,20 @@ export let URLBuilder = (function() { let url = 'https://vizier.unistra.fr/viz-bin/votable?-source=' + vizCatId + '&-c=' + encodeURIComponent(target)+ '&-out.max=' + maxNbSources + '&-c.rd=' + radiusDegrees; + let colnames = options.colnames || []; // request the `s_region` column usually found in ObsCore tables - url = url + '&-out.add=s_region'; + if (!('s_region' in colnames)) { + colnames.push('s_region') + } + // request the `s_fov` column usually found in ObsCore tables - url = url + '&-out.add=s_fov'; + if (!('s_fov' in colnames)) { + colnames.push('s_fov') + } + + for (var col of colnames) { + url = url + '&-out.add=' + col; + } return url; //return 'https://vizier.unistra.fr/viz-bin/conesearch/' + vizCatId + '?ra=' + target.ra + '&dec=' + target.dec + '&sr=' + radiusDegrees; diff --git a/src/js/View.js b/src/js/View.js index c1dc3c29..3d2f4fe0 100644 --- a/src/js/View.js +++ b/src/js/View.js @@ -2144,6 +2144,10 @@ export let View = (function () { continue; } + if (s.hasFootprint === true && s.tooSmallFootprint === false) { + continue; + } + xRounded = Math.round(s.x); yRounded = Math.round(s.y); @@ -2165,10 +2169,9 @@ export let View = (function () { } let closests = []; - const startLw = (footprints && footprints[0] && footprints[0].getLineWidth()) || 1; - let endLw = 10; - let finish = false; - for (var lw = startLw; lw <= endLw; lw++) { + const fLineWidth = (footprints && footprints[0] && footprints[0].getLineWidth()) || 1; + let lw = fLineWidth + 3; + //for (var lw = startLw + 1; lw <= startLw + 3; lw++) { footprints.forEach((footprint) => { if (!footprint.source || !footprint.source.tooSmallFootprint) { // Hidden footprints are not considered @@ -2178,20 +2181,15 @@ export let View = (function () { if (footprint.isShowing && footprint.isInStroke(ctx, this, x * window.devicePixelRatio, y * window.devicePixelRatio)) { closests.push(footprint); } - footprint.setLineWidth(startLw); + footprint.setLineWidth(fLineWidth); } }) - if (closests.length > 0 && !finish) { - endLw = lw + 3; - finish = true; - } - - if (finish && lw === endLw) { + /* if (closests.length > 0) { break; } - } - + }*/ + return closests; };