Compare commits
92 Commits
v3.6.0-bet
...
3.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bde5a37b51 | ||
|
|
fbdc7e2e76 | ||
|
|
312b9844d1 | ||
|
|
0e740454bd | ||
|
|
18e98e9f5f | ||
|
|
c938a58cbc | ||
|
|
4a5d66768c | ||
|
|
239ae2ce74 | ||
|
|
9bf898c104 | ||
|
|
6f085429f5 | ||
|
|
b49c763e07 | ||
|
|
fcacda0c19 | ||
|
|
f6acb3a324 | ||
|
|
14d54b03bc | ||
|
|
9e2779837d | ||
|
|
e29b5202b3 | ||
|
|
13125b155e | ||
|
|
f56468d402 | ||
|
|
5823901e92 | ||
|
|
3b00a79e02 | ||
|
|
31e7d6f0ac | ||
|
|
f656176e28 | ||
|
|
9b31210066 | ||
|
|
425e3e2459 | ||
|
|
6bd9c43d88 | ||
|
|
ebb9d6d3d6 | ||
|
|
ee2eb6e704 | ||
|
|
68d9e67774 | ||
|
|
109cb48367 | ||
|
|
749d963029 | ||
|
|
b2bb7df6e3 | ||
|
|
492927c557 | ||
|
|
accd4a6c7e | ||
|
|
6b21b2899f | ||
|
|
628ea826bf | ||
|
|
5604ea2be6 | ||
|
|
6d458ccab7 | ||
|
|
ae00021fab | ||
|
|
7512adf900 | ||
|
|
a19a050ee7 | ||
|
|
5f9c9d9154 | ||
|
|
3f248a82ea | ||
|
|
c2dd66c5b3 | ||
|
|
35f6037f7f | ||
|
|
255f123652 | ||
|
|
43faf2170d | ||
|
|
efdfb190dd | ||
|
|
1b2f298817 | ||
|
|
98e1c6cfca | ||
|
|
fa7781037e | ||
|
|
834b831084 | ||
|
|
2dd8ab643b | ||
|
|
02c6b6e468 | ||
|
|
826ef4fdb7 | ||
|
|
bf12e85c70 | ||
|
|
ac880608af | ||
|
|
7994ecc40e | ||
|
|
9049fec040 | ||
|
|
4eea3d3bf9 | ||
|
|
aed511abd8 | ||
|
|
e654f4376e | ||
|
|
5d3d0b2cfc | ||
|
|
f75211902b | ||
|
|
8844dc3c61 | ||
|
|
165c246605 | ||
|
|
542b1d0ace | ||
|
|
6cc5814868 | ||
|
|
712fe2bff0 | ||
|
|
ccc329be04 | ||
|
|
6833c21115 | ||
|
|
bb8116eb4e | ||
|
|
afce55f1dd | ||
|
|
718a8a073c | ||
|
|
c620069c18 | ||
|
|
921d395cb2 | ||
|
|
bbd5848bdb | ||
|
|
cc8becb437 | ||
|
|
e28c37e5e0 | ||
|
|
7062a3cd76 | ||
|
|
5f57f037f8 | ||
|
|
765c0d0dcb | ||
|
|
1f790a4b54 | ||
|
|
baa8f53349 | ||
|
|
42ece4fba1 | ||
|
|
35f13fe1f0 | ||
|
|
ddfd5ead05 | ||
|
|
5410544404 | ||
|
|
00c9d6ffc5 | ||
|
|
3fb4a6493a | ||
|
|
0e27fb8765 | ||
|
|
6f2730893f | ||
|
|
a83cfaab25 |
2
.github/workflows/npm-publish.yml
vendored
@@ -24,8 +24,6 @@ jobs:
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
source "$HOME/.cargo/env"
|
||||
rustup default nightly
|
||||
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
- name: "Install wasm-pack"
|
||||
run: |
|
||||
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y
|
||||
|
||||
43
.gitignore
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
# vscode files
|
||||
.vscode/
|
||||
# for mac os users
|
||||
.DS_Store
|
||||
|
||||
out/
|
||||
# deployment scripts
|
||||
deploy/
|
||||
# node dependencies
|
||||
node_modules/
|
||||
|
||||
package-lock.json
|
||||
|
||||
# rust tmp files for useful for the compilation phase
|
||||
src/core/Cargo.lock
|
||||
src/core/target/
|
||||
|
||||
# this rust file is generated when compiling the code, so it is not
|
||||
# useful to put it on git
|
||||
src/core/src/shaders.rs
|
||||
|
||||
## python related
|
||||
# python environment
|
||||
aladin-lite-venv
|
||||
# python cached files
|
||||
__pycache__/
|
||||
|
||||
## API doc related
|
||||
# folder containing the generated HTML API documentation files
|
||||
docs/
|
||||
# style jsdoc files generated with npm run doc
|
||||
jsdoc-custom-styledocs
|
||||
# responsive jsdoc files generated with npm run doc
|
||||
jsdoc-make-responsivedocs
|
||||
|
||||
## playwright testing framework related
|
||||
test-results/
|
||||
playwright-report/
|
||||
|
||||
## packaged tar obtained from the cmd: npm run predeploy or npm run deploy
|
||||
aladin-lite*.tgz
|
||||
# folder where the generated bundle lies
|
||||
dist/
|
||||
33
.zenodo.json
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"license": "GPL-3.0",
|
||||
"access_right": "open",
|
||||
"description": "An astronomical HiPS visualizer in the browser ",
|
||||
"keywords": ["astronomy", "visualizer", "images"],
|
||||
"language": "eng",
|
||||
"title": "Aladin Lite",
|
||||
"grants": [
|
||||
{
|
||||
"id": "824064"
|
||||
}
|
||||
],
|
||||
"creators": [
|
||||
{
|
||||
"type": "ProjectLeader",
|
||||
"orcid": "0000-0002-7123-773X",
|
||||
"name": "Baumann, Matthieu",
|
||||
"affiliation": "Université de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
},
|
||||
{
|
||||
"type": "ProjectLeader",
|
||||
"orcid": "0000-0001-5818-2781",
|
||||
"name": "Boch, Thomas",
|
||||
"affiliation": "Université de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
},
|
||||
{
|
||||
"type": "ProjectMember",
|
||||
"orcid": "0000-0001-5713-0998",
|
||||
"name": "Marchand, Manon",
|
||||
"affiliation": "Université de Strasbourg, CNRS, Observatoire astronomique de Strasbourg, UMR 7550, F-67000 Strasbourg, France"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
# Changelogs
|
||||
|
||||
## unreleased
|
||||
|
||||
* [fix] request a redraw after adding an array of footprints [PR #218]
|
||||
|
||||
## 3.5.1-beta
|
||||
|
||||
* [feat] Add support for name removing in `removeOverlay` method
|
||||
|
||||
17
README.md
@@ -48,6 +48,8 @@ Editable examples showing the API can also be found [here](https://aladin.cds.un
|
||||
|
||||
## Embed it into your projects
|
||||
|
||||
**Terms of use**: you are welcome to integrate Aladin Lite in your web pages and to customize its GUI to your needs, but **please leave the Aladin logo and link intact** at the bottom right of the view.
|
||||
|
||||
You can embed Aladin Lite it into your webpages in two ways
|
||||
|
||||
### The vanilla way
|
||||
@@ -140,12 +142,6 @@ to compile the core project into WebAssembly.
|
||||
Follow the steps from the Rust official website [here](https://www.rust-lang.org/learn/get-started)
|
||||
You will also need [wasm-pack](https://rustwasm.github.io/wasm-pack/), a tool helping compiling rust into a proper .wasm file.
|
||||
|
||||
Once it's installed you will need to switch to the nightly rust version:
|
||||
|
||||
```sh
|
||||
rustup default nightly
|
||||
```
|
||||
|
||||
Then you can build the project:
|
||||
|
||||
```sh
|
||||
@@ -158,15 +154,14 @@ npm run build
|
||||
> ```sh
|
||||
> cargo install wasm-pack --version ~0.12
|
||||
> ```
|
||||
> - Make sure you are using the rust **nightly** toolchain
|
||||
> ```sh
|
||||
> rustup default nightly
|
||||
> ```
|
||||
> - Remove your `src/core/Cargo.lock` file and `src/core/target` directory -- this ensures that you'd escape any bad compilation state:
|
||||
> ```sh
|
||||
> git clean -di
|
||||
> ```
|
||||
> - then recompile with `npm run build`.
|
||||
> - Then recompile
|
||||
> ```sh
|
||||
> npm run build
|
||||
> ```
|
||||
|
||||
It will generate the aladin lite compiled code into a `dist/` directory located at the root of the repository. This directory contains two javascript files. `aladin.umd.cjs` follows the UMD module export convention and it is the one you need to use for your project.
|
||||
|
||||
|
||||
5
assets/icons/freq.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M3 4.5L6 7L6 5.25H18V7L21 4.5L18 2V3.75H6L6 2L3 4.5Z" />
|
||||
<path d="M6.63935 11.9367C7.14967 10.7061 8.89138 10.7018 9.4077 11.9299L12.735 19.8442C13.9443 22.7205 18.0283 22.6965 19.2036 19.8061L21.1579 15H18.9989L17.351 19.0527C16.8472 20.2915 15.0969 20.3018 14.5787 19.0691L11.2514 11.1548C10.0466 8.28919 5.98264 8.29911 4.79189 11.1706L3.20392 15H5.36906L6.63935 11.9367Z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 623 B |
2
assets/icons/inside.svg
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4,3H9A1,1,0,0,1,9,5H5V9A1,1,0,0,1,3,9V4A1,1,0,0,1,4,3ZM9,19H5V15a1,1,0,0,0-2,0v5a1,1,0,0,0,1,1H9a1,1,0,0,0,0-2Zm11-5a1,1,0,0,0-1,1v4H15a1,1,0,0,0,0,2h5a1,1,0,0,0,1-1V15A1,1,0,0,0,20,14ZM20,3H15a1,1,0,0,0,0,2h4V9a1,1,0,0,0,2,0V4A1,1,0,0,0,20,3ZM7,8v8a1,1,0,0,0,1,1h8a1,1,0,0,0,1-1V8a1,1,0,0,0-1-1H8A1,1,0,0,0,7,8Z"/></svg>
|
||||
|
After Width: | Height: | Size: 555 B |
@@ -8,8 +8,8 @@
|
||||
"dateModified": "2023-01-31",
|
||||
"issueTracker": "https://github.com/cds-astro/aladin-lite/issues",
|
||||
"name": "Aladin Lite",
|
||||
"version": "3.5.1-beta",
|
||||
"softwareVersion": "3.5.1-beta",
|
||||
"version": "3.6.5",
|
||||
"softwareVersion": "3.6.5",
|
||||
"description": "An astronomical HiPS visualizer in the browser.",
|
||||
"identifier": "10.5281/zenodo.7638833",
|
||||
"applicationCategory": "Astronomy, Visualization",
|
||||
|
||||
BIN
examples/CDS_P_DSS2_color/Moc.fits
Normal file
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix0.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix1.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix10.jpg
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix11.jpg
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix2.jpg
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix3.jpg
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix4.jpg
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix5.jpg
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix6.jpg
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix7.jpg
Normal file
|
After Width: | Height: | Size: 55 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix8.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
examples/CDS_P_DSS2_color/Norder0/Dir0/Npix9.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
examples/CDS_P_DSS2_color/Norder1/Dir0/Npix22.jpg
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
examples/CDS_P_DSS2_color/Norder1/Dir0/Npix23.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
examples/CDS_P_DSS2_color/Norder2/Dir0/Npix89.jpg
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
examples/CDS_P_DSS2_color/Norder2/Dir0/Npix94.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
examples/CDS_P_DSS2_color/Norder3/Allsky.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
examples/CDS_P_DSS2_color/Norder3/Dir0/Npix357.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
examples/CDS_P_DSS2_color/Norder3/Dir0/Npix377.jpg
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
examples/CDS_P_DSS2_color/Norder4/Dir0/Npix1428.jpg
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
examples/CDS_P_DSS2_color/Norder4/Dir0/Npix1429.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
examples/CDS_P_DSS2_color/Norder4/Dir0/Npix1430.jpg
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
examples/CDS_P_DSS2_color/Norder4/Dir0/Npix1431.jpg
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
examples/CDS_P_DSS2_color/Norder4/Dir0/Npix1511.jpg
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5712.jpg
Normal file
|
After Width: | Height: | Size: 70 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5713.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5714.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5715.jpg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5716.jpg
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5717.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5718.jpg
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5719.jpg
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5720.jpg
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5721.jpg
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5722.jpg
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5723.jpg
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5724.jpg
Normal file
|
After Width: | Height: | Size: 71 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5725.jpg
Normal file
|
After Width: | Height: | Size: 73 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5726.jpg
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix5727.jpg
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
examples/CDS_P_DSS2_color/Norder5/Dir0/Npix6046.jpg
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
examples/CDS_P_DSS2_color/Norder6/Dir20000/Npix24185.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
examples/CDS_P_DSS2_color/Norder7/Dir90000/Npix96740.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
examples/CDS_P_DSS2_color/Norder7/Dir90000/Npix96741.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
examples/CDS_P_DSS2_color/Norder7/Dir90000/Npix96742.jpg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
examples/CDS_P_DSS2_color/Norder7/Dir90000/Npix96743.jpg
Normal file
|
After Width: | Height: | Size: 109 KiB |
1399
examples/CDS_P_DSS2_color/index.html
Normal file
BIN
examples/CDS_P_DSS2_color/preview.jpg
Normal file
|
After Width: | Height: | Size: 26 KiB |
45
examples/CDS_P_DSS2_color/properties
Normal file
@@ -0,0 +1,45 @@
|
||||
hips_doi = 10.26093/cds/aladin/ht9n-7r
|
||||
creator_did = ivo://CDS/P/DSS2/color
|
||||
obs_collection = DSS colored
|
||||
obs_title = DSS colored
|
||||
obs_description = Color composition generated by CDS. This HiPS survey is based on 2 others HiPS surveys, respectively DSS2-red and DSS2-blue HiPS, both of them directly generated from original scanned plates downloaded from STScI site. The red component has been built from POSS-II F, AAO-SES,SR and SERC-ER plates. The blue component has been build from POSS-II J and SERC-J,EJ. The green component is based on the mean of other components. Three missing plates from red survey (253, 260, 359) has been replaced by pixels from the DSSColor STScI jpeg survey. The 11 missing blue plates (mainly in galactic plane) have not been replaced (only red component).
|
||||
obs_copyright = Digitized Sky Survey - STScI/NASA, Colored & Healpixed by CDS
|
||||
obs_copyright_url = http://archive.stsci.edu/dss/copyright.html
|
||||
client_category = Image/Optical/DSS
|
||||
client_sort_key = 03-00
|
||||
hips_builder = Aladin/HipsGen v10.123
|
||||
hips_creation_date = 2010-05-01T19:05Z
|
||||
hips_release_date = 2019-05-07T10:55Z
|
||||
hips_creator = Oberto A. (CDS) , Fernique P. (CDS)
|
||||
hips_version = 1.4
|
||||
hips_order = 7
|
||||
hips_frame = equatorial
|
||||
hips_tile_width = 512
|
||||
hips_tile_format = jpeg
|
||||
dataproduct_type = image
|
||||
client_application = AladinLite
|
||||
hips_status = public partial unclonable
|
||||
hips_rgb_red = DSS2Merged [1488.0 8488.8125 14666.0 Linear]
|
||||
hips_rgb_blue = DSS2-blue-XJ-S [4286.0 12122.5 19959.0 Linear]
|
||||
hips_hierarchy = median
|
||||
hips_pixel_scale = 2.236E-4
|
||||
hips_initial_ra = 085.30251
|
||||
hips_initial_dec = -02.25468
|
||||
hips_initial_fov = 2
|
||||
moc_sky_fraction = 1.0
|
||||
hips_copyright = CNRS/Unistra
|
||||
obs_ack = The Digitized Sky Surveys were produced at the Space Telescope Science Institute under U.S. Government grant NAG W-2166. The images of these surveys are based on photographic data obtained using the Oschin Schmidt Telescope on Palomar Mountain and the UK Schmidt Telescope. The plates were processed into the present compressed digital form with the permission of these institutions. The National Geographic Society - Palomar Observatory Sky Atlas (POSS-I) was made by the California Institute of Technology with grants from the National Geographic Society. The Second Palomar Observatory Sky Survey (POSS-II) was made by the California Institute of Technology with funds from the National Science Foundation, the National Geographic Society, the Sloan Foundation, the Samuel Oschin Foundation, and the Eastman Kodak Corporation. The Oschin Schmidt Telescope is operated by the California Institute of Technology and Palomar Observatory. The UK Schmidt Telescope was operated by the Royal Observatory Edinburgh, with funding from the UK Science and Engineering Research Council (later the UK Particle Physics and Astronomy Research Council), until 1988 June, and thereafter by the Anglo-Australian Observatory. The blue plates of the southern Sky Atlas and its Equatorial Extension (together known as the SERC-J), as well as the Equatorial Red (ER), and the Second Epoch [red] Survey (SES) were all taken with the UK Schmidt. Supplemental funding for sky-survey work at the ST ScI is provided by the European Southern Observatory.
|
||||
prov_progenitor = STScI
|
||||
bib_reference = 1996ASPC..101...88L
|
||||
bib_reference_url = http://cdsads.u-strasbg.fr/abs/1996ASPC..101...88L
|
||||
t_min = 42413
|
||||
t_max = 51179
|
||||
obs_regime = Optical
|
||||
em_min = 4e-7
|
||||
em_max = 6e-7
|
||||
hips_order_min = 0
|
||||
dataproduct_subtype = color
|
||||
hipsgen_date = 2019-05-07T10:55Z
|
||||
hipsgen_params = out=/asd-volumes/sc1-asd-volume8/DSS/DSSColor UPDATE
|
||||
hipsgen_date_1 = 2024-09-10T16:50Z
|
||||
hipsgen_params_1 = in=https://alasky.cds.unistra.fr/DSS/DSSColor/ out=./CDS_P_DSS2_color region=3/357 order=5 MIRROR
|
||||
@@ -8,7 +8,7 @@
|
||||
import A from '../src/js/A.js';
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', { fov:0.15, target: 'Arp 240', showReticle: false, fullScreen: true });
|
||||
aladin = A.aladin('#aladin-lite-div', { fov:0.15, target: 'Arp 240', showContextMenu: true, showReticle: false, fullScreen: true });
|
||||
aladin.setBaseImageLayer(aladin.newImageSurvey('P/SDSS9/g', {colormap: "eosb", stretch: "linear"}));
|
||||
|
||||
var simbad = A.catalog({name: 'Simbad', sourceSize: 16, color: '#4050F0'});
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<body>
|
||||
<div id="aladin-lite-div" style="width: 1024px; height: 768px"></div>
|
||||
<script type="module">
|
||||
import A from '../src/js/A.js';
|
||||
import A from '../src/js/A.js';
|
||||
|
||||
A.init.then(() => {
|
||||
let aladin = A.aladin('#aladin-lite-div', {projection: "TAN", survey: "P/HSC/DR2/deep/g", target: '02 21 36.529 -05 31 20.16', fov: 0.1});
|
||||
|
||||
@@ -16,6 +17,7 @@ A.init.then(() => {
|
||||
|
||||
const HSCRedSurvey = aladin.newImageSurvey('P/HSC/DR2/deep/r', {imgFormat: 'fits', colormap: "red", minCut: 0.34228, maxCut: 2.75785, additive: true, stretch: "asinh"});
|
||||
const HSCBlueSurvey = aladin.newImageSurvey('P/HSC/DR2/deep/z', {imgFormat: 'fits', colormap: "blue", minCut: -0.01218, maxCut: 2.27397, additive: true, stretch: "asinh"});
|
||||
HSCRedSurvey.setColormap('red', {stretch: 'linear'});
|
||||
|
||||
aladin.setOverlayImageLayer('P/HSC/DR2/deep/r', 'hsc red layer');
|
||||
aladin.setOverlayImageLayer('P/HSC/DR2/deep/z', 'hsc blue layer');
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import A from '../src/js/A.js';
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: "data/hips/PanSTARRS_DR1_color-z-zg-g", fov:2.0, target: "22 35 58.39 +33 57 57.8", showSettingsControl: true, log: false});
|
||||
aladin = A.aladin('#aladin-lite-div', {samp: true, survey: "data/hips/PanSTARRS_DR1_color-z-zg-g", fov:2.0, target: "22 35 58.39 +33 57 57.8", showSettingsControl: true, log: false});
|
||||
aladin.setProjection('AIT');
|
||||
let cfht = aladin.createImageSurvey("CFHT", "CFHT MegaCam u+g+r", "./data/hips/CFHT", "equatorial", 10, {imgFormat: 'png'});
|
||||
let jwst1 = aladin.createImageSurvey("CDS/P/JWST/Stephans-Quintet/NIRCam+MIRI", "JWST NIRCam+MIRI", "data/hips/JWST_NIRCam_MIRI", null, null, {imgFormat: 'png'});
|
||||
|
||||
81
examples/al-change-cat-color.html
Normal file
@@ -0,0 +1,81 @@
|
||||
<!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: 1024px; height: 768px">
|
||||
<div class="box-content" style="width:200px">
|
||||
<div style="display:inline-flex">
|
||||
<label for="cat-color">Color</label>
|
||||
<input type="color" id="cat-color" value="#ff0000">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
import A from '../src/js/A.js';
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
var aladin = A.aladin(
|
||||
'#aladin-lite-div',
|
||||
{
|
||||
fov: 1.5, // initial field of view in degrees
|
||||
target: 'NGC 2175', // initial target
|
||||
}
|
||||
);
|
||||
|
||||
// Add a catalog
|
||||
let cat = A.catalogFromSimbad('NGC 2175', 0.1, {onClick: 'showTable'});
|
||||
aladin.addCatalog(cat);
|
||||
|
||||
// Logic for changing the color of catalog sources
|
||||
let colorPicker = document.querySelector('#cat-color');
|
||||
colorPicker.value = cat.color;
|
||||
colorPicker.addEventListener('input', function (e) {
|
||||
// Change the color of the catalog
|
||||
cat.updateShape({color: this.value});
|
||||
})
|
||||
|
||||
// Define the box
|
||||
let catalogSettingsBox = A.box({
|
||||
header: {
|
||||
title: "Settings",
|
||||
},
|
||||
content: document.querySelectorAll('.box-content')[0],
|
||||
});
|
||||
catalogSettingsBox._hide();
|
||||
|
||||
// Define the button that toggles the box
|
||||
let catalogSettingsBtn = A.button({
|
||||
content: 'Catalog',
|
||||
classList: ['catalogSettingsTogglerBtn'],
|
||||
action(o) {
|
||||
if (catalogSettingsBox.isHidden) {
|
||||
catalogSettingsBox._show({
|
||||
position: {
|
||||
nextTo: catalogSettingsBtn,
|
||||
direction: 'right',
|
||||
}
|
||||
})
|
||||
} else {
|
||||
catalogSettingsBox._hide()
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
aladin.addUI([catalogSettingsBtn, catalogSettingsBox])
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.catalogSettingsTogglerBtn {
|
||||
position: absolute;
|
||||
top: 200px;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,9 +12,11 @@
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', {projection: 'AIT', cooFrame: 'galactic', fov: 200, target: 'galactic center'});
|
||||
let dss = aladin.createImageSurvey("DSS blue band", "Color DSS blue HiPS", "http://alasky.cds.unistra.fr/DSS/DSS2-blue-XJ-S/", "equatorial", 9, {imgFormat: 'fits'})
|
||||
|
||||
aladin.setBaseImageLayer(dss);
|
||||
|
||||
aladin.getBaseImageLayer().setCuts(2, 10000);
|
||||
dss.setCuts(2, 10000);
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import A from '../src/js/A.js';
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', {cooFrame: "icrs", log: false});
|
||||
aladin = A.aladin('#aladin-lite-div', {cooFrame: "icrs", log: false, backgroundColor: 'red'});
|
||||
|
||||
aladin.displayFITS(
|
||||
//'https://fits.gsfc.nasa.gov/samples/FOCx38i0101t_c0f.fits', // url of the fits file
|
||||
|
||||
19
examples/al-disto.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="aladin-lite-div" style="width: 1024px; height: 768px"></div>
|
||||
|
||||
<script type="module">
|
||||
import A from '../src/js/A.js';
|
||||
var aladin;
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', {showContextMenu: true, survey: 'https://alasky.cds.unistra.fr/Pan-STARRS/DR1/color-i-r-g/', fov: 0.00833333333, target: '270.334079 66.730469'});
|
||||
aladin.showHealpixGrid(true)
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -20,6 +20,7 @@
|
||||
showSettingsControl: true,
|
||||
showStackLayerControl: true,
|
||||
samp: true,
|
||||
showCooGrid: true,
|
||||
});
|
||||
|
||||
aladin.addCatalog(A.catalogFromSimbad('M 82', 0.1, {onClick: 'showTable'}));
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
// Start up Aladin Lite
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: "CDS/P/DSS2/color", target: 'M 1', fov: 0.2, showContextMenu: true, fullScreen: true});
|
||||
aladin = A.aladin('#aladin-lite-div', {target: 'M 1', fov: 0.2, showContextMenu: true, fullScreen: true});
|
||||
var overlay = A.graphicOverlay({color: '#ee2345', lineWidth: 3, lineDash: [2, 2]});
|
||||
/*aladin.addOverlay(overlay);
|
||||
aladin.addOverlay(overlay);
|
||||
overlay.addFootprints([
|
||||
A.polygon([[83.64287, 22.01713], [83.59872, 22.01692], [83.59852, 21.97629], [83.64295, 21.97629]], {hoverColor: 'green'}),
|
||||
A.polygon([[83.62807, 22.06330], [83.58397, 22.02280], [83.62792, 22.02258]]),
|
||||
@@ -21,7 +21,7 @@
|
||||
]);
|
||||
overlay.add(A.circle(83.66067, 22.03081, 0.04, {color: 'cyan'})); // radius in degrees
|
||||
overlay.add(A.vector(83.66067, 22.03081, 0.04, {color: 'cyan'})); // radius in degrees
|
||||
*/
|
||||
|
||||
aladin.on("footprintClicked", (footprint, xyMouseCoords) => {
|
||||
console.log("footprint clicked catched: ", footprint, "mouse coords xy: ", xyMouseCoords.x, xyMouseCoords.y);
|
||||
})
|
||||
@@ -35,8 +35,8 @@
|
||||
console.log("Object hovered stopped: ", object, "mouse coords xy: ", xyMouseCoords.x, xyMouseCoords.y);
|
||||
})
|
||||
|
||||
const cat = A.catalogFromVizieR('B/assocdata/obscore', 'M 1', 10, {onClick: 'showTable', selectionColor: "orange", hoverColor: 'red', limit: 10000});
|
||||
aladin.addCatalog(cat);
|
||||
//const cat = A.catalogFromVizieR('B/assocdata/obscore', 'M 1', 10, {onClick: 'showTable', selectionColor: "orange", hoverColor: 'red', limit: 10000});
|
||||
//aladin.addCatalog(cat);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin('#aladin-lite-div', {survey: "data/hips/CDS_P_DSS2_color", showReticle: true, showSurveyStackControl: true, showOverlayStackControl: false, projection: "TAN", target: '15 16 57.636 -60 55 7.49', showProjectionControl: true, realFullscreen: true, showZoomControl: true, showSimbadPointerControl: true, showShareControl: true, showContextMenu: true, showCooGridControl: true, fullScreen: true, showCooGrid: true, fov: 180, log: false});
|
||||
|
||||
var moc_0_99 = A.MOCFromURL("./data/gw/gw_0.9.fits",{ name: "GW 90%", color: "#ff0000", opacity: 0.0, lineWidth: 10, fill: false, perimeter: true});
|
||||
var moc_0_95 = A.MOCFromURL("./data/gw/gw_0.6.fits",{ name: "GW 60%", color: "#00ff00", opacity: 0.5, lineWidth: 3, fill: true, perimeter: true});
|
||||
var moc_0_5 = A.MOCFromURL("./data/gw/gw_0.3.fits",{ name: "GW 30%", color: "#00ffff", opacity: 0.5, lineWidth: 3, fill: true, perimeter: true});
|
||||
var moc_0_2 = A.MOCFromURL("./data/gw/gw_0.1.fits",{ name: "GW 10%", color: "#ff00ff", opacity: 0.5, lineWidth: 3, fill: true, perimeter: true});
|
||||
var moc_0_99 = A.MOCFromURL("./data/gw/gw_0.9.fits",{ name: "GW 90%", color: "#ff0000", opacity: 0.7, lineWidth: 10, fill: false, perimeter: true});
|
||||
var moc_0_95 = A.MOCFromURL("./data/gw/gw_0.6.fits",{ name: "GW 60%", color: "#00ff00", opacity: 0.3, lineWidth: 3, fill: false, perimeter: true});
|
||||
var moc_0_5 = A.MOCFromURL("./data/gw/gw_0.3.fits",{ name: "GW 30%", color: "#00ffff", opacity: 0.2, lineWidth: 3, fill: true, perimeter: true});
|
||||
var moc_0_2 = A.MOCFromURL("./data/gw/gw_0.1.fits",{ name: "GW 10%", color: "#ff00ff", opacity: 0.1, lineWidth: 3});
|
||||
|
||||
aladin.addMOC(moc_0_99);
|
||||
aladin.addMOC(moc_0_95);
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
}
|
||||
);
|
||||
|
||||
//hips = aladin.newImageSurvey("https://alasky.cds.unistra.fr/GALFAHI/GALFAHI-Narrow-DR2/");
|
||||
//aladin.setImageLayer(hips)
|
||||
hips = aladin.newImageSurvey("https://alasky.cds.unistra.fr/GALFAHI/GALFAHI-Narrow-DR2/");
|
||||
aladin.setImageLayer(hips)
|
||||
|
||||
/*let id;
|
||||
aladin.on("zoomChanged", () => {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<script type="module">
|
||||
import A from '../src/js/A.js';
|
||||
A.init.then(() => {
|
||||
let aladin = A.aladin('#aladin-lite-div', {fov: 30, survey: "CDS/P/DSS2/color", target: "280 +0", projection: "AIT", showShareControl:true, showSettingsControl: true, showContextMenu:true});
|
||||
let aladin = A.aladin('#aladin-lite-div', {fov: 30, target: "280 +0", projection: "AIT", showShareControl:true, showSettingsControl: true, showContextMenu:true});
|
||||
|
||||
aladin.setOverlayImageLayer(A.image(
|
||||
"https://www.virtualastronomy.org/images/sig05-013.jpg",
|
||||
|
||||
@@ -22,12 +22,14 @@
|
||||
reticleColor: '#ff89ff', // change reticle color
|
||||
reticleSize: 64, // change reticle size
|
||||
showContextMenu: true,
|
||||
showShareControl: true,
|
||||
showFrame: true,
|
||||
showZoomControl:true,
|
||||
showSettingsControl:true,
|
||||
showCooGrid: true,
|
||||
fullScreen: true,
|
||||
samp: true,
|
||||
realFullscreen: true,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -41,10 +43,5 @@
|
||||
})*/
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.aladin-cat-browser-box {
|
||||
width: 600px;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
135
examples/al-ivoa-sydney.html
Normal file
@@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head> </head>
|
||||
|
||||
<body>
|
||||
<div id="aladin-lite-div" style="width: 500px; height: 400px"></div>
|
||||
|
||||
<script type="module">
|
||||
import A from "../src/js/A.js";
|
||||
let aladin;
|
||||
A.init.then(() => {
|
||||
aladin = A.aladin("#aladin-lite-div", {
|
||||
fullScreen: true,
|
||||
target: "abell 194",
|
||||
fov: 15,
|
||||
projection: "AIT",
|
||||
showContextMenu: true,
|
||||
showShareControl: true,
|
||||
samp: true,
|
||||
showSettingsControl: true,
|
||||
showZoomControl: true,
|
||||
});
|
||||
|
||||
/*let pmraMean = null, pmdecMean = null;
|
||||
|
||||
const pmCat = A.catalogFromURL('./data/proper_motion.xml', {
|
||||
onClick: 'showTable',
|
||||
name: 'mean pm over HPX cells around LMC from GaiaDR2',
|
||||
hoverColor: 'yellow',
|
||||
selectionColor: 'white',
|
||||
color: 'yellow',
|
||||
// Footprint associated to sources
|
||||
shape: (s) => {
|
||||
// discard drawing a vector for big pm
|
||||
let totalPmSquared = s.data.pmra*s.data.pmra + s.data.pmdec*s.data.pmdec;
|
||||
if (totalPmSquared > 6) {
|
||||
return;
|
||||
}
|
||||
|
||||
let color = rainbowColorMap((totalPmSquared - 2.5) / 2)
|
||||
|
||||
// Compute the mean of pm over the catalog sources
|
||||
if (!pmraMean || !pmdecMean) {
|
||||
pmraMean = 0, pmdecMean = 0;
|
||||
for (var s of pmCat.getSources()) {
|
||||
pmraMean += +s.data.pmra;
|
||||
pmdecMean += +s.data.pmdec;
|
||||
}
|
||||
|
||||
const numSources = pmCat.getSources().length;
|
||||
|
||||
pmraMean /= numSources
|
||||
pmdecMean /= numSources
|
||||
}
|
||||
|
||||
let dra = +s.data.pmra - pmraMean;
|
||||
let ddec = +s.data.pmdec - pmdecMean;
|
||||
|
||||
return A.vector(
|
||||
s.ra,
|
||||
s.dec,
|
||||
s.ra + dra,
|
||||
s.dec + ddec,
|
||||
{lineWidth: 3, color}
|
||||
)
|
||||
}
|
||||
});
|
||||
aladin.addCatalog(pmCat);*/
|
||||
|
||||
/*aladin.addCatalog(
|
||||
A.catalogFromURL("./data/votable/obscore_rucio-sdc03.votable", {
|
||||
name: 'SKA discovery ObsCore around: SDC03',
|
||||
onClick: 'showTable',
|
||||
hoverColor: "yellow",
|
||||
})
|
||||
);
|
||||
aladin.addCatalog(
|
||||
A.catalogFromURL("./data/votable/obscore_rucio-abell194.votable", {
|
||||
name: 'SKA discovery ObsCore around: Abell 194',
|
||||
onClick: 'showTable',
|
||||
hoverColor: "yellow",
|
||||
})
|
||||
);*/
|
||||
aladin.addCatalog(
|
||||
A.catalogFromSKAORucio("abell 194", 15, {
|
||||
onClick: 'showTable',
|
||||
hoverColor: "yellow",
|
||||
})
|
||||
);
|
||||
aladin.addCatalog(
|
||||
A.catalogFromSKAORucio("m51", 15, {
|
||||
onClick: 'showTable',
|
||||
hoverColor: "yellow",
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
function rainbowColorMap(value) {
|
||||
// Ensure value is within range [0, 1]
|
||||
value = Math.max(0, Math.min(1, value));
|
||||
|
||||
// Convert value to hue
|
||||
var hue = (1 - value) * 240; // 240 is the maximum hue value for blue
|
||||
|
||||
// Convert HSV to RGB
|
||||
var chroma = 1;
|
||||
var x = chroma * (1 - Math.abs((hue / 60) % 2 - 1));
|
||||
var r1, g1, b1;
|
||||
|
||||
if (hue >= 0 && hue < 60) {
|
||||
[r1, g1, b1] = [chroma, x, 0];
|
||||
} else if (hue >= 60 && hue < 120) {
|
||||
[r1, g1, b1] = [x, chroma, 0];
|
||||
} else if (hue >= 120 && hue < 180) {
|
||||
[r1, g1, b1] = [0, chroma, x];
|
||||
} else if (hue >= 180 && hue < 240) {
|
||||
[r1, g1, b1] = [0, x, chroma];
|
||||
}
|
||||
|
||||
var m = 1 - chroma;
|
||||
var r = r1 + m;
|
||||
var g = g1 + m;
|
||||
var b = b1 + m;
|
||||
|
||||
// Convert RGB to HEX
|
||||
r = Math.round(r * 255);
|
||||
g = Math.round(g * 255);
|
||||
b = Math.round(b * 255);
|
||||
var colorHex = "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
||||
|
||||
return colorHex;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1374
examples/al-landing-page.html
Normal file
@@ -55,7 +55,7 @@
|
||||
|
||||
aladin.addCatalog(A.catalogFromURL('https://aladin.cds.unistra.fr/AladinLite/doc/API/examples/data/mars-features.xml', {name: "Mars features", raField: 'Longitude', decField: 'Latitude', shape: drawFunction, onClick: 'showTable'}));
|
||||
|
||||
aladin.getBaseImageLayer().setColormap('yiorbr')
|
||||
aladin.getBaseImageLayer().setColormap('ylorbr')
|
||||
aladin.gotoRaDec(226.1433542, 18.6308694);
|
||||
|
||||
});
|
||||
|
||||
@@ -24,8 +24,14 @@
|
||||
//var json = {"3":[517],
|
||||
//"4":[2065, 2067]};
|
||||
|
||||
var moc = A.MOCFromJSON(json, {opacity: 0.25, color: 'magenta', lineWidth: 1, adaptativeDisplay: false});
|
||||
var moc = A.MOCFromJSON(json, {opacity: 0.5, color: 'magenta', lineWidth: 1, fill: true});
|
||||
aladin.addMOC(moc);
|
||||
|
||||
// Change the moc options after its creation
|
||||
setTimeout(() => {
|
||||
moc.opacity = 0.2
|
||||
moc.fillColor = "orange"
|
||||
}, 3000)
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
console.log(moc.serialize("json"))
|
||||
});
|
||||
var moc10 = A.MOCFromURL('https://alasky.unistra.fr/MocServer/query?ivorn=ivo%3A%2F%2FCDS%2FV%2F139%2Fsdss9&get=moc&order=11&fmt=fits', {color: '#ffffff', perimeter: true, fillColor: '#aabbcc', opacity: 0.3, lineWidth: 3});
|
||||
var moc10 = A.MOCFromURL('https://alasky.unistra.fr/MocServer/query?ivorn=ivo%3A%2F%2FCDS%2FV%2F139%2Fsdss9&get=moc&order=11&fmt=fits', {color: '#ffffff', perimeter: true, fill:true, fillColor: '#aabbcc', opacity: 0.3, lineWidth: 3});
|
||||
var moc9 = A.MOCFromURL('https://alasky.unistra.fr/MocServer/query?ivorn=ivo%3A%2F%2FCDS%2FV%2F139%2Fsdss9&get=moc&order=4&fmt=fits', {color: '#00ff00', opacity: 0.5, lineWidth: 3, perimeter: true});
|
||||
|
||||
aladin.addMOC(moc11);
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
});
|
||||
|
||||
aladin.addCatalog(
|
||||
A.catalogFromSKAORucio("ngc 1436", 15, {
|
||||
A.catalogFromSKAORucio("abell 196", 90, {
|
||||
onClick: 'showTable',
|
||||
hoverColor: "yellow",
|
||||
})
|
||||
|
||||
@@ -15,10 +15,6 @@
|
||||
// 'rdbu', 'rdylbu', 'redtemperature', 'sinebow', 'spectral', 'summer', 'viridis', 'ylgnbu' and 'ylorbr'
|
||||
hips = aladin.getBaseImageLayer()
|
||||
hips.setColormap("cubehelix");
|
||||
|
||||
aladin.setImageSurvey('astron.nl/P/lotss_dr2_high')
|
||||
|
||||
//aladin.getBaseImageLayer().setColor([1.0, 0.0, 1.0, 1.0], { tf: 'Linear'} );
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"homepage": "https://aladin.u-strasbg.fr/",
|
||||
"name": "aladin-lite",
|
||||
"type": "module",
|
||||
"version": "3.6.0-beta",
|
||||
"version": "3.6.5",
|
||||
"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.5.1-beta"
|
||||
version = "3.6.5"
|
||||
authors = [ "baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr",]
|
||||
edition = "2018"
|
||||
|
||||
@@ -22,11 +22,12 @@ url-lite = "0.1.0"
|
||||
serde_json = "1.0.104"
|
||||
serde-wasm-bindgen = "0.5"
|
||||
enum_dispatch = "0.3.8"
|
||||
wasm-bindgen = "0.2.92"
|
||||
wasm-bindgen = "=0.2.92"
|
||||
wasm-streams = "0.3.0"
|
||||
async-channel = "1.8.0"
|
||||
mapproj = "0.3.0"
|
||||
fitsrs = "0.2.11"
|
||||
wcs = "0.3.1"
|
||||
colorgrad = "0.6.2"
|
||||
|
||||
[features]
|
||||
@@ -40,17 +41,13 @@ rand = "0.8"
|
||||
[build-dependencies]
|
||||
walkdir = "2.3.2"
|
||||
|
||||
[dependencies.wcs]
|
||||
git = "https://github.com/cds-astro/wcs-rs"
|
||||
branch = "master"
|
||||
|
||||
[dependencies.console_error_panic_hook]
|
||||
version = "0.1.7"
|
||||
optional = true
|
||||
|
||||
[dependencies.healpix]
|
||||
package = "cdshealpix"
|
||||
version = "0.7.0"
|
||||
version = "0.7.3"
|
||||
|
||||
[dependencies.moclib]
|
||||
package = "moc"
|
||||
@@ -67,7 +64,7 @@ path = "./al-core"
|
||||
path = "./al-api"
|
||||
|
||||
[dependencies.web-sys]
|
||||
version = "*"
|
||||
version = "0.3.56"
|
||||
features = [ "console", "CssStyleDeclaration", "Document", "Element", "HtmlCollection", "HtmlElement", "HtmlImageElement", "HtmlCanvasElement", "Blob", "ImageBitmap", "ImageData", "CanvasRenderingContext2d", "WebGlBuffer", "WebGlContextAttributes", "WebGlFramebuffer", "WebGlProgram", "WebGlShader", "WebGlUniformLocation", "WebGlTexture", "WebGlActiveInfo", "Headers", "Window", "Request", "RequestInit", "RequestMode", "Response", "XmlHttpRequest", "XmlHttpRequestResponseType", "PerformanceTiming", "Performance", "Url", "ReadableStream", "File", "FileList",]
|
||||
|
||||
[dev-dependencies.image-decoder]
|
||||
@@ -80,7 +77,7 @@ features = [ "jpeg", "png",]
|
||||
debug = true
|
||||
|
||||
[profile.release]
|
||||
opt-level = 'z'
|
||||
opt-level = "z"
|
||||
debug = false
|
||||
debug-assertions = false
|
||||
overflow-checks = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "al-api"
|
||||
version = "0.1.0"
|
||||
version = "3.6.5"
|
||||
authors = ["baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use std::fmt;
|
||||
|
||||
#[wasm_bindgen(raw_module = "../../js/libs/astro/coo.js")]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(js_name = Format)]
|
||||
@@ -28,28 +26,11 @@ extern "C" {
|
||||
pub fn toDecimal(num: f64, prec: u8) -> String;
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone, Copy, PartialEq)]
|
||||
use std::cmp::Eq;
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[wasm_bindgen]
|
||||
pub enum AngleSerializeFmt {
|
||||
DMM,
|
||||
DD,
|
||||
DMS,
|
||||
HMS,
|
||||
}
|
||||
|
||||
impl fmt::Display for AngleSerializeFmt {
|
||||
// This trait requires `fmt` with this exact signature.
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
// Write strictly the first element into the supplied output
|
||||
// stream: `f`. Returns `fmt::Result` which indicates whether the
|
||||
// operation succeeded or failed. Note that `write!` uses syntax which
|
||||
// is very similar to `println!`.
|
||||
let str = match self {
|
||||
Self::DMM => "DMM",
|
||||
Self::DD => "DD",
|
||||
Self::DMS => "DMS",
|
||||
Self::HMS => "HMS",
|
||||
};
|
||||
write!(f, "{}", str)
|
||||
}
|
||||
}
|
||||
pub enum Formatter {
|
||||
Sexagesimal,
|
||||
Decimal
|
||||
}
|
||||
@@ -1,119 +1,66 @@
|
||||
use cgmath::Matrix4;
|
||||
pub trait CooBaseFloat: Sized + 'static {
|
||||
const GALACTIC_TO_J2000: &'static Matrix4<Self>;
|
||||
const J2000_TO_GALACTIC: &'static Matrix4<Self>;
|
||||
const ID: &'static Matrix4<Self>;
|
||||
}
|
||||
|
||||
impl CooBaseFloat for f32 {
|
||||
const GALACTIC_TO_J2000: &'static Matrix4<Self> = &Matrix4::new(
|
||||
-0.444_829_64,
|
||||
0.746_982_2,
|
||||
0.494_109_42,
|
||||
0.0,
|
||||
-0.198_076_37,
|
||||
0.455_983_8,
|
||||
-0.867_666_1,
|
||||
0.0,
|
||||
-0.873_437_1,
|
||||
-0.483_835,
|
||||
-0.054_875_56,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
);
|
||||
const GAL2ICRS: &'static Matrix4<f64> = &Matrix4::new(
|
||||
-0.44482972122205372312012370920248,
|
||||
0.74698218398450941835110635824212,
|
||||
0.49410943719710765017955928850141,
|
||||
0.0,
|
||||
-0.19807633727507056817237662907031,
|
||||
0.45598381369115237931077906137440,
|
||||
-0.86766613755716255824577781583414,
|
||||
0.0,
|
||||
-0.87343705195577915249273984034980,
|
||||
-0.48383507361641838378786914298189,
|
||||
-0.05487565771261968232908806948676,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
);
|
||||
|
||||
const J2000_TO_GALACTIC: &'static Matrix4<Self> = &Matrix4::new(
|
||||
-0.444_829_64,
|
||||
-0.198_076_37,
|
||||
-0.873_437_1,
|
||||
0.0,
|
||||
0.746_982_2,
|
||||
0.455_983_8,
|
||||
-0.483_835,
|
||||
0.0,
|
||||
0.494_109_42,
|
||||
-0.867_666_1,
|
||||
-0.054_875_56,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
);
|
||||
const ICRS2GAL: &'static Matrix4<f64> = &Matrix4::new(
|
||||
-0.44482972122205372312012370920248,
|
||||
-0.19807633727507056817237662907031,
|
||||
-0.87343705195577915249273984034980,
|
||||
0.0,
|
||||
0.74698218398450941835110635824212,
|
||||
0.45598381369115237931077906137440,
|
||||
-0.48383507361641838378786914298189,
|
||||
0.0,
|
||||
0.49410943719710765017955928850141,
|
||||
-0.86766613755716255824577781583414,
|
||||
-0.05487565771261968232908806948676,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
);
|
||||
|
||||
const ID: &'static Matrix4<Self> = &Matrix4::new(
|
||||
1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
|
||||
);
|
||||
}
|
||||
impl CooBaseFloat for f64 {
|
||||
const GALACTIC_TO_J2000: &'static Matrix4<Self> = &Matrix4::new(
|
||||
-0.4448296299195045,
|
||||
0.7469822444763707,
|
||||
0.4941094279435681,
|
||||
0.0,
|
||||
-0.1980763734646737,
|
||||
0.4559837762325372,
|
||||
-0.867_666_148_981_161,
|
||||
0.0,
|
||||
-0.873437090247923,
|
||||
-0.4838350155267381,
|
||||
-0.0548755604024359,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
);
|
||||
const ID: &'static Matrix4<f64> = &Matrix4::new(
|
||||
1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
|
||||
);
|
||||
|
||||
const J2000_TO_GALACTIC: &'static Matrix4<Self> = &Matrix4::new(
|
||||
-0.4448296299195045,
|
||||
-0.1980763734646737,
|
||||
-0.873437090247923,
|
||||
0.0,
|
||||
0.7469822444763707,
|
||||
0.4559837762325372,
|
||||
-0.4838350155267381,
|
||||
0.0,
|
||||
0.4941094279435681,
|
||||
-0.867_666_148_981_161,
|
||||
-0.0548755604024359,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
);
|
||||
|
||||
const ID: &'static Matrix4<Self> = &Matrix4::new(
|
||||
1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
|
||||
);
|
||||
}
|
||||
|
||||
use cgmath::BaseFloat;
|
||||
use serde::Deserialize;
|
||||
use wasm_bindgen::prelude::*;
|
||||
#[wasm_bindgen]
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Deserialize, Hash)]
|
||||
pub enum CooSystem {
|
||||
ICRS = 0,
|
||||
GAL = 1,
|
||||
ICRS,
|
||||
GAL,
|
||||
}
|
||||
|
||||
pub const NUM_COOSYSTEM: usize = 2;
|
||||
|
||||
impl CooSystem {
|
||||
#[inline]
|
||||
pub fn to<S>(&self, coo_system: Self) -> &Matrix4<S>
|
||||
where
|
||||
S: BaseFloat + CooBaseFloat,
|
||||
{
|
||||
pub fn to(&self, coo_system: Self) -> &Matrix4<f64> {
|
||||
match (self, coo_system) {
|
||||
(CooSystem::GAL, CooSystem::ICRS) => S::GALACTIC_TO_J2000,
|
||||
(CooSystem::ICRS, CooSystem::GAL) => S::J2000_TO_GALACTIC,
|
||||
(_, _) => S::ID,
|
||||
(CooSystem::GAL, CooSystem::ICRS) => GAL2ICRS,
|
||||
(CooSystem::ICRS, CooSystem::GAL) => ICRS2GAL,
|
||||
(_, _) => ID,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::angle_fmt::AngleSerializeFmt;
|
||||
use crate::angle::Formatter;
|
||||
|
||||
use super::color::ColorRGB;
|
||||
|
||||
#[wasm_bindgen]
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GridCfg {
|
||||
@@ -22,7 +19,7 @@ pub struct GridCfg {
|
||||
#[serde(default = "default_enabled")]
|
||||
pub enabled: Option<bool>,
|
||||
#[serde(default = "default_fmt")]
|
||||
pub fmt: Option<AngleSerializeFmt>,
|
||||
pub fmt: Option<Formatter>,
|
||||
}
|
||||
|
||||
fn default_labels() -> Option<bool> {
|
||||
@@ -45,6 +42,6 @@ fn default_thickness() -> Option<f32> {
|
||||
None
|
||||
}
|
||||
|
||||
fn default_fmt() -> Option<AngleSerializeFmt> {
|
||||
fn default_fmt() -> Option<Formatter> {
|
||||
None
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ use crate::coo_system::CooSystem;
|
||||
|
||||
#[derive(Deserialize, Debug, Clone)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[wasm_bindgen]
|
||||
pub struct HiPSProperties {
|
||||
// Associated with the HiPS
|
||||
url: String,
|
||||
|
||||
@@ -13,7 +13,7 @@ pub mod resources;
|
||||
pub mod cell;
|
||||
pub mod fov;
|
||||
pub mod image;
|
||||
pub mod angle_fmt;
|
||||
pub mod angle;
|
||||
|
||||
pub trait Abort {
|
||||
type Item;
|
||||
|
||||
@@ -4,7 +4,7 @@ use super::color::{Color, ColorRGBA};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[wasm_bindgen]
|
||||
pub struct MOC {
|
||||
pub struct MOCOptions {
|
||||
uuid: String,
|
||||
pub line_width: f32,
|
||||
pub perimeter: bool,
|
||||
@@ -18,7 +18,7 @@ pub struct MOC {
|
||||
use crate::{color::ColorRGB, Abort};
|
||||
use std::convert::TryInto;
|
||||
#[wasm_bindgen]
|
||||
impl MOC {
|
||||
impl MOCOptions {
|
||||
#[wasm_bindgen(constructor)]
|
||||
pub fn new(
|
||||
uuid: String,
|
||||
@@ -42,7 +42,7 @@ impl MOC {
|
||||
}
|
||||
};
|
||||
|
||||
let color = parse_color(hex_color, 1.0);
|
||||
let color = parse_color(hex_color, opacity);
|
||||
let fill_color = parse_color(fill_color, opacity);
|
||||
|
||||
Self {
|
||||
@@ -58,13 +58,13 @@ impl MOC {
|
||||
}
|
||||
}
|
||||
|
||||
impl MOC {
|
||||
impl MOCOptions {
|
||||
pub fn get_uuid(&self) -> &String {
|
||||
&self.uuid
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for MOC {
|
||||
impl Default for MOCOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
uuid: String::from("moc"),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "al-core"
|
||||
version = "0.1.0"
|
||||
version = "3.6.5"
|
||||
authors = ["baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr"]
|
||||
edition = "2018"
|
||||
|
||||
@@ -17,9 +17,7 @@ serde-wasm-bindgen = "0.4"
|
||||
wasm-streams = "0.3.0"
|
||||
futures = "0.3.25"
|
||||
colorgrad = "0.6.2"
|
||||
|
||||
[dependencies.wasm-bindgen]
|
||||
version = "0.2.92"
|
||||
wasm-bindgen = "0.2.92"
|
||||
|
||||
[dev-dependencies]
|
||||
fontdue = "0.7.2"
|
||||
|
||||
@@ -163,7 +163,7 @@ impl Image for Fits<'_> {
|
||||
);
|
||||
}
|
||||
Data::F32(data) => {
|
||||
let view = unsafe { R32F::view(&data) };
|
||||
let view = unsafe { R8UI::view(&std::slice::from_raw_parts(data.as_ptr() as *const u8, data.len() * 4)) };
|
||||
textures.tex_sub_image_3d_with_opt_array_buffer_view(
|
||||
offset.x,
|
||||
offset.y,
|
||||
|
||||
@@ -152,21 +152,13 @@ impl ImageFormat for RGB32F {
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
|
||||
pub struct R32F;
|
||||
impl ImageFormat for R32F {
|
||||
type P = [f32; 1];
|
||||
type P = [u8; 4];
|
||||
|
||||
const NUM_CHANNELS: usize = 1;
|
||||
const NUM_CHANNELS: usize = 4;
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
const FORMAT: u32 = WebGlRenderingCtx::RED as u32;
|
||||
#[cfg(feature = "webgl1")]
|
||||
const FORMAT: u32 = WebGlRenderingCtx::LUMINANCE as u32;
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
const INTERNAL_FORMAT: i32 = WebGlRenderingCtx::R32F as i32;
|
||||
#[cfg(feature = "webgl1")]
|
||||
const INTERNAL_FORMAT: i32 = WebGlRenderingCtx::LUMINANCE as i32;
|
||||
|
||||
const TYPE: u32 = WebGlRenderingCtx::FLOAT;
|
||||
const FORMAT: u32 = WebGlRenderingCtx::RGBA as u32;
|
||||
const INTERNAL_FORMAT: i32 = WebGlRenderingCtx::RGBA8 as i32;
|
||||
const TYPE: u32 = WebGlRenderingCtx::UNSIGNED_BYTE;
|
||||
|
||||
const CHANNEL_TYPE: ChannelType = ChannelType::R32F;
|
||||
|
||||
@@ -174,41 +166,31 @@ impl ImageFormat for R32F {
|
||||
Ok(Bytes::Borrowed(raw_bytes))
|
||||
}
|
||||
|
||||
type ArrayBufferView = js_sys::Float32Array;
|
||||
type ArrayBufferView = js_sys::Uint8Array;
|
||||
|
||||
unsafe fn view(s: &[<Self::P as Pixel>::Item]) -> Self::ArrayBufferView {
|
||||
Self::ArrayBufferView::view(s)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
|
||||
pub struct R64F;
|
||||
#[cfg(feature = "webgl2")]
|
||||
impl ImageFormat for R64F {
|
||||
type P = [f32; 1];
|
||||
type P = [u8; 4];
|
||||
|
||||
const NUM_CHANNELS: usize = 1;
|
||||
const NUM_CHANNELS: usize = 4;
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
const FORMAT: u32 = WebGlRenderingCtx::RED as u32;
|
||||
#[cfg(feature = "webgl1")]
|
||||
const FORMAT: u32 = WebGlRenderingCtx::LUMINANCE as u32;
|
||||
const FORMAT: u32 = WebGlRenderingCtx::RGBA as u32;
|
||||
const INTERNAL_FORMAT: i32 = WebGlRenderingCtx::RGBA8 as i32;
|
||||
const TYPE: u32 = WebGlRenderingCtx::UNSIGNED_BYTE;
|
||||
|
||||
#[cfg(feature = "webgl2")]
|
||||
const INTERNAL_FORMAT: i32 = WebGlRenderingCtx::R32F as i32;
|
||||
#[cfg(feature = "webgl1")]
|
||||
const INTERNAL_FORMAT: i32 = WebGlRenderingCtx::LUMINANCE as i32;
|
||||
|
||||
const TYPE: u32 = WebGlRenderingCtx::FLOAT;
|
||||
|
||||
const CHANNEL_TYPE: ChannelType = ChannelType::R64F;
|
||||
const CHANNEL_TYPE: ChannelType = ChannelType::R32F;
|
||||
|
||||
fn decode(raw_bytes: &[u8]) -> Result<Bytes<'_>, &'static str> {
|
||||
Ok(Bytes::Borrowed(raw_bytes))
|
||||
}
|
||||
|
||||
type ArrayBufferView = js_sys::Float32Array;
|
||||
type ArrayBufferView = js_sys::Uint8Array;
|
||||
|
||||
unsafe fn view(s: &[<Self::P as Pixel>::Item]) -> Self::ArrayBufferView {
|
||||
Self::ArrayBufferView::view(s)
|
||||
@@ -309,6 +291,18 @@ pub enum ChannelType {
|
||||
R32I,
|
||||
}
|
||||
|
||||
impl ChannelType {
|
||||
pub fn is_colored(&self) -> bool {
|
||||
match self {
|
||||
ChannelType::RGBA32F
|
||||
| ChannelType::RGB32F
|
||||
| ChannelType::RGBA8U
|
||||
| ChannelType::RGB8U => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub const NUM_CHANNELS: usize = 9;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Hash, Eq, PartialEq)]
|
||||
@@ -327,12 +321,6 @@ impl ImageFormatType {
|
||||
}
|
||||
|
||||
pub fn is_colored(&self) -> bool {
|
||||
match self.channel {
|
||||
ChannelType::RGBA32F
|
||||
| ChannelType::RGB32F
|
||||
| ChannelType::RGBA8U
|
||||
| ChannelType::RGB8U => true,
|
||||
_ => false,
|
||||
}
|
||||
self.channel.is_colored()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ where
|
||||
|
||||
use crate::image::format::ImageFormat;
|
||||
use crate::image::Image;
|
||||
use crate::texture::{Tex3D, Texture2DArray};
|
||||
use crate::texture::Tex3D;
|
||||
use cgmath::Vector3;
|
||||
use wasm_bindgen::JsValue;
|
||||
impl<F> Image for HTMLImage<F>
|
||||
|
||||
@@ -181,7 +181,6 @@ impl ArrayBuffer for ArrayF64 {
|
||||
|
||||
use self::canvas::Canvas;
|
||||
use self::html::HTMLImage;
|
||||
use super::Texture2DArray;
|
||||
use wasm_bindgen::JsValue;
|
||||
pub trait Image {
|
||||
fn insert_into_3d_texture<T: Tex3D>(
|
||||
|
||||
@@ -138,7 +138,6 @@ pub enum ImageBufferType {
|
||||
}
|
||||
|
||||
use crate::image::{ArrayBuffer, Image};
|
||||
use crate::Texture2DArray;
|
||||
use cgmath::{Vector2, Vector3};
|
||||
impl<I> Image for ImageBuffer<I>
|
||||
where
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct Texture3D {
|
||||
texture: Option<WebGlTexture>,
|
||||
|
||||
metadata: Option<Rc<RefCell<Texture2DMeta>>>,
|
||||
depth: i32,
|
||||
_depth: i32,
|
||||
}
|
||||
|
||||
impl Texture3D {
|
||||
@@ -62,7 +62,7 @@ impl Texture3D {
|
||||
Ok(Texture3D {
|
||||
texture,
|
||||
gl: gl.clone(),
|
||||
depth,
|
||||
_depth: depth,
|
||||
metadata,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ pub trait Pixel:
|
||||
+ Copy
|
||||
+ std::fmt::Debug
|
||||
+ cgmath::Zero
|
||||
+ cgmath::One
|
||||
+ std::cmp::PartialEq
|
||||
+ crate::convert::Cast<f32>;
|
||||
type Container: ArrayBuffer<Item = Self::Item>;
|
||||
|
||||
@@ -24,7 +24,8 @@ fn generate_shaders() -> std::result::Result<(), Box<dyn Error>> {
|
||||
//.with_extension("")
|
||||
.to_string_lossy()
|
||||
.to_owned()
|
||||
.replace("/", "_");
|
||||
.replace("/", "_")
|
||||
.replace("\\", "_");
|
||||
//let out_name = format!("{}/{}", OUT_PATH, out_file_name);
|
||||
|
||||
let src = read_shader(path)?;
|
||||
@@ -86,7 +87,7 @@ pub fn write(path: PathBuf, entries: HashMap<String, String>) -> Result<(), Box<
|
||||
for (name, content) in entries {
|
||||
writeln!(
|
||||
&mut all_the_files,
|
||||
r##" out.insert("{name}", r#"{content}"#);"##,
|
||||
r##" out.insert(r"{name}", r#"{content}"#);"##,
|
||||
)?;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::renderable::ImageLayer;
|
||||
use crate::tile_fetcher::HiPSLocalFiles;
|
||||
|
||||
use crate::math::angle::ToAngle;
|
||||
use crate::renderable::hips::HiPS;
|
||||
use crate::{
|
||||
//async_task::{BuildCatalogIndex, ParseTableTask, TaskExecutor, TaskResult, TaskType},
|
||||
@@ -20,6 +21,7 @@ use crate::{
|
||||
tile_fetcher::TileFetcherQueue,
|
||||
time::DeltaTime,
|
||||
};
|
||||
use al_api::moc::MOCOptions;
|
||||
use wcs::WCS;
|
||||
|
||||
use wasm_bindgen::prelude::*;
|
||||
@@ -186,7 +188,7 @@ impl App {
|
||||
let request_for_new_tiles = true;
|
||||
|
||||
let moc = MOCRenderer::new(&gl)?;
|
||||
gl.clear_color(0.0, 0.0, 0.0, 1.0);
|
||||
gl.clear_color(0.1, 0.1, 0.1, 1.0);
|
||||
|
||||
let (img_send, img_recv) = async_channel::unbounded::<ImageLayer>();
|
||||
let (ack_img_send, ack_img_recv) = async_channel::unbounded::<ImageParams>();
|
||||
@@ -274,10 +276,6 @@ impl App {
|
||||
let min_tile_depth = cfg.delta_depth().max(cfg.get_min_depth_tile());
|
||||
let mut ancestors = HashSet::new();
|
||||
|
||||
let creator_did = cfg.get_creator_did().to_string();
|
||||
let root_url = cfg.get_root_url().to_string();
|
||||
let format = cfg.get_format();
|
||||
|
||||
if let Some(tiles) = hips.look_for_new_tiles(&mut self.camera, &self.projection) {
|
||||
for tile_cell in tiles {
|
||||
self.tile_fetcher.append(hips.get_tile_query(&tile_cell));
|
||||
@@ -405,7 +403,7 @@ impl App {
|
||||
}
|
||||
|
||||
pub(crate) fn get_visible_cells(&self, depth: u8) -> Box<[HEALPixCellProjeted]> {
|
||||
// Convert the camera frame vertices to icrs before doing the moc
|
||||
// Convert the camera frame vertices to ICRS before doing the moc
|
||||
let coverage = crate::camera::build_fov_coverage(
|
||||
depth,
|
||||
self.camera.get_field_of_view(),
|
||||
@@ -418,13 +416,13 @@ impl App {
|
||||
let cells: Vec<_> = coverage
|
||||
.flatten_to_fixed_depth_cells()
|
||||
.filter_map(|ipix| {
|
||||
// this cell is defined in ICRS
|
||||
// This cell is defined in ICRS
|
||||
let cell = HEALPixCell(depth, ipix);
|
||||
|
||||
let v = cell.vertices();
|
||||
let proj2screen = |(lon, lat): &(f64, f64)| -> Option<[f64; 2]> {
|
||||
// 1. convert to xyzw
|
||||
let xyzw = crate::math::lonlat::radec_to_xyzw(Angle(*lon), Angle(*lat));
|
||||
let xyzw = crate::math::lonlat::radec_to_xyzw(lon.to_angle(), lat.to_angle());
|
||||
// 2. get it back to the camera frame system
|
||||
let xyzw = crate::coosys::apply_coo_system(
|
||||
CooSystem::ICRS,
|
||||
@@ -479,25 +477,25 @@ impl App {
|
||||
self.catalog_loaded
|
||||
}
|
||||
|
||||
pub(crate) fn get_moc(&self, cfg: &al_api::moc::MOC) -> Option<&HEALPixCoverage> {
|
||||
self.moc.get_hpx_coverage(cfg)
|
||||
pub(crate) fn get_moc(&self, moc_uuid: &str) -> Option<&HEALPixCoverage> {
|
||||
self.moc.get_hpx_coverage(moc_uuid)
|
||||
}
|
||||
|
||||
pub(crate) fn add_moc(
|
||||
&mut self,
|
||||
cfg: al_api::moc::MOC,
|
||||
moc: HEALPixCoverage,
|
||||
options: MOCOptions,
|
||||
) -> Result<(), JsValue> {
|
||||
self.moc
|
||||
.push_back(moc, cfg, &mut self.camera, &self.projection);
|
||||
.push_back(moc, options, &mut self.camera, &self.projection);
|
||||
self.request_redraw = true;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn remove_moc(&mut self, cfg: &al_api::moc::MOC) -> Result<(), JsValue> {
|
||||
pub(crate) fn remove_moc(&mut self, moc_uuid: &str) -> Result<(), JsValue> {
|
||||
self.moc
|
||||
.remove(cfg, &mut self.camera, &self.projection)
|
||||
.remove(moc_uuid, &mut self.camera, &self.projection)
|
||||
.ok_or_else(|| JsValue::from_str("MOC not found"))?;
|
||||
|
||||
self.request_redraw = true;
|
||||
@@ -505,9 +503,9 @@ impl App {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn set_moc_cfg(&mut self, cfg: al_api::moc::MOC) -> Result<(), JsValue> {
|
||||
pub(crate) fn set_moc_options(&mut self, options: MOCOptions) -> Result<(), JsValue> {
|
||||
self.moc
|
||||
.set_cfg(cfg, &mut self.camera, &self.projection, &mut self.shaders)
|
||||
.set_options(options)
|
||||
.ok_or_else(|| JsValue::from_str("MOC not found"))?;
|
||||
self.request_redraw = true;
|
||||
|
||||
@@ -539,7 +537,7 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
self.draw(false)?;
|
||||
self.draw()?;
|
||||
|
||||
// Check for async retrieval
|
||||
if let Ok(img) = self.img_recv.try_recv() {
|
||||
@@ -715,10 +713,9 @@ impl App {
|
||||
tile.channel.unwrap() as u16,
|
||||
)?,
|
||||
}
|
||||
|
||||
self.time_start_blending = Time::now();
|
||||
}
|
||||
None => (),
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -810,7 +807,7 @@ impl App {
|
||||
self.grid.draw_labels()
|
||||
}
|
||||
|
||||
pub(crate) fn draw(&mut self, force_render: bool) -> Result<(), JsValue> {
|
||||
pub(crate) fn draw(&mut self) -> Result<(), JsValue> {
|
||||
/*let scene_redraw = self.rendering | force_render;
|
||||
let mut ui = self.ui.lock();
|
||||
|
||||
@@ -888,10 +885,10 @@ impl App {
|
||||
let projection = &self.projection;
|
||||
|
||||
let layers = &mut self.layers;
|
||||
let catalogs = &self.manager;
|
||||
//let catalogs = &self.manager;
|
||||
let colormaps = &self.colormaps;
|
||||
let fbo_view = &self._fbo_view;
|
||||
let final_rendering_pass = &self._final_rendering_pass;
|
||||
//let fbo_view = &self._fbo_view;
|
||||
//let final_rendering_pass = &self._final_rendering_pass;
|
||||
|
||||
//fbo_view.draw_onto(
|
||||
// move || {
|
||||
@@ -1280,8 +1277,7 @@ impl App {
|
||||
// Set the new meta
|
||||
// keep the old meta data
|
||||
let new_img_ext = meta.img_format;
|
||||
self.layers
|
||||
.set_layer_cfg(layer.clone(), meta, &mut self.camera, &self.projection)?;
|
||||
self.layers.set_layer_cfg(layer.clone(), meta)?;
|
||||
|
||||
if old_meta.img_format != new_img_ext {
|
||||
// The image format has been changed
|
||||
@@ -1319,7 +1315,7 @@ impl App {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) fn get_max_fov(&self) -> f64 {
|
||||
pub(crate) fn get_max_fov(&self) -> Angle<f64> {
|
||||
self.projection.aperture_start()
|
||||
}
|
||||
|
||||
@@ -1447,12 +1443,12 @@ impl App {
|
||||
}
|
||||
|
||||
pub(crate) fn view_to_icrs_coosys(&self, lonlat: &LonLatT<f64>) -> LonLatT<f64> {
|
||||
let icrs_pos: Vector4<_> = lonlat.vector();
|
||||
let celestial_pos: Vector4<_> = lonlat.vector();
|
||||
let view_system = self.camera.get_coo_system();
|
||||
let (ra, dec) = math::lonlat::xyzw_to_radec(&coosys::apply_coo_system(
|
||||
view_system,
|
||||
CooSystem::ICRS,
|
||||
&icrs_pos,
|
||||
&celestial_pos,
|
||||
));
|
||||
|
||||
LonLatT::new(ra, dec)
|
||||
|
||||
@@ -41,7 +41,7 @@ pub fn build_fov_coverage(
|
||||
|
||||
let hpx_idxs_iter = vertices_iter.map(|v| {
|
||||
let (lon, lat) = crate::math::lonlat::xyzw_to_radec(&v);
|
||||
::healpix::nested::hash(depth, lon.0, lat.0)
|
||||
::healpix::nested::hash(depth, lon.to_radians(), lat.to_radians())
|
||||
});
|
||||
|
||||
HEALPixCoverage::from_fixed_hpx_cells(depth, hpx_idxs_iter, Some(vertices.len()))
|
||||
|
||||
@@ -6,6 +6,7 @@ pub enum UserAction {
|
||||
Starting = 4,
|
||||
}
|
||||
|
||||
use web_sys::WebGl2RenderingContext;
|
||||
// Longitude reversed identity matrix
|
||||
const ID_R: &Matrix4<f64> = &Matrix4::new(
|
||||
-1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
|
||||
@@ -87,7 +88,6 @@ const MAX_DPI_LIMIT: f32 = 2.0;
|
||||
use crate::math;
|
||||
use crate::time::Time;
|
||||
use crate::Abort;
|
||||
use crate::ArcDeg;
|
||||
impl CameraViewPort {
|
||||
pub fn new(
|
||||
gl: &WebGlContext,
|
||||
@@ -96,7 +96,7 @@ impl CameraViewPort {
|
||||
) -> CameraViewPort {
|
||||
let last_user_action = UserAction::Starting;
|
||||
|
||||
let aperture = Angle(projection.aperture_start());
|
||||
let aperture = projection.aperture_start();
|
||||
|
||||
let w2m = Matrix4::identity();
|
||||
let m2w = w2m;
|
||||
@@ -349,12 +349,12 @@ impl CameraViewPort {
|
||||
_ => true,
|
||||
};
|
||||
|
||||
let aperture_start: Angle<f64> = ArcDeg(proj.aperture_start()).into();
|
||||
let aperture_start = proj.aperture_start();
|
||||
|
||||
self.clip_zoom_factor = if aperture > aperture_start {
|
||||
//al_core::log(&format!("a: {:?}, as: {:?}", aperture, aperture_start));
|
||||
if can_unzoom_more {
|
||||
aperture.0 / aperture_start.0
|
||||
aperture.to_radians() / aperture_start.to_radians()
|
||||
} else {
|
||||
1.0
|
||||
}
|
||||
@@ -362,8 +362,8 @@ impl CameraViewPort {
|
||||
// Compute the new clip zoom factor
|
||||
let a = aperture.abs();
|
||||
|
||||
let v0 = math::lonlat::radec_to_xyzw(-a / 2.0, Angle(0.0));
|
||||
let v1 = math::lonlat::radec_to_xyzw(a / 2.0, Angle(0.0));
|
||||
let v0 = math::lonlat::radec_to_xyzw(-a / 2.0, 0.0.to_angle());
|
||||
let v1 = math::lonlat::radec_to_xyzw(a / 2.0, 0.0.to_angle());
|
||||
|
||||
// Vertex in the WCS of the FOV
|
||||
if self.width < self.height {
|
||||
@@ -488,11 +488,11 @@ impl CameraViewPort {
|
||||
pub fn set_center(&mut self, lonlat: &LonLatT<f64>, proj: &ProjectionType) {
|
||||
let icrs_pos: Vector4<_> = lonlat.vector();
|
||||
|
||||
let view_pos = CooSystem::ICRS.to(self.get_coo_system()) * icrs_pos;
|
||||
let rot_to_center = Rotation::from_sky_position(&view_pos);
|
||||
let center = (CooSystem::ICRS.to(self.get_coo_system()) * icrs_pos).truncate();
|
||||
let rot_to_center = Rotation::from_sky_position(¢er);
|
||||
|
||||
let phi = self.get_center_pos_angle();
|
||||
let third_euler_rot = Rotation::from_axis_angle(&view_pos.truncate(), phi);
|
||||
let third_euler_rot = Rotation::from_axis_angle(¢er, phi);
|
||||
|
||||
let rot = third_euler_rot * rot_to_center;
|
||||
|
||||
@@ -502,8 +502,9 @@ impl CameraViewPort {
|
||||
}
|
||||
|
||||
pub fn set_center_pos_angle(&mut self, phi: Angle<f64>, proj: &ProjectionType) {
|
||||
let rot_to_center = Rotation::from_sky_position(&self.center);
|
||||
let third_euler_rot = Rotation::from_axis_angle(&self.center.truncate(), phi);
|
||||
let c = self.center.truncate();
|
||||
let rot_to_center = Rotation::from_sky_position(&c);
|
||||
let third_euler_rot = Rotation::from_axis_angle(&c, phi);
|
||||
|
||||
let total_rot = third_euler_rot * rot_to_center;
|
||||
self.set_rotation(&total_rot, proj);
|
||||
@@ -523,7 +524,7 @@ impl CameraViewPort {
|
||||
// Compute the center position according to the new coordinate frame system
|
||||
let new_center = coosys::apply_coo_system(self.coo_sys, new_coo_sys, &self.center);
|
||||
// Create a rotation object from that position
|
||||
let new_rotation = Rotation::from_sky_position(&new_center);
|
||||
let new_rotation = Rotation::from_sky_position(&new_center.truncate());
|
||||
// Apply it to the center of the view
|
||||
self.set_rotation(&new_rotation, proj);
|
||||
|
||||
@@ -548,6 +549,13 @@ impl CameraViewPort {
|
||||
if self.reversed_longitude != reversed_longitude {
|
||||
self.reversed_longitude = reversed_longitude;
|
||||
|
||||
// Change the cull face, this fixes the display of MOC hpx cells when longitude is reversed
|
||||
if self.reversed_longitude {
|
||||
self.gl.cull_face(WebGl2RenderingContext::FRONT);
|
||||
} else {
|
||||
self.gl.cull_face(WebGl2RenderingContext::BACK);
|
||||
}
|
||||
|
||||
self.update_rot_matrices(proj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,13 @@
|
||||
use cgmath::{BaseFloat, Vector4};
|
||||
|
||||
use al_api::coo_system::CooBaseFloat;
|
||||
use cgmath::Vector4;
|
||||
use al_api::coo_system::CooSystem;
|
||||
|
||||
|
||||
/// This is conversion method returning a transformation
|
||||
/// matrix when the system requested by the user is not
|
||||
/// icrs j2000.
|
||||
/// The core projections are always performed in icrs j2000
|
||||
/// so one must call these methods to convert them to icrs before.
|
||||
/// ICRS.
|
||||
/// The core projections are always performed in ICRS
|
||||
#[inline]
|
||||
pub fn apply_coo_system<S>(c1: CooSystem, c2: CooSystem, v: &Vector4<S>) -> Vector4<S>
|
||||
where
|
||||
S: BaseFloat + CooBaseFloat,
|
||||
{
|
||||
let c1_2_c2_mat = c1.to::<S>(c2);
|
||||
pub fn apply_coo_system(c1: CooSystem, c2: CooSystem, v: &Vector4<f64>) -> Vector4<f64> {
|
||||
let c1_2_c2_mat = c1.to(c2);
|
||||
c1_2_c2_mat * (*v)
|
||||
}
|
||||
|
||||
@@ -29,7 +22,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn j2000_to_gal() {
|
||||
fn icrs_to_gal() {
|
||||
use super::CooSystem;
|
||||
use crate::math::lonlat::LonLat;
|
||||
use crate::ArcDeg;
|
||||
@@ -39,32 +32,32 @@ mod tests {
|
||||
let gal_lonlat =
|
||||
super::apply_coo_system(CooSystem::ICRS, CooSystem::GAL, &lonlat.vector()).lonlat();
|
||||
|
||||
let gal_lon_deg = gal_lonlat.lon().0 * 360.0 / (2.0 * std::f64::consts::PI);
|
||||
let gal_lat_deg = gal_lonlat.lat().0 * 360.0 / (2.0 * std::f64::consts::PI);
|
||||
let gal_lon_deg = gal_lonlat.lon().to_degrees();
|
||||
let gal_lat_deg = gal_lonlat.lat().to_degrees();
|
||||
|
||||
assert_delta!(gal_lon_deg, 96.33723581, 1e-3);
|
||||
assert_delta!(gal_lat_deg, -60.18845577, 1e-3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gal_to_j2000() {
|
||||
fn gal_to_icrs() {
|
||||
use super::CooSystem;
|
||||
use crate::math::lonlat::LonLat;
|
||||
use crate::ArcDeg;
|
||||
use crate::LonLatT;
|
||||
|
||||
let lonlat: LonLatT<f64> = LonLatT::new(ArcDeg(0.0).into(), ArcDeg(0.0).into());
|
||||
let j2000_lonlat =
|
||||
let icrs_lonlat =
|
||||
super::apply_coo_system(CooSystem::GAL, CooSystem::ICRS, &lonlat.vector()).lonlat();
|
||||
let j2000_lon_deg = j2000_lonlat.lon().0 * 360.0 / (2.0 * std::f64::consts::PI);
|
||||
let j2000_lat_deg = j2000_lonlat.lat().0 * 360.0 / (2.0 * std::f64::consts::PI);
|
||||
let icrs_lon_deg = icrs_lonlat.lon().to_degrees();
|
||||
let icrs_lat_deg = icrs_lonlat.lat().to_degrees();
|
||||
|
||||
assert_delta!(j2000_lon_deg, 266.40506655, 1e-3);
|
||||
assert_delta!(j2000_lat_deg, -28.93616241, 1e-3);
|
||||
assert_delta!(icrs_lon_deg, 266.40506655, 1e-3);
|
||||
assert_delta!(icrs_lat_deg, -28.93616241, 1e-3);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn j2000_gal_roundtrip() {
|
||||
fn icrs_gal_roundtrip() {
|
||||
use super::CooSystem;
|
||||
use crate::math::lonlat::LonLat;
|
||||
use crate::ArcDeg;
|
||||
@@ -77,8 +70,8 @@ mod tests {
|
||||
|
||||
let gal_lonlat = super::apply_coo_system(CooSystem::ICRS, CooSystem::GAL, &icrs_pos);
|
||||
|
||||
let gal_lon_deg = gal_lonlat.lon().0 * 360.0 / (2.0 * std::f64::consts::PI);
|
||||
let gal_lat_deg = gal_lonlat.lat().0 * 360.0 / (2.0 * std::f64::consts::PI);
|
||||
let gal_lon_deg = gal_lonlat.lon().to_degrees();
|
||||
let gal_lat_deg = gal_lonlat.lat().to_degrees();
|
||||
|
||||
assert_delta!(gal_lon_deg, 0.0, 1e-3);
|
||||
assert_delta!(gal_lat_deg, 0.0, 1e-3);
|
||||
|
||||