add error ellipse example for 2mass

This commit is contained in:
Matthieu Baumann
2024-08-06 11:42:35 +02:00
committed by Matthieu Baumann
parent 3dd2c19c4c
commit b0bf7da8b1
6 changed files with 59 additions and 18 deletions

View File

@@ -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

View File

@@ -0,0 +1,28 @@
<!doctype html>
<html>
<head>
</head>
<body>
<div id="aladin-lite-div" style="width: 500px; height: 400px"></div>
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.4/css/jquery.dataTables.min.css">
<script type="module">
import A from '../src/js/A.js';
var aladin;
A.init.then(() => {
aladin = A.aladin('#aladin-lite-div', {survey: 'https://alasky.cds.unistra.fr/DSS/DSSColor/', target: 'm1', fov: 5, showContextMenu: true, showSettingsControl:true, samp:true});
const cat = A.catalogFromVizieR('II/246/out', 'm1', 0.1, {onClick: 'showTable', hoverColor: 'purple', limit: 1000, colnames: ["errMin", "errMaj", "errPA"], shape: (s) => {
let a = +s.data['errMaj']/3600;
let b = +s.data['errMin']/3600;
let theta = +s.data['errPA'];
return A.ellipse(s.ra, s.dec, a, b, theta);
}});
aladin.addCatalog(cat);
});
</script>
</body>
</html>

View File

@@ -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",

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
};