Compare commits
8 Commits
customize-
...
v3.7.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdc1733c4f | ||
|
|
6e40dbbfc1 | ||
|
|
e03b16119b | ||
|
|
e3162426be | ||
|
|
5a285dabed | ||
|
|
2d04730623 | ||
|
|
390c9096d7 | ||
|
|
0e9998a7fc |
@@ -16,7 +16,7 @@
|
||||
showSimbadPointerControl: true,
|
||||
projection: 'AIT', // set a projection
|
||||
fov: 8.0, // initial field of view in degrees
|
||||
target: '00 42 21.37 +41 07 29.8', // initial target
|
||||
target: '10.6875598 +41.1402170', // initial target
|
||||
cooFrame: 'icrs', // set galactic frame
|
||||
reticleColor: '#ff89ff', // change reticle color
|
||||
showContextMenu: true,
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
});
|
||||
|
||||
aladin.addCatalog(A.catalogFromVizieR("B/assocdata/obscore", "0 +0", 20, {onClick: 'showTable', hoverColor: 'yellow', limit: 1000}))
|
||||
aladin.addCatalog(A.catalogFromSKAORucio("0 +0", 70, {onClick: 'showTable', hoverColor: 'yellow', limit: 1000}))
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
let bValues = [];
|
||||
|
||||
let i = 0;
|
||||
for(var [r, g, b] of base.probe({type: 'line', x1: p.a.x, y1: p.a.y, x2: p.b.x, y2: p.b.y})) {
|
||||
for(var [r, g, b] of base.probePixels({type: 'line', x1: p.a.x, y1: p.a.y, x2: p.b.x, y2: p.b.y})) {
|
||||
xValues.push(i)
|
||||
rValues.push(r)
|
||||
gValues.push(g)
|
||||
|
||||
@@ -91,7 +91,7 @@ impl Texture2DArray {
|
||||
|
||||
// Attach the texture as the first color attachment
|
||||
self.gl.framebuffer_texture_layer(
|
||||
WebGlRenderingCtx::READ_FRAMEBUFFER,
|
||||
WebGlRenderingCtx::FRAMEBUFFER,
|
||||
WebGlRenderingCtx::COLOR_ATTACHMENT0,
|
||||
self.texture.as_ref(),
|
||||
0,
|
||||
|
||||
@@ -203,5 +203,3 @@ impl PixelType {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub const NUM_CHANNELS: usize = 6;
|
||||
|
||||
@@ -311,7 +311,7 @@ impl Texture2D {
|
||||
// Attach the texture as the first color attachment
|
||||
//self.attach_to_framebuffer();
|
||||
self.gl.framebuffer_texture_2d(
|
||||
WebGlRenderingCtx::READ_FRAMEBUFFER,
|
||||
WebGlRenderingCtx::FRAMEBUFFER,
|
||||
WebGlRenderingCtx::COLOR_ATTACHMENT0,
|
||||
WebGlRenderingCtx::TEXTURE_2D,
|
||||
self.texture.as_ref(),
|
||||
|
||||
@@ -21,32 +21,6 @@ pub trait Pixel:
|
||||
fn read_pixel(gl: &WebGlContext, x: i32, y: i32) -> Result<Self, JsValue>;
|
||||
}
|
||||
|
||||
impl Pixel for [f32; 1] {
|
||||
type Item = f32;
|
||||
type Container = ArrayF32;
|
||||
const BLACK: Self = [f32::NAN];
|
||||
|
||||
fn read_pixel(gl: &WebGlContext, x: i32, y: i32) -> Result<Self, JsValue> {
|
||||
let p = js_sys::Uint8Array::new_with_length(4);
|
||||
gl.read_pixels_with_opt_array_buffer_view(
|
||||
x,
|
||||
y,
|
||||
1,
|
||||
1,
|
||||
WebGlRenderingCtx::RGBA,
|
||||
WebGlRenderingCtx::UNSIGNED_BYTE,
|
||||
Some(&p),
|
||||
)?;
|
||||
|
||||
Ok([f32::from_le_bytes([
|
||||
p.at(0).unwrap(),
|
||||
p.at(1).unwrap(),
|
||||
p.at(2).unwrap(),
|
||||
p.at(3).unwrap(),
|
||||
])])
|
||||
}
|
||||
}
|
||||
|
||||
impl Pixel for [u8; 4] {
|
||||
type Item = u8;
|
||||
type Container = ArrayU8;
|
||||
@@ -74,13 +48,13 @@ impl Pixel for [u8; 3] {
|
||||
const BLACK: Self = [0, 0, 0];
|
||||
|
||||
fn read_pixel(gl: &WebGlContext, x: i32, y: i32) -> Result<Self, JsValue> {
|
||||
let pixels = js_sys::Uint8Array::new_with_length(3);
|
||||
let pixels = js_sys::Uint8Array::new_with_length(4);
|
||||
gl.read_pixels_with_opt_array_buffer_view(
|
||||
x,
|
||||
y,
|
||||
1,
|
||||
1,
|
||||
WebGlRenderingCtx::RGB,
|
||||
WebGlRenderingCtx::RGBA,
|
||||
WebGlRenderingCtx::UNSIGNED_BYTE,
|
||||
Some(&pixels),
|
||||
)?;
|
||||
@@ -147,7 +121,7 @@ impl Pixel for [i16; 1] {
|
||||
Some(&p),
|
||||
)?;
|
||||
|
||||
Ok([i16::from_le_bytes([p.at(0).unwrap(), p.at(1).unwrap()])])
|
||||
Ok([i16::from_le_bytes([p.at(1).unwrap(), p.at(0).unwrap()])])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,10 +143,36 @@ impl Pixel for [i32; 1] {
|
||||
)?;
|
||||
|
||||
Ok([i32::from_le_bytes([
|
||||
p.at(0).unwrap(),
|
||||
p.at(1).unwrap(),
|
||||
p.at(2).unwrap(),
|
||||
p.at(3).unwrap(),
|
||||
p.at(2).unwrap(),
|
||||
p.at(1).unwrap(),
|
||||
p.at(0).unwrap(),
|
||||
])])
|
||||
}
|
||||
}
|
||||
|
||||
impl Pixel for [f32; 1] {
|
||||
type Item = f32;
|
||||
type Container = ArrayF32;
|
||||
const BLACK: Self = [f32::NAN];
|
||||
|
||||
fn read_pixel(gl: &WebGlContext, x: i32, y: i32) -> Result<Self, JsValue> {
|
||||
let p = js_sys::Uint8Array::new_with_length(4);
|
||||
gl.read_pixels_with_opt_array_buffer_view(
|
||||
x,
|
||||
y,
|
||||
1,
|
||||
1,
|
||||
WebGlRenderingCtx::RGBA,
|
||||
WebGlRenderingCtx::UNSIGNED_BYTE,
|
||||
Some(&p),
|
||||
)?;
|
||||
|
||||
Ok([f32::from_le_bytes([
|
||||
p.at(3).unwrap(),
|
||||
p.at(2).unwrap(),
|
||||
p.at(1).unwrap(),
|
||||
p.at(0).unwrap(),
|
||||
])])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,32 @@ impl WebGlContext {
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
{
|
||||
/*if let Ok(r) =
|
||||
get_extension::<web_sys::ExtColorBufferFloat>(&gl, "EXT_color_buffer_float")
|
||||
{
|
||||
let _ = r;
|
||||
}*/
|
||||
|
||||
let ctx = WebGlContext { inner: gl };
|
||||
Ok(ctx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn _get_extension<T>(context: &WebGlRenderingCtx, name: &str) -> Result<T, JsValue>
|
||||
where
|
||||
T: wasm_bindgen::JsCast,
|
||||
{
|
||||
// `unchecked_into` is used here because WebGL extensions aren't actually JS classes
|
||||
// these objects are duck-type representations of the actual Rust classes
|
||||
// https://github.com/rustwasm/wasm-bindgen/pull/1449
|
||||
context
|
||||
.get_extension(name)
|
||||
.ok()
|
||||
.and_then(|maybe_ext| maybe_ext.map(|ext| ext.unchecked_into::<T>()))
|
||||
.ok_or_else(|| JsValue::from_str("Failed to load ext"))
|
||||
}
|
||||
|
||||
use std::ops::Deref;
|
||||
impl Deref for WebGlContext {
|
||||
type Target = WebGlRenderingCtx;
|
||||
|
||||
@@ -96,11 +96,7 @@ impl Downloader {
|
||||
}
|
||||
|
||||
pub fn delay(&mut self, r: RequestType) {
|
||||
match r {
|
||||
RequestType::Tile(tile) => {
|
||||
self.cache.insert(tile.id.clone(), RequestType::Tile(tile));
|
||||
}
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
let id = r.id().to_owned();
|
||||
self.cache.insert(id, r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,28 +83,30 @@ fn create_hpx_texture_storage(
|
||||
),
|
||||
];
|
||||
match channel {
|
||||
PixelType::RGBA8U => Texture2DArray::create_empty::<RGBA8U>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
num_tiles, tex_params,
|
||||
),
|
||||
PixelType::RGB8U => Texture2DArray::create_empty::<RGB8U>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
num_tiles, tex_params,
|
||||
),
|
||||
PixelType::RGBA8U => {
|
||||
Texture2DArray::create_empty::<RGBA8U>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
num_tiles, tex_params,
|
||||
)
|
||||
}
|
||||
PixelType::RGB8U => {
|
||||
Texture2DArray::create_empty::<RGB8U>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
num_tiles, tex_params,
|
||||
)
|
||||
}
|
||||
PixelType::R32F => Texture2DArray::create_empty::<R32F>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
num_tiles, tex_params,
|
||||
),
|
||||
|
||||
PixelType::R8U => Texture2DArray::create_empty::<R8U>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
num_tiles, tex_params,
|
||||
),
|
||||
|
||||
PixelType::R16I => Texture2DArray::create_empty::<R16I>(
|
||||
gl, tile_size, tile_size,
|
||||
// 256 is a consensus for targetting the maximum GPU architectures. We create a 128 slices to optimize performance
|
||||
@@ -285,7 +287,7 @@ impl HiPS2DBuffer {
|
||||
.tile_pixels
|
||||
.read_pixel(pos_tex.x, pos_tex.y, pos_tex.z)?,
|
||||
_ => {
|
||||
let uvy = 1.0 - (pos_tex.y as f32 / tile_size);
|
||||
let uvy = 1.0 - (dx as f32);
|
||||
pos_tex.y = (uvy * tile_size) as i32;
|
||||
|
||||
let f64_v = self
|
||||
|
||||
@@ -50,6 +50,7 @@ export class PolySelect extends FSM {
|
||||
|
||||
view.aladin.removeStatusBarMessage('selector')
|
||||
}
|
||||
|
||||
let btn;
|
||||
let mouseout = (params) => {
|
||||
let {e, coo} = params;
|
||||
@@ -215,7 +216,7 @@ export class PolySelect extends FSM {
|
||||
};
|
||||
|
||||
let fsm;
|
||||
if (Utils.hasTouchScreen()) {
|
||||
//if (Utils.hasTouchScreen()) {
|
||||
let mousedown = click;
|
||||
let mouseup = click;
|
||||
|
||||
@@ -259,7 +260,7 @@ export class PolySelect extends FSM {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*} else {
|
||||
// desktop, laptops...
|
||||
fsm = {
|
||||
state: 'off',
|
||||
@@ -296,7 +297,7 @@ export class PolySelect extends FSM {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
super(fsm)
|
||||
let self = this;
|
||||
|
||||
@@ -54,7 +54,8 @@ export let URLBuilder = (function() {
|
||||
},
|
||||
|
||||
buildNEDPositionCSURL: function(ra, dec, radiusDegrees) {
|
||||
return 'https://ned.ipac.caltech.edu/cgi-bin/nph-objsearch?search_type=Near+Position+Search&of=xml_main&RA=' + ra + '&DEC=' + dec + '&SR=' + radiusDegrees;
|
||||
//OLD return 'https://ned.ipac.caltech.edu/cgi-bin/nph-objsearch?search_type=Near+Position+Search&of=xml_main&RA=' + ra + '&DEC=' + dec + '&SR=' + radiusDegrees;
|
||||
return 'https://ned.ipac.caltech.edu/tap/sync?query=SELECT+*+FROM+objdir+WHERE+CONTAINS(POINT(\'J2000\',ra,dec),CIRCLE(\'J2000\',' + ra + ',' + dec + ',' + radiusDegrees + '))=1&LANG=ADQL&REQUEST=doQuery&FORMAT=votable'
|
||||
},
|
||||
|
||||
buildNEDObjectCSURL: function(object, radiusDegrees) {
|
||||
|
||||
@@ -1300,7 +1300,7 @@ export let View = (function () {
|
||||
|
||||
if (!view.throttledTouchPadZoom) {
|
||||
view.throttledTouchPadZoom = () => {
|
||||
const factor = Utils.detectTrackPad(e) ? 1.05 : 1.2;
|
||||
const factor = Utils.detectTrackPad(e) ? 1.06 : 1.2;
|
||||
const currZoomFactor = view.zoom.isZooming ? view.zoom.finalZoom : view.zoomFactor;
|
||||
let newZoomFactor = view.delta > 0 ? currZoomFactor * factor : currZoomFactor / factor;
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ export class HiPSBrowserBox extends Box {
|
||||
|
||||
let filterEnabler = Input.checkbox({
|
||||
name: "filter-enabler",
|
||||
tooltip: { content: "enable/disable" },
|
||||
checked: false,
|
||||
click(e) {
|
||||
let on = e.target.checked;
|
||||
|
||||
@@ -331,7 +331,7 @@ import { TogglerActionButton } from "../Button/Toggler.js";
|
||||
update(options) {
|
||||
if (options.layer) {
|
||||
let self = this;
|
||||
if (options.layer.isSpectralCube()) {
|
||||
if (options.layer.isSpectralCube && options.layer.isSpectralCube()) {
|
||||
let spectraDisplayer = self.aladin.view.spectraDisplayer;
|
||||
|
||||
self.spectraBtn = new TogglerActionButton({
|
||||
|
||||
@@ -225,6 +225,9 @@ export class Location extends DOMElement {
|
||||
// lon and lat must be given in cooFrame
|
||||
const updateFromLonLatFunc = (lon, lat, cooFrame) => {
|
||||
var coo = new Coo(lon, lat, Location.prec);
|
||||
|
||||
cooFrame = CooFrameEnum.fromString(cooFrame);
|
||||
|
||||
if (cooFrame == CooFrameEnum.ICRS) {
|
||||
self.field.set(coo.format('s/'));
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 140 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 133 KiB |