access HiPS2FITS interface from the contextual menu by giving the WCS object

This commit is contained in:
bmatthieu3
2025-03-17 11:15:32 +01:00
committed by Matthieu Baumann
parent accd4a6c7e
commit 492927c557
2 changed files with 20 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
reticleColor: '#ff89ff', // change reticle color
reticleSize: 64, // change reticle size
showContextMenu: true,
showShareControl: true,
showFrame: true,
showZoomControl:true,
showSettingsControl:true,

View File

@@ -235,10 +235,27 @@ export let DefaultActionsForContextMenu = (function () {
},
{
label: "HiPS2FITS cutout", action(o) {
let hips2fitsUrl = 'https://alasky.cds.unistra.fr/hips-image-services/hips2fits?';
let hipsId = a.getBaseImageLayer().id;
let wcs = JSON.stringify(a.getViewWCS());
hips2fitsUrl += 'wcs=' + encodeURIComponent(wcs) + '&hips=' + encodeURIComponent(hipsId);
let radec = a.getRaDec();
let fov = Math.max.apply(null, a.getFov());
let hips2fitsUrl = 'https://alasky.cds.unistra.fr/hips-image-services/hips2fits#'
// HiPS identifier
hips2fitsUrl += 'hips=' + encodeURIComponent(hipsId)
// Parameter given for full support of the Aladin view position and orientation in the sky
// WCS object
hips2fitsUrl += '&wcs=' + encodeURIComponent(wcs)
// Parameters given to fill the more readable user formular in HiPS2FITS interface
// Sky projection center
hips2fitsUrl += '&ra=' + radec[0]
hips2fitsUrl += '&dec=' + radec[1]
// FoV
hips2fitsUrl += '&fov=' + fov
// Open HiPS2FITS interface in a new browser tab
window.open(hips2fitsUrl, '_blank');
}
},