-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an API example for putting an image as overlay with a WCS given a…
…s JS objec
- Loading branch information
1 parent
7da91d7
commit c8a4fb2
Showing
54 changed files
with
1,316 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!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'; | ||
A.init.then(() => { | ||
let aladin = A.aladin('#aladin-lite-div', {fov: 30, survey: "CDS/P/GALEXGR6/AIS/FUV", target: "280 +0", projection: "AIT", showShareControl:true, showContextMenu:true}); | ||
|
||
aladin.setOverlayImageLayer(A.image( | ||
"https://nova.astrometry.net/image/25038473?filename=M61.jpg", | ||
{ | ||
name: "M61", | ||
imgFormat: 'jpeg', | ||
wcs: { | ||
NAXIS: 0, // Minimal header | ||
CTYPE1: 'RA---TAN', // TAN (gnomic) projection + SIP distortions | ||
CTYPE2: 'DEC--TAN', // TAN (gnomic) projection + SIP distortions | ||
EQUINOX: 2000.0, // Equatorial coordinates definition (yr) | ||
LONPOLE: 180.0, // no comment | ||
LATPOLE: 0.0, // no comment | ||
CRVAL1: 185.445488837, // RA of reference point | ||
CRVAL2: 4.47896032431, // DEC of reference point | ||
CRPIX1: 588.995094299, // X reference pixel | ||
CRPIX2: 308.307905197, // Y reference pixel | ||
CUNIT1: 'deg', // X pixel scale units | ||
CUNIT2: 'deg', // Y pixel scale units | ||
CD1_1: -0.000223666022989, // Transformation matrix | ||
CD1_2: 0.000296578064584, // no comment | ||
CD2_1: -0.000296427555509, // no comment | ||
CD2_2: -0.000223774308964, // no comment | ||
NAXIS1: 1080, // Image width, in pixels. | ||
NAXIS2: 705 // Image height, in pixels. | ||
}, | ||
successCallback: (ra, dec, fov, image) => { | ||
aladin.gotoRaDec(ra, dec); | ||
aladin.setFoV(fov * 5) | ||
} | ||
}, | ||
)); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
pub trait Cast<T>: Clone + Copy { | ||
fn cast(self) -> T; | ||
} | ||
|
||
impl Cast<f32> for u8 { | ||
fn cast(self) -> f32 { | ||
self as f32 | ||
} | ||
} | ||
impl Cast<f32> for i16 { | ||
fn cast(self) -> f32 { | ||
self as f32 | ||
} | ||
} | ||
|
||
impl Cast<f32> for i32 { | ||
fn cast(self) -> f32 { | ||
self as f32 | ||
} | ||
} | ||
|
||
impl Cast<f32> for f32 { | ||
fn cast(self) -> f32 { | ||
self | ||
} | ||
} | ||
|
||
impl Cast<f32> for f64 { | ||
fn cast(self) -> f32 { | ||
self as f32 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.