diff --git a/.buildinfo b/.buildinfo index f44e962..caaec6f 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 3a324aa3bdbd0549e0962a4882d09fa3 +config: 5d34cb93619b1cc1eceb8111f9990357 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_collections/notebooks/01_Getting_Started.html b/_collections/notebooks/01_Getting_Started.html index 596e41d..7eddd58 100644 --- a/_collections/notebooks/01_Getting_Started.html +++ b/_collections/notebooks/01_Getting_Started.html @@ -8,7 +8,7 @@ - Getting Started — ipyaladin 0.5.0 documentation + Getting Started — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -463,7 +463,7 @@

Getting Started
aladin = Aladin(
-    survey="http://alasky.cds.unistra.fr/DECaPS/DR1/color/",
+    survey="CDS/P/DECaPS/DR1/color",
     show_coo_grid=True,
     target="galactic center",
     coo_frame="galactic",
diff --git a/_collections/notebooks/01_Getting_Started.ipynb b/_collections/notebooks/01_Getting_Started.ipynb
index c1d4209..a698e51 100644
--- a/_collections/notebooks/01_Getting_Started.ipynb
+++ b/_collections/notebooks/01_Getting_Started.ipynb
@@ -42,7 +42,7 @@
    ],
    "source": [
     "aladin = Aladin(\n",
-    "    survey=\"http://alasky.cds.unistra.fr/DECaPS/DR1/color/\",\n",
+    "    survey=\"CDS/P/DECaPS/DR1/color\",\n",
     "    show_coo_grid=True,\n",
     "    target=\"galactic center\",\n",
     "    coo_frame=\"galactic\",\n",
diff --git a/_collections/notebooks/02_Base_Commands.html b/_collections/notebooks/02_Base_Commands.html
index 59164ed..e2cdc30 100644
--- a/_collections/notebooks/02_Base_Commands.html
+++ b/_collections/notebooks/02_Base_Commands.html
@@ -8,7 +8,7 @@
     
     
 
-    Aladin commands — ipyaladin 0.5.0 documentation
+    Aladin commands — ipyaladin 0.5.1 documentation
   
   
   
@@ -39,7 +39,7 @@
 
   
 
-    
+    
     
     
     
@@ -490,7 +490,7 @@ 

Aladin commands -

+

They can also be modified in the next cells with an interactive effect on the generated view.

@@ -516,7 +516,7 @@

Aladin commands
 <SkyCoord (ICRS): (ra, dec) in deg
-    (266.41681662, -29.00782497)>
+    (266.41681663, -29.00782497)>
 

The x-axis field of view (fov) can be set

@@ -633,7 +633,7 @@

Aladin commands -{"state": {"34d8700fab9b45a78d4e5dfa061342c8": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "e599c0fb1e524e4f8cffe6d86ea50467": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 0.2, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "fov": 20, "reticle_size": 64, "reticle_color": "#ff89ff"}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "83.6287 22.0147", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRSd", "layout": "IPY_MODEL_34d8700fab9b45a78d4e5dfa061342c8", "overlay_survey": "P/allWISE/color", "overlay_survey_opacity": 0.5, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"cc4fc34f36f84438899c2d67138a4838": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "7a7c597c283241499fdc04978769163d": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.2, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "fov": 20, "reticle_size": 64, "reticle_color": "#ff89ff"}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "83.6287 22.0147", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRSd", "layout": "IPY_MODEL_cc4fc34f36f84438899c2d67138a4838", "overlay_survey": "P/allWISE/color", "overlay_survey_opacity": 0.5, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/02_Base_Commands.ipynb b/_collections/notebooks/02_Base_Commands.ipynb index 19f12e9..c02a096 100644 --- a/_collections/notebooks/02_Base_Commands.ipynb +++ b/_collections/notebooks/02_Base_Commands.ipynb @@ -13,10 +13,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:12.893949Z", - "iopub.status.busy": "2024-09-19T15:51:12.893741Z", - "iopub.status.idle": "2024-09-19T15:51:13.605339Z", - "shell.execute_reply": "2024-09-19T15:51:13.604634Z" + "iopub.execute_input": "2024-09-30T16:02:35.822385Z", + "iopub.status.busy": "2024-09-30T16:02:35.822169Z", + "iopub.status.idle": "2024-09-30T16:02:36.493788Z", + "shell.execute_reply": "2024-09-30T16:02:36.493177Z" } }, "outputs": [], @@ -39,17 +39,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:13.607780Z", - "iopub.status.busy": "2024-09-19T15:51:13.607499Z", - "iopub.status.idle": "2024-09-19T15:51:13.635069Z", - "shell.execute_reply": "2024-09-19T15:51:13.634392Z" + "iopub.execute_input": "2024-09-30T16:02:36.496401Z", + "iopub.status.busy": "2024-09-30T16:02:36.495749Z", + "iopub.status.idle": "2024-09-30T16:02:36.522606Z", + "shell.execute_reply": "2024-09-30T16:02:36.522009Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "e599c0fb1e524e4f8cffe6d86ea50467", + "model_id": "7a7c597c283241499fdc04978769163d", "version_major": 2, "version_minor": 1 }, @@ -80,10 +80,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:13.668233Z", - "iopub.status.busy": "2024-09-19T15:51:13.667800Z", - "iopub.status.idle": "2024-09-19T15:51:15.009504Z", - "shell.execute_reply": "2024-09-19T15:51:15.009017Z" + "iopub.execute_input": "2024-09-30T16:02:36.556620Z", + "iopub.status.busy": "2024-09-30T16:02:36.556348Z", + "iopub.status.idle": "2024-09-30T16:02:37.162186Z", + "shell.execute_reply": "2024-09-30T16:02:37.161550Z" } }, "outputs": [], @@ -96,10 +96,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.011439Z", - "iopub.status.busy": "2024-09-19T15:51:15.011126Z", - "iopub.status.idle": "2024-09-19T15:51:15.016182Z", - "shell.execute_reply": "2024-09-19T15:51:15.015561Z" + "iopub.execute_input": "2024-09-30T16:02:37.164219Z", + "iopub.status.busy": "2024-09-30T16:02:37.164022Z", + "iopub.status.idle": "2024-09-30T16:02:37.168963Z", + "shell.execute_reply": "2024-09-30T16:02:37.168479Z" } }, "outputs": [ @@ -107,7 +107,7 @@ "data": { "text/plain": [ "" + " (266.41681663, -29.00782497)>" ] }, "execution_count": 4, @@ -131,10 +131,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.018123Z", - "iopub.status.busy": "2024-09-19T15:51:15.017685Z", - "iopub.status.idle": "2024-09-19T15:51:15.020925Z", - "shell.execute_reply": "2024-09-19T15:51:15.020259Z" + "iopub.execute_input": "2024-09-30T16:02:37.170751Z", + "iopub.status.busy": "2024-09-30T16:02:37.170527Z", + "iopub.status.idle": "2024-09-30T16:02:37.173762Z", + "shell.execute_reply": "2024-09-30T16:02:37.173289Z" } }, "outputs": [], @@ -147,10 +147,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.022727Z", - "iopub.status.busy": "2024-09-19T15:51:15.022367Z", - "iopub.status.idle": "2024-09-19T15:51:15.026561Z", - "shell.execute_reply": "2024-09-19T15:51:15.025989Z" + "iopub.execute_input": "2024-09-30T16:02:37.175423Z", + "iopub.status.busy": "2024-09-30T16:02:37.175235Z", + "iopub.status.idle": "2024-09-30T16:02:37.179286Z", + "shell.execute_reply": "2024-09-30T16:02:37.178802Z" } }, "outputs": [ @@ -184,10 +184,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.028306Z", - "iopub.status.busy": "2024-09-19T15:51:15.027974Z", - "iopub.status.idle": "2024-09-19T15:51:15.031385Z", - "shell.execute_reply": "2024-09-19T15:51:15.030896Z" + "iopub.execute_input": "2024-09-30T16:02:37.181029Z", + "iopub.status.busy": "2024-09-30T16:02:37.180840Z", + "iopub.status.idle": "2024-09-30T16:02:37.184039Z", + "shell.execute_reply": "2024-09-30T16:02:37.183579Z" } }, "outputs": [], @@ -208,10 +208,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.033165Z", - "iopub.status.busy": "2024-09-19T15:51:15.032796Z", - "iopub.status.idle": "2024-09-19T15:51:15.035982Z", - "shell.execute_reply": "2024-09-19T15:51:15.035386Z" + "iopub.execute_input": "2024-09-30T16:02:37.185781Z", + "iopub.status.busy": "2024-09-30T16:02:37.185595Z", + "iopub.status.idle": "2024-09-30T16:02:37.189007Z", + "shell.execute_reply": "2024-09-30T16:02:37.188504Z" } }, "outputs": [], @@ -224,10 +224,10 @@ "execution_count": 9, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.037738Z", - "iopub.status.busy": "2024-09-19T15:51:15.037400Z", - "iopub.status.idle": "2024-09-19T15:51:15.041110Z", - "shell.execute_reply": "2024-09-19T15:51:15.040623Z" + "iopub.execute_input": "2024-09-30T16:02:37.190979Z", + "iopub.status.busy": "2024-09-30T16:02:37.190475Z", + "iopub.status.idle": "2024-09-30T16:02:37.194578Z", + "shell.execute_reply": "2024-09-30T16:02:37.193971Z" } }, "outputs": [ @@ -258,10 +258,10 @@ "execution_count": 10, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.042823Z", - "iopub.status.busy": "2024-09-19T15:51:15.042636Z", - "iopub.status.idle": "2024-09-19T15:51:15.046980Z", - "shell.execute_reply": "2024-09-19T15:51:15.046501Z" + "iopub.execute_input": "2024-09-30T16:02:37.196332Z", + "iopub.status.busy": "2024-09-30T16:02:37.196147Z", + "iopub.status.idle": "2024-09-30T16:02:37.200508Z", + "shell.execute_reply": "2024-09-30T16:02:37.199988Z" } }, "outputs": [], @@ -274,10 +274,10 @@ "execution_count": 11, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.048609Z", - "iopub.status.busy": "2024-09-19T15:51:15.048424Z", - "iopub.status.idle": "2024-09-19T15:51:15.052005Z", - "shell.execute_reply": "2024-09-19T15:51:15.051513Z" + "iopub.execute_input": "2024-09-30T16:02:37.202428Z", + "iopub.status.busy": "2024-09-30T16:02:37.202073Z", + "iopub.status.idle": "2024-09-30T16:02:37.205631Z", + "shell.execute_reply": "2024-09-30T16:02:37.204998Z" } }, "outputs": [], @@ -298,10 +298,10 @@ "execution_count": 12, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.053615Z", - "iopub.status.busy": "2024-09-19T15:51:15.053424Z", - "iopub.status.idle": "2024-09-19T15:51:15.162649Z", - "shell.execute_reply": "2024-09-19T15:51:15.161868Z" + "iopub.execute_input": "2024-09-30T16:02:37.207506Z", + "iopub.status.busy": "2024-09-30T16:02:37.207145Z", + "iopub.status.idle": "2024-09-30T16:02:37.317607Z", + "shell.execute_reply": "2024-09-30T16:02:37.316597Z" } }, "outputs": [], @@ -322,10 +322,10 @@ "execution_count": 13, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:15.165509Z", - "iopub.status.busy": "2024-09-19T15:51:15.165146Z", - "iopub.status.idle": "2024-09-19T15:51:21.153887Z", - "shell.execute_reply": "2024-09-19T15:51:21.153374Z" + "iopub.execute_input": "2024-09-30T16:02:37.320800Z", + "iopub.status.busy": "2024-09-30T16:02:37.320416Z", + "iopub.status.idle": "2024-09-30T16:02:42.316354Z", + "shell.execute_reply": "2024-09-30T16:02:42.315857Z" } }, "outputs": [], @@ -367,7 +367,54 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "34d8700fab9b45a78d4e5dfa061342c8": { + "7a7c597c283241499fdc04978769163d": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", + "state": { + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 0.2, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "fov": 20, + "reticle_color": "#ff89ff", + "reticle_size": 64, + "show_context_menu": true, + "show_coo_grid_control": true, + "show_settings_control": true, + "show_simbad_pointer_control": true + }, + "_is_loaded": true, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "83.6287 22.0147", + "_view_count": null, + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRSd", + "layout": "IPY_MODEL_cc4fc34f36f84438899c2d67138a4838", + "overlay_survey": "P/allWISE/color", + "overlay_survey_opacity": 0.5, + "projection": "SIN", + "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", + "tabbable": null, + "tooltip": null + } + }, + "cc4fc34f36f84438899c2d67138a4838": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -419,53 +466,6 @@ "visibility": null, "width": null } - }, - "e599c0fb1e524e4f8cffe6d86ea50467": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 0.2, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "fov": 20, - "reticle_color": "#ff89ff", - "reticle_size": 64, - "show_context_menu": true, - "show_coo_grid_control": true, - "show_settings_control": true, - "show_simbad_pointer_control": true - }, - "_is_loaded": true, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "83.6287 22.0147", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRSd", - "layout": "IPY_MODEL_34d8700fab9b45a78d4e5dfa061342c8", - "overlay_survey": "P/allWISE/color", - "overlay_survey_opacity": 0.5, - "projection": "SIN", - "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", - "tabbable": null, - "tooltip": null - } } }, "version_major": 2, diff --git a/_collections/notebooks/03_Functions.html b/_collections/notebooks/03_Functions.html index cbddbb7..ced6fa6 100644 --- a/_collections/notebooks/03_Functions.html +++ b/_collections/notebooks/03_Functions.html @@ -8,7 +8,7 @@ - Use of functions on ipyaladin widgets — ipyaladin 0.5.0 documentation + Use of functions on ipyaladin widgets — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -496,7 +496,7 @@

Home-made functions - +
[7]:
@@ -603,7 +603,7 @@ 

Built-in methods -{"state": {"f1e0ebfdbcdf4b968cf07b06ba86c06c": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "5cc3e43f3d2f4a16a80f4d70841e9b7b": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 10.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "survey": "P/DSS2/red", "fov": 10, "target": "LMC", "reticle_color": "#ff89ff", "show_status_bar": true}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "80.89416667 -69.75611111", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_f1e0ebfdbcdf4b968cf07b06ba86c06c", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/DSS2/red", "tabbable": null, "tooltip": null}}, "95f686d5c7fe4e6dbc71768eb97a2eb2": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "0391a5eec1f5488297cbaee4971e82ff": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 1.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "269.956288 -23.823863", "fov": 1}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "269.956288 -23.823863", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_95f686d5c7fe4e6dbc71768eb97a2eb2", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"545338ee2f6a48c98209902344bdb379": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "3443e47f5fb24092a971fdf626f1a765": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 10.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "survey": "P/DSS2/red", "fov": 10, "target": "LMC", "reticle_color": "#ff89ff", "show_status_bar": true}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "80.89417 -69.75611", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_545338ee2f6a48c98209902344bdb379", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/DSS2/red", "tabbable": null, "tooltip": null}}, "804cd71ec7954e24b82e421c48f98b23": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "5a5e6365165b41a4bccfeea50c27db97": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 1.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "269.956288 -23.823863", "fov": 1}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "269.956288 -23.823863", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_804cd71ec7954e24b82e421c48f98b23", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/03_Functions.ipynb b/_collections/notebooks/03_Functions.ipynb index 0bb72e8..66a9df7 100644 --- a/_collections/notebooks/03_Functions.ipynb +++ b/_collections/notebooks/03_Functions.ipynb @@ -13,10 +13,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:22.927280Z", - "iopub.status.busy": "2024-09-19T15:51:22.927088Z", - "iopub.status.idle": "2024-09-19T15:51:23.644902Z", - "shell.execute_reply": "2024-09-19T15:51:23.644268Z" + "iopub.execute_input": "2024-09-30T16:02:44.217760Z", + "iopub.status.busy": "2024-09-30T16:02:44.217322Z", + "iopub.status.idle": "2024-09-30T16:02:44.875843Z", + "shell.execute_reply": "2024-09-30T16:02:44.875214Z" } }, "outputs": [], @@ -39,17 +39,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:23.647282Z", - "iopub.status.busy": "2024-09-19T15:51:23.646812Z", - "iopub.status.idle": "2024-09-19T15:51:24.398085Z", - "shell.execute_reply": "2024-09-19T15:51:24.397571Z" + "iopub.execute_input": "2024-09-30T16:02:44.878127Z", + "iopub.status.busy": "2024-09-30T16:02:44.877687Z", + "iopub.status.idle": "2024-09-30T16:02:45.237733Z", + "shell.execute_reply": "2024-09-30T16:02:45.237183Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "5cc3e43f3d2f4a16a80f4d70841e9b7b", + "model_id": "3443e47f5fb24092a971fdf626f1a765", "version_major": 2, "version_minor": 1 }, @@ -78,10 +78,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:24.400084Z", - "iopub.status.busy": "2024-09-19T15:51:24.399696Z", - "iopub.status.idle": "2024-09-19T15:51:24.503313Z", - "shell.execute_reply": "2024-09-19T15:51:24.502856Z" + "iopub.execute_input": "2024-09-30T16:02:45.239654Z", + "iopub.status.busy": "2024-09-30T16:02:45.239279Z", + "iopub.status.idle": "2024-09-30T16:02:45.343168Z", + "shell.execute_reply": "2024-09-30T16:02:45.342598Z" } }, "outputs": [], @@ -106,10 +106,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:24.505015Z", - "iopub.status.busy": "2024-09-19T15:51:24.504814Z", - "iopub.status.idle": "2024-09-19T15:51:24.508774Z", - "shell.execute_reply": "2024-09-19T15:51:24.508193Z" + "iopub.execute_input": "2024-09-30T16:02:45.345167Z", + "iopub.status.busy": "2024-09-30T16:02:45.344791Z", + "iopub.status.idle": "2024-09-30T16:02:45.348826Z", + "shell.execute_reply": "2024-09-30T16:02:45.348219Z" } }, "outputs": [ @@ -133,10 +133,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:24.510572Z", - "iopub.status.busy": "2024-09-19T15:51:24.510214Z", - "iopub.status.idle": "2024-09-19T15:51:24.514151Z", - "shell.execute_reply": "2024-09-19T15:51:24.513605Z" + "iopub.execute_input": "2024-09-30T16:02:45.350660Z", + "iopub.status.busy": "2024-09-30T16:02:45.350284Z", + "iopub.status.idle": "2024-09-30T16:02:45.353850Z", + "shell.execute_reply": "2024-09-30T16:02:45.353357Z" } }, "outputs": [], @@ -187,17 +187,17 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:24.515820Z", - "iopub.status.busy": "2024-09-19T15:51:24.515623Z", - "iopub.status.idle": "2024-09-19T15:51:24.524650Z", - "shell.execute_reply": "2024-09-19T15:51:24.524022Z" + "iopub.execute_input": "2024-09-30T16:02:45.355691Z", + "iopub.status.busy": "2024-09-30T16:02:45.355319Z", + "iopub.status.idle": "2024-09-30T16:02:45.364054Z", + "shell.execute_reply": "2024-09-30T16:02:45.363431Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "0391a5eec1f5488297cbaee4971e82ff", + "model_id": "5a5e6365165b41a4bccfeea50c27db97", "version_major": 2, "version_minor": 1 }, @@ -220,10 +220,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:24.526186Z", - "iopub.status.busy": "2024-09-19T15:51:24.526002Z", - "iopub.status.idle": "2024-09-19T15:51:24.629260Z", - "shell.execute_reply": "2024-09-19T15:51:24.628750Z" + "iopub.execute_input": "2024-09-30T16:02:45.365913Z", + "iopub.status.busy": "2024-09-30T16:02:45.365555Z", + "iopub.status.idle": "2024-09-30T16:02:45.469196Z", + "shell.execute_reply": "2024-09-30T16:02:45.468591Z" } }, "outputs": [], @@ -243,10 +243,10 @@ "execution_count": 8, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:24.631028Z", - "iopub.status.busy": "2024-09-19T15:51:24.630666Z", - "iopub.status.idle": "2024-09-19T15:51:24.633502Z", - "shell.execute_reply": "2024-09-19T15:51:24.633044Z" + "iopub.execute_input": "2024-09-30T16:02:45.471212Z", + "iopub.status.busy": "2024-09-30T16:02:45.470867Z", + "iopub.status.idle": "2024-09-30T16:02:45.473981Z", + "shell.execute_reply": "2024-09-30T16:02:45.473487Z" } }, "outputs": [], @@ -271,7 +271,7 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "0391a5eec1f5488297cbaee4971e82ff": { + "3443e47f5fb24092a971fdf626f1a765": { "model_module": "anywidget", "model_module_version": "~0.9.*", "model_name": "AnyModel", @@ -280,53 +280,7 @@ "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 1.0, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "fov": 1, - "show_context_menu": true, - "show_coo_grid_control": true, - "show_settings_control": true, - "show_simbad_pointer_control": true, - "target": "269.956288 -23.823863" - }, - "_is_loaded": true, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "269.956288 -23.823863", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRS", - "layout": "IPY_MODEL_95f686d5c7fe4e6dbc71768eb97a2eb2", - "overlay_survey": "", - "overlay_survey_opacity": 0.0, - "projection": "SIN", - "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", - "tabbable": null, - "tooltip": null - } - }, - "5cc3e43f3d2f4a16a80f4d70841e9b7b": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 10.0, "_fov_xy": {}, "_height": 400, @@ -349,7 +303,7 @@ "_ready": false, "_selected_objects": [], "_survey_body": "sky", - "_target": "80.89416667 -69.75611111", + "_target": "80.89417 -69.75611", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", @@ -357,7 +311,7 @@ "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", - "layout": "IPY_MODEL_f1e0ebfdbcdf4b968cf07b06ba86c06c", + "layout": "IPY_MODEL_545338ee2f6a48c98209902344bdb379", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", @@ -366,7 +320,7 @@ "tooltip": null } }, - "95f686d5c7fe4e6dbc71768eb97a2eb2": { + "545338ee2f6a48c98209902344bdb379": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -419,7 +373,53 @@ "width": null } }, - "f1e0ebfdbcdf4b968cf07b06ba86c06c": { + "5a5e6365165b41a4bccfeea50c27db97": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", + "state": { + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 1.0, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "fov": 1, + "show_context_menu": true, + "show_coo_grid_control": true, + "show_settings_control": true, + "show_simbad_pointer_control": true, + "target": "269.956288 -23.823863" + }, + "_is_loaded": true, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "269.956288 -23.823863", + "_view_count": null, + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRS", + "layout": "IPY_MODEL_804cd71ec7954e24b82e421c48f98b23", + "overlay_survey": "", + "overlay_survey_opacity": 0.0, + "projection": "SIN", + "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", + "tabbable": null, + "tooltip": null + } + }, + "804cd71ec7954e24b82e421c48f98b23": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", diff --git a/_collections/notebooks/04_Importing_Tables.html b/_collections/notebooks/04_Importing_Tables.html index 1439886..5ed3e05 100644 --- a/_collections/notebooks/04_Importing_Tables.html +++ b/_collections/notebooks/04_Importing_Tables.html @@ -8,7 +8,7 @@ - Display tables resulting from an astroquery request — ipyaladin 0.5.0 documentation + Display tables resulting from an astroquery request — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -494,7 +494,7 @@

From a query
Table length=64 - +
@@ -533,7 +533,7 @@

From a query - +
[4]:
@@ -577,7 +577,7 @@ 

Display Astropy table created from scratch -{"state": {"1fd32ff82f654aa894b44b1c7b5921b8": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "7a426b1107bb4687bebb7458b4648da8": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 0.4, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "fov": 0.4, "target": "Messier 1"}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "83.6287 22.0147", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_1fd32ff82f654aa894b44b1c7b5921b8", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"3f19b958214a43e3ae3cb7db53679e54": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "be851b49a8d84d02924e70ab310d3ca3": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.4, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "fov": 0.4, "target": "Messier 1"}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "83.6287 22.0147", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_3f19b958214a43e3ae3cb7db53679e54", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/04_Importing_Tables.ipynb b/_collections/notebooks/04_Importing_Tables.ipynb index 00b1a9d..d37088a 100644 --- a/_collections/notebooks/04_Importing_Tables.ipynb +++ b/_collections/notebooks/04_Importing_Tables.ipynb @@ -17,10 +17,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:26.279379Z", - "iopub.status.busy": "2024-09-19T15:51:26.278936Z", - "iopub.status.idle": "2024-09-19T15:51:27.063171Z", - "shell.execute_reply": "2024-09-19T15:51:27.062567Z" + "iopub.execute_input": "2024-09-30T16:02:47.230429Z", + "iopub.status.busy": "2024-09-30T16:02:47.229996Z", + "iopub.status.idle": "2024-09-30T16:02:48.023196Z", + "shell.execute_reply": "2024-09-30T16:02:48.022594Z" } }, "outputs": [], @@ -44,10 +44,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:27.065518Z", - "iopub.status.busy": "2024-09-19T15:51:27.065119Z", - "iopub.status.idle": "2024-09-19T15:51:29.828259Z", - "shell.execute_reply": "2024-09-19T15:51:29.827579Z" + "iopub.execute_input": "2024-09-30T16:02:48.025496Z", + "iopub.status.busy": "2024-09-30T16:02:48.025042Z", + "iopub.status.idle": "2024-09-30T16:02:50.185956Z", + "shell.execute_reply": "2024-09-30T16:02:50.185327Z" } }, "outputs": [ @@ -55,7 +55,7 @@ "data": { "text/html": [ "
Table length=64\n", - "

MAIN_IDRADECRA_PRECDEC_PRECCOO_ERR_MAJACOO_ERR_MINACOO_ERR_ANGLECOO_QUALCOO_WAVELENGTHCOO_BIBCODESCRIPT_NUMBER_ID
"h:m:s""d:m:s"masmasdeg
objectstr13str13int16int16float32float32int16str1str1objectint32
\n", + "
\n", "\n", "\n", "\n", @@ -122,17 +122,17 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:29.830157Z", - "iopub.status.busy": "2024-09-19T15:51:29.829777Z", - "iopub.status.idle": "2024-09-19T15:51:29.839606Z", - "shell.execute_reply": "2024-09-19T15:51:29.839102Z" + "iopub.execute_input": "2024-09-30T16:02:50.187995Z", + "iopub.status.busy": "2024-09-30T16:02:50.187683Z", + "iopub.status.idle": "2024-09-30T16:02:50.197641Z", + "shell.execute_reply": "2024-09-30T16:02:50.197033Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "7a426b1107bb4687bebb7458b4648da8", + "model_id": "be851b49a8d84d02924e70ab310d3ca3", "version_major": 2, "version_minor": 1 }, @@ -155,10 +155,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:29.841305Z", - "iopub.status.busy": "2024-09-19T15:51:29.841116Z", - "iopub.status.idle": "2024-09-19T15:51:29.955165Z", - "shell.execute_reply": "2024-09-19T15:51:29.954670Z" + "iopub.execute_input": "2024-09-30T16:02:50.199607Z", + "iopub.status.busy": "2024-09-30T16:02:50.199243Z", + "iopub.status.idle": "2024-09-30T16:02:50.315314Z", + "shell.execute_reply": "2024-09-30T16:02:50.314682Z" } }, "outputs": [], @@ -179,10 +179,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:29.957024Z", - "iopub.status.busy": "2024-09-19T15:51:29.956805Z", - "iopub.status.idle": "2024-09-19T15:51:29.960846Z", - "shell.execute_reply": "2024-09-19T15:51:29.960373Z" + "iopub.execute_input": "2024-09-30T16:02:50.317612Z", + "iopub.status.busy": "2024-09-30T16:02:50.317213Z", + "iopub.status.idle": "2024-09-30T16:02:50.321747Z", + "shell.execute_reply": "2024-09-30T16:02:50.321131Z" } }, "outputs": [], @@ -208,10 +208,10 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:29.962661Z", - "iopub.status.busy": "2024-09-19T15:51:29.962298Z", - "iopub.status.idle": "2024-09-19T15:51:29.966683Z", - "shell.execute_reply": "2024-09-19T15:51:29.966206Z" + "iopub.execute_input": "2024-09-30T16:02:50.323660Z", + "iopub.status.busy": "2024-09-30T16:02:50.323299Z", + "iopub.status.idle": "2024-09-30T16:02:50.328009Z", + "shell.execute_reply": "2024-09-30T16:02:50.327393Z" } }, "outputs": [], @@ -236,7 +236,7 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "1fd32ff82f654aa894b44b1c7b5921b8": { + "3f19b958214a43e3ae3cb7db53679e54": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -289,7 +289,7 @@ "width": null } }, - "7a426b1107bb4687bebb7458b4648da8": { + "be851b49a8d84d02924e70ab310d3ca3": { "model_module": "anywidget", "model_module_version": "~0.9.*", "model_name": "AnyModel", @@ -298,7 +298,7 @@ "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.4, "_fov_xy": {}, "_height": 400, @@ -326,7 +326,7 @@ "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", - "layout": "IPY_MODEL_1fd32ff82f654aa894b44b1c7b5921b8", + "layout": "IPY_MODEL_3f19b958214a43e3ae3cb7db53679e54", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", diff --git a/_collections/notebooks/05_Display_a_MOC.html b/_collections/notebooks/05_Display_a_MOC.html index bb132ad..f341c26 100644 --- a/_collections/notebooks/05_Display_a_MOC.html +++ b/_collections/notebooks/05_Display_a_MOC.html @@ -8,7 +8,7 @@ - Display of a Multi Order Coverage (MOC) — ipyaladin 0.5.0 documentation + Display of a Multi Order Coverage (MOC) — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -483,7 +483,7 @@

Display of a Multi Order Coverage (MOC) - +

From an URL#

@@ -734,7 +734,7 @@

From a mocpy object -{"state": {"6e21833446c4457a8f76edd6e8cb72fa": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "f94052ce3ff94c9faae415f59dcc4b30": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 135.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "15 26 20.534 -57 02 14.74", "fov": 135, "survey": "P/Mellinger/color"}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "231.5855583333333 -57.03742777777778", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_6e21833446c4457a8f76edd6e8cb72fa", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/Mellinger/color", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"c87a2ab8bae446d7a40e1f5a6d33bf12": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "b01344a0e9bc49b481fef8b304539455": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 135.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "15 26 20.534 -57 02 14.74", "fov": 135, "survey": "P/Mellinger/color"}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "231.5855583333333 -57.03742777777778", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_c87a2ab8bae446d7a40e1f5a6d33bf12", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/Mellinger/color", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0}

diff --git a/_collections/notebooks/05_Display_a_MOC.ipynb b/_collections/notebooks/05_Display_a_MOC.ipynb index 54e91e5..baf9860 100644 --- a/_collections/notebooks/05_Display_a_MOC.ipynb +++ b/_collections/notebooks/05_Display_a_MOC.ipynb @@ -13,17 +13,17 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:31.604100Z", - "iopub.status.busy": "2024-09-19T15:51:31.603609Z", - "iopub.status.idle": "2024-09-19T15:51:32.538505Z", - "shell.execute_reply": "2024-09-19T15:51:32.537954Z" + "iopub.execute_input": "2024-09-30T16:02:52.030378Z", + "iopub.status.busy": "2024-09-30T16:02:52.029788Z", + "iopub.status.idle": "2024-09-30T16:02:52.938897Z", + "shell.execute_reply": "2024-09-30T16:02:52.938245Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "f94052ce3ff94c9faae415f59dcc4b30", + "model_id": "b01344a0e9bc49b481fef8b304539455", "version_major": 2, "version_minor": 1 }, @@ -58,10 +58,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:32.540534Z", - "iopub.status.busy": "2024-09-19T15:51:32.540074Z", - "iopub.status.idle": "2024-09-19T15:51:32.643651Z", - "shell.execute_reply": "2024-09-19T15:51:32.643135Z" + "iopub.execute_input": "2024-09-30T16:02:52.941024Z", + "iopub.status.busy": "2024-09-30T16:02:52.940520Z", + "iopub.status.idle": "2024-09-30T16:02:53.044454Z", + "shell.execute_reply": "2024-09-30T16:02:53.043910Z" } }, "outputs": [], @@ -86,10 +86,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:32.645421Z", - "iopub.status.busy": "2024-09-19T15:51:32.645242Z", - "iopub.status.idle": "2024-09-19T15:51:32.651231Z", - "shell.execute_reply": "2024-09-19T15:51:32.650715Z" + "iopub.execute_input": "2024-09-30T16:02:53.046485Z", + "iopub.status.busy": "2024-09-30T16:02:53.046125Z", + "iopub.status.idle": "2024-09-30T16:02:53.051968Z", + "shell.execute_reply": "2024-09-30T16:02:53.051488Z" } }, "outputs": [], @@ -297,10 +297,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:32.652988Z", - "iopub.status.busy": "2024-09-19T15:51:32.652645Z", - "iopub.status.idle": "2024-09-19T15:51:32.655772Z", - "shell.execute_reply": "2024-09-19T15:51:32.655246Z" + "iopub.execute_input": "2024-09-30T16:02:53.053673Z", + "iopub.status.busy": "2024-09-30T16:02:53.053318Z", + "iopub.status.idle": "2024-09-30T16:02:53.056243Z", + "shell.execute_reply": "2024-09-30T16:02:53.055797Z" } }, "outputs": [], @@ -320,10 +320,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:32.657354Z", - "iopub.status.busy": "2024-09-19T15:51:32.657180Z", - "iopub.status.idle": "2024-09-19T15:51:33.392861Z", - "shell.execute_reply": "2024-09-19T15:51:33.391513Z" + "iopub.execute_input": "2024-09-30T16:02:53.058105Z", + "iopub.status.busy": "2024-09-30T16:02:53.057758Z", + "iopub.status.idle": "2024-09-30T16:02:53.793260Z", + "shell.execute_reply": "2024-09-30T16:02:53.791621Z" } }, "outputs": [], @@ -380,7 +380,54 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "6e21833446c4457a8f76edd6e8cb72fa": { + "b01344a0e9bc49b481fef8b304539455": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", + "state": { + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 135.0, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "fov": 135, + "show_context_menu": true, + "show_coo_grid_control": true, + "show_settings_control": true, + "show_simbad_pointer_control": true, + "survey": "P/Mellinger/color", + "target": "15 26 20.534 -57 02 14.74" + }, + "_is_loaded": true, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "231.5855583333333 -57.03742777777778", + "_view_count": null, + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRS", + "layout": "IPY_MODEL_c87a2ab8bae446d7a40e1f5a6d33bf12", + "overlay_survey": "", + "overlay_survey_opacity": 0.0, + "projection": "SIN", + "survey": "P/Mellinger/color", + "tabbable": null, + "tooltip": null + } + }, + "c87a2ab8bae446d7a40e1f5a6d33bf12": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -432,53 +479,6 @@ "visibility": null, "width": null } - }, - "f94052ce3ff94c9faae415f59dcc4b30": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 135.0, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "fov": 135, - "show_context_menu": true, - "show_coo_grid_control": true, - "show_settings_control": true, - "show_simbad_pointer_control": true, - "survey": "P/Mellinger/color", - "target": "15 26 20.534 -57 02 14.74" - }, - "_is_loaded": true, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "231.5855583333333 -57.03742777777778", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRS", - "layout": "IPY_MODEL_6e21833446c4457a8f76edd6e8cb72fa", - "overlay_survey": "", - "overlay_survey_opacity": 0.0, - "projection": "SIN", - "survey": "P/Mellinger/color", - "tabbable": null, - "tooltip": null - } } }, "version_major": 2, diff --git a/_collections/notebooks/06_Linked-widgets.html b/_collections/notebooks/06_Linked-widgets.html index 40cbd2b..d3cb766 100644 --- a/_collections/notebooks/06_Linked-widgets.html +++ b/_collections/notebooks/06_Linked-widgets.html @@ -8,7 +8,7 @@ - Linked widgets — ipyaladin 0.5.0 documentation + Linked widgets — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -503,7 +503,7 @@

Linked widgets - +
[ ]:
@@ -514,7 +514,7 @@ 

Linked widgets -{"state": {"387485fda535400cb99740ea24a1a39d": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "33.33%"}}, "a5ad33bbe0e04e159281d082a062ac19": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 0.3, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 81", "fov": 0.3, "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": false, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "148.8882194 69.06529514", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_387485fda535400cb99740ea24a1a39d", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "007f7c2d22c44f0d98dfe6ab2a1f71ec": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "33.33%"}}, "443b65e0ec28487b8e870522460fbe5b": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 60.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "survey": "P/DSS2/red", "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": false, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "0.0 0.0", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_007f7c2d22c44f0d98dfe6ab2a1f71ec", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/DSS2/red", "tabbable": null, "tooltip": null}}, "b54c8cb4b3914ccdb0fd6c07a4f6d0c0": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "33.33%"}}, "9cf00603058a4a6aa32110f2907060ac": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 60.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "survey": "P/2MASS/color", "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": false, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "0.0 0.0", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_b54c8cb4b3914ccdb0fd6c07a4f6d0c0", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/2MASS/color", "tabbable": null, "tooltip": null}}, "3f8abcc478ef413ea567d30748f0c38e": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_a5ad33bbe0e04e159281d082a062ac19", "_target"], "target": ["IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", "_target"]}}, "e835ca4706654ecaa29c7c82cb3ebd9e": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", "_target"], "target": ["IPY_MODEL_9cf00603058a4a6aa32110f2907060ac", "_target"]}}, "7a471dc49a8d43859e6a62765c8fab8c": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_a5ad33bbe0e04e159281d082a062ac19", "_fov"], "target": ["IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", "_fov"]}}, "0300f281783447f599f0158ce0cde949": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", "_fov"], "target": ["IPY_MODEL_9cf00603058a4a6aa32110f2907060ac", "_fov"]}}, "e070009064d2472cad696fe4117150ae": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": "stretch", "align_self": null, "border_bottom": "solid", "border_left": "solid", "border_right": "solid", "border_top": "solid", "bottom": null, "display": "flex", "flex": null, "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "100%"}}, "01a7ce6283844d7db5c3268e8c94f974": {"model_name": "BoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "BoxView", "box_style": "", "children": ["IPY_MODEL_a5ad33bbe0e04e159281d082a062ac19", "IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", "IPY_MODEL_9cf00603058a4a6aa32110f2907060ac"], "layout": "IPY_MODEL_e070009064d2472cad696fe4117150ae", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"c88771003e874ad3baff8e2cf23b0899": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "33.33%"}}, "3d3957aa58ba494f99437da5ad324a3d": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.3, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 81", "fov": 0.3, "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": false, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "148.88821939854 69.06529514038", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_c88771003e874ad3baff8e2cf23b0899", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "c89e30e915da4876abcc2d479d7cb218": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "33.33%"}}, "de804b6b9e594457a8fb6627a43046ec": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 60.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "survey": "P/DSS2/red", "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": false, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "0.0 0.0", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_c89e30e915da4876abcc2d479d7cb218", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/DSS2/red", "tabbable": null, "tooltip": null}}, "1116292fd47e481db28247613d7c9648": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "33.33%"}}, "bab5a38fe9db44e184ba52e6813aab23": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 60.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "survey": "P/2MASS/color", "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": false, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "0.0 0.0", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_1116292fd47e481db28247613d7c9648", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "P/2MASS/color", "tabbable": null, "tooltip": null}}, "787cdee5dfd94f37b4fa786c7819db29": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_3d3957aa58ba494f99437da5ad324a3d", "_target"], "target": ["IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_target"]}}, "51cc2171d58a48ff976f0d5fc723c08c": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_target"], "target": ["IPY_MODEL_bab5a38fe9db44e184ba52e6813aab23", "_target"]}}, "bab8ee38adc7488b9909fc7392171859": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_3d3957aa58ba494f99437da5ad324a3d", "_fov"], "target": ["IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_fov"]}}, "46965b84b0d64c45983cf444b68b5461": {"model_name": "LinkModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "LinkModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": null, "source": ["IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_fov"], "target": ["IPY_MODEL_bab5a38fe9db44e184ba52e6813aab23", "_fov"]}}, "6db7d6343b734236820ec5154ef03628": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": "stretch", "align_self": null, "border_bottom": "solid", "border_left": "solid", "border_right": "solid", "border_top": "solid", "bottom": null, "display": "flex", "flex": null, "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "100%"}}, "3a2343b33ad141aa94802bc974f18396": {"model_name": "BoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "BoxView", "box_style": "", "children": ["IPY_MODEL_3d3957aa58ba494f99437da5ad324a3d", "IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "IPY_MODEL_bab5a38fe9db44e184ba52e6813aab23"], "layout": "IPY_MODEL_6db7d6343b734236820ec5154ef03628", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/06_Linked-widgets.ipynb b/_collections/notebooks/06_Linked-widgets.ipynb index d5b8fad..7d826ec 100644 --- a/_collections/notebooks/06_Linked-widgets.ipynb +++ b/_collections/notebooks/06_Linked-widgets.ipynb @@ -15,17 +15,17 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:34.867209Z", - "iopub.status.busy": "2024-09-19T15:51:34.866755Z", - "iopub.status.idle": "2024-09-19T15:51:36.259066Z", - "shell.execute_reply": "2024-09-19T15:51:36.258417Z" + "iopub.execute_input": "2024-09-30T16:02:55.395839Z", + "iopub.status.busy": "2024-09-30T16:02:55.395635Z", + "iopub.status.idle": "2024-09-30T16:02:56.627803Z", + "shell.execute_reply": "2024-09-30T16:02:56.627060Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "01a7ce6283844d7db5c3268e8c94f974", + "model_id": "3a2343b33ad141aa94802bc974f18396", "version_major": 2, "version_minor": 0 }, @@ -95,7 +95,7 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "007f7c2d22c44f0d98dfe6ab2a1f71ec": { + "1116292fd47e481db28247613d7c9648": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -148,7 +148,7 @@ "width": "33.33%" } }, - "01a7ce6283844d7db5c3268e8c94f974": { + "3a2343b33ad141aa94802bc974f18396": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "BoxModel", @@ -163,16 +163,64 @@ "_view_name": "BoxView", "box_style": "", "children": [ - "IPY_MODEL_a5ad33bbe0e04e159281d082a062ac19", - "IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", - "IPY_MODEL_9cf00603058a4a6aa32110f2907060ac" + "IPY_MODEL_3d3957aa58ba494f99437da5ad324a3d", + "IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", + "IPY_MODEL_bab5a38fe9db44e184ba52e6813aab23" ], - "layout": "IPY_MODEL_e070009064d2472cad696fe4117150ae", + "layout": "IPY_MODEL_6db7d6343b734236820ec5154ef03628", "tabbable": null, "tooltip": null } }, - "0300f281783447f599f0158ce0cde949": { + "3d3957aa58ba494f99437da5ad324a3d": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", + "state": { + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 0.3, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "fov": 0.3, + "show_context_menu": true, + "show_coo_grid_control": true, + "show_fullscreen_control": false, + "show_projection_control": false, + "show_settings_control": true, + "show_simbad_pointer_control": true, + "target": "M 81" + }, + "_is_loaded": false, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "148.88821939854 69.06529514038", + "_view_count": null, + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRS", + "layout": "IPY_MODEL_c88771003e874ad3baff8e2cf23b0899", + "overlay_survey": "", + "overlay_survey_opacity": 0.0, + "projection": "SIN", + "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", + "tabbable": null, + "tooltip": null + } + }, + "46965b84b0d64c45983cf444b68b5461": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "LinkModel", @@ -185,16 +233,38 @@ "_view_module_version": "2.0.0", "_view_name": null, "source": [ - "IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", + "IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_fov" ], "target": [ - "IPY_MODEL_9cf00603058a4a6aa32110f2907060ac", + "IPY_MODEL_bab5a38fe9db44e184ba52e6813aab23", "_fov" ] } }, - "387485fda535400cb99740ea24a1a39d": { + "51cc2171d58a48ff976f0d5fc723c08c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "LinkModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": null, + "source": [ + "IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", + "_target" + ], + "target": [ + "IPY_MODEL_bab5a38fe9db44e184ba52e6813aab23", + "_target" + ] + } + }, + "6db7d6343b734236820ec5154ef03628": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -207,16 +277,16 @@ "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, - "align_items": null, + "align_items": "stretch", "align_self": null, - "border_bottom": null, - "border_left": null, - "border_right": null, - "border_top": null, + "border_bottom": "solid", + "border_left": "solid", + "border_right": "solid", + "border_top": "solid", "bottom": null, - "display": null, + "display": "flex", "flex": null, - "flex_flow": null, + "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, @@ -244,10 +314,10 @@ "right": null, "top": null, "visibility": null, - "width": "33.33%" + "width": "100%" } }, - "3f8abcc478ef413ea567d30748f0c38e": { + "787cdee5dfd94f37b4fa786c7819db29": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "LinkModel", @@ -260,16 +330,16 @@ "_view_module_version": "2.0.0", "_view_name": null, "source": [ - "IPY_MODEL_a5ad33bbe0e04e159281d082a062ac19", + "IPY_MODEL_3d3957aa58ba494f99437da5ad324a3d", "_target" ], "target": [ - "IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", + "IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_target" ] } }, - "443b65e0ec28487b8e870522460fbe5b": { + "bab5a38fe9db44e184ba52e6813aab23": { "model_module": "anywidget", "model_module_version": "~0.9.*", "model_name": "AnyModel", @@ -278,7 +348,7 @@ "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 60.0, "_fov_xy": {}, "_height": 400, @@ -289,7 +359,7 @@ "show_projection_control": false, "show_settings_control": true, "show_simbad_pointer_control": true, - "survey": "P/DSS2/red" + "survey": "P/2MASS/color" }, "_is_loaded": false, "_is_reduced": false, @@ -307,16 +377,16 @@ "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", - "layout": "IPY_MODEL_007f7c2d22c44f0d98dfe6ab2a1f71ec", + "layout": "IPY_MODEL_1116292fd47e481db28247613d7c9648", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", - "survey": "P/DSS2/red", + "survey": "P/2MASS/color", "tabbable": null, "tooltip": null } }, - "7a471dc49a8d43859e6a62765c8fab8c": { + "bab8ee38adc7488b9909fc7392171859": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "LinkModel", @@ -329,111 +399,16 @@ "_view_module_version": "2.0.0", "_view_name": null, "source": [ - "IPY_MODEL_a5ad33bbe0e04e159281d082a062ac19", + "IPY_MODEL_3d3957aa58ba494f99437da5ad324a3d", "_fov" ], "target": [ - "IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", + "IPY_MODEL_de804b6b9e594457a8fb6627a43046ec", "_fov" ] } }, - "9cf00603058a4a6aa32110f2907060ac": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 60.0, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "show_context_menu": true, - "show_coo_grid_control": true, - "show_fullscreen_control": false, - "show_projection_control": false, - "show_settings_control": true, - "show_simbad_pointer_control": true, - "survey": "P/2MASS/color" - }, - "_is_loaded": false, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "0.0 0.0", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRS", - "layout": "IPY_MODEL_b54c8cb4b3914ccdb0fd6c07a4f6d0c0", - "overlay_survey": "", - "overlay_survey_opacity": 0.0, - "projection": "SIN", - "survey": "P/2MASS/color", - "tabbable": null, - "tooltip": null - } - }, - "a5ad33bbe0e04e159281d082a062ac19": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 0.3, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "fov": 0.3, - "show_context_menu": true, - "show_coo_grid_control": true, - "show_fullscreen_control": false, - "show_projection_control": false, - "show_settings_control": true, - "show_simbad_pointer_control": true, - "target": "M 81" - }, - "_is_loaded": false, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "148.8882194 69.06529514", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRS", - "layout": "IPY_MODEL_387485fda535400cb99740ea24a1a39d", - "overlay_survey": "", - "overlay_survey_opacity": 0.0, - "projection": "SIN", - "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", - "tabbable": null, - "tooltip": null - } - }, - "b54c8cb4b3914ccdb0fd6c07a4f6d0c0": { + "c88771003e874ad3baff8e2cf23b0899": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -486,7 +461,7 @@ "width": "33.33%" } }, - "e070009064d2472cad696fe4117150ae": { + "c89e30e915da4876abcc2d479d7cb218": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -499,16 +474,16 @@ "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, - "align_items": "stretch", + "align_items": null, "align_self": null, - "border_bottom": "solid", - "border_left": "solid", - "border_right": "solid", - "border_top": "solid", + "border_bottom": null, + "border_left": null, + "border_right": null, + "border_top": null, "bottom": null, - "display": "flex", + "display": null, "flex": null, - "flex_flow": "row", + "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, @@ -536,29 +511,54 @@ "right": null, "top": null, "visibility": null, - "width": "100%" + "width": "33.33%" } }, - "e835ca4706654ecaa29c7c82cb3ebd9e": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "LinkModel", + "de804b6b9e594457a8fb6627a43046ec": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "LinkModel", + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 60.0, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "show_context_menu": true, + "show_coo_grid_control": true, + "show_fullscreen_control": false, + "show_projection_control": false, + "show_settings_control": true, + "show_simbad_pointer_control": true, + "survey": "P/DSS2/red" + }, + "_is_loaded": false, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "0.0 0.0", "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "2.0.0", - "_view_name": null, - "source": [ - "IPY_MODEL_443b65e0ec28487b8e870522460fbe5b", - "_target" - ], - "target": [ - "IPY_MODEL_9cf00603058a4a6aa32110f2907060ac", - "_target" - ] + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRS", + "layout": "IPY_MODEL_c89e30e915da4876abcc2d479d7cb218", + "overlay_survey": "", + "overlay_survey_opacity": 0.0, + "projection": "SIN", + "survey": "P/DSS2/red", + "tabbable": null, + "tooltip": null } } }, diff --git a/_collections/notebooks/07_on-click-callback.html b/_collections/notebooks/07_on-click-callback.html index 1393dc1..3a6c8f6 100644 --- a/_collections/notebooks/07_on-click-callback.html +++ b/_collections/notebooks/07_on-click-callback.html @@ -8,7 +8,7 @@ - On click callback — ipyaladin 0.5.0 documentation + On click callback — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -491,7 +491,7 @@

On click callback -

+
[2]:
@@ -558,7 +558,7 @@ 

On click callback -{"state": {"17b2efa311334ccdad4e751a54a4e188": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "70%"}}, "689f184a48a64b849b7a133811863ed2": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 0.3, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 36", "fov": 0.3}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "84.084 34.135", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_17b2efa311334ccdad4e751a54a4e188", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "894cc2d6caf24bbfacbeb454c36fee60": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "1d90b12138434f0aa192288c64302ad9": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "b2f59d6ac6824f3ab54052870b74aa5d": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_894cc2d6caf24bbfacbeb454c36fee60", "placeholder": "\u200b", "style": "IPY_MODEL_1d90b12138434f0aa192288c64302ad9", "tabbable": null, "tooltip": null, "value": ""}}, "0c4ad0171dbf45f3a00ede744e67fe5c": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": "stretch", "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": "flex", "flex": null, "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "100%"}}, "e2282debc9784ba4bb209be0b9d667e6": {"model_name": "BoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "BoxView", "box_style": "", "children": ["IPY_MODEL_689f184a48a64b849b7a133811863ed2", "IPY_MODEL_b2f59d6ac6824f3ab54052870b74aa5d"], "layout": "IPY_MODEL_0c4ad0171dbf45f3a00ede744e67fe5c", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"7d1c48aa54dd4837b6ead7436eef830a": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "70%"}}, "cb9dace497bf404f80f7269b72cb1f0a": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.3, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 36", "fov": 0.3}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "84.084 34.135", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_7d1c48aa54dd4837b6ead7436eef830a", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "e423d9f9d0f647779ee11584b57ba740": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "6b28dbe19b9b402a825081312fd5973d": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "13db7828a4f743a29d42157dce9159c7": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_e423d9f9d0f647779ee11584b57ba740", "placeholder": "\u200b", "style": "IPY_MODEL_6b28dbe19b9b402a825081312fd5973d", "tabbable": null, "tooltip": null, "value": ""}}, "758f70587383467a9808219edaf56d70": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": "stretch", "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": "flex", "flex": null, "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "100%"}}, "43162d16772a4120815cebf3d90fb27c": {"model_name": "BoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "BoxView", "box_style": "", "children": ["IPY_MODEL_cb9dace497bf404f80f7269b72cb1f0a", "IPY_MODEL_13db7828a4f743a29d42157dce9159c7"], "layout": "IPY_MODEL_758f70587383467a9808219edaf56d70", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/07_on-click-callback.ipynb b/_collections/notebooks/07_on-click-callback.ipynb index c82bca1..acdf2e1 100644 --- a/_collections/notebooks/07_on-click-callback.ipynb +++ b/_collections/notebooks/07_on-click-callback.ipynb @@ -15,17 +15,17 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:37.578915Z", - "iopub.status.busy": "2024-09-19T15:51:37.578708Z", - "iopub.status.idle": "2024-09-19T15:51:38.964095Z", - "shell.execute_reply": "2024-09-19T15:51:38.963400Z" + "iopub.execute_input": "2024-09-30T16:02:58.222805Z", + "iopub.status.busy": "2024-09-30T16:02:58.222604Z", + "iopub.status.idle": "2024-09-30T16:02:59.436400Z", + "shell.execute_reply": "2024-09-30T16:02:59.435793Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "e2282debc9784ba4bb209be0b9d667e6", + "model_id": "43162d16772a4120815cebf3d90fb27c", "version_major": 2, "version_minor": 0 }, @@ -59,10 +59,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:38.966129Z", - "iopub.status.busy": "2024-09-19T15:51:38.965729Z", - "iopub.status.idle": "2024-09-19T15:51:39.071235Z", - "shell.execute_reply": "2024-09-19T15:51:39.070681Z" + "iopub.execute_input": "2024-09-30T16:02:59.438460Z", + "iopub.status.busy": "2024-09-30T16:02:59.438076Z", + "iopub.status.idle": "2024-09-30T16:02:59.544090Z", + "shell.execute_reply": "2024-09-30T16:02:59.543313Z" } }, "outputs": [], @@ -152,7 +152,71 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "0c4ad0171dbf45f3a00ede744e67fe5c": { + "13db7828a4f743a29d42157dce9159c7": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": "HTMLView", + "description": "", + "description_allow_html": false, + "layout": "IPY_MODEL_e423d9f9d0f647779ee11584b57ba740", + "placeholder": "​", + "style": "IPY_MODEL_6b28dbe19b9b402a825081312fd5973d", + "tabbable": null, + "tooltip": null, + "value": "" + } + }, + "43162d16772a4120815cebf3d90fb27c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "BoxModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "BoxModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": "BoxView", + "box_style": "", + "children": [ + "IPY_MODEL_cb9dace497bf404f80f7269b72cb1f0a", + "IPY_MODEL_13db7828a4f743a29d42157dce9159c7" + ], + "layout": "IPY_MODEL_758f70587383467a9808219edaf56d70", + "tabbable": null, + "tooltip": null + } + }, + "6b28dbe19b9b402a825081312fd5973d": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "HTMLStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "StyleView", + "background": null, + "description_width": "", + "font_size": null, + "text_color": null + } + }, + "758f70587383467a9808219edaf56d70": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -205,7 +269,7 @@ "width": "100%" } }, - "17b2efa311334ccdad4e751a54a4e188": { + "7d1c48aa54dd4837b6ead7436eef830a": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -258,25 +322,7 @@ "width": "70%" } }, - "1d90b12138434f0aa192288c64302ad9": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "HTMLStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "2.0.0", - "_view_name": "StyleView", - "background": null, - "description_width": "", - "font_size": null, - "text_color": null - } - }, - "689f184a48a64b849b7a133811863ed2": { + "cb9dace497bf404f80f7269b72cb1f0a": { "model_module": "anywidget", "model_module_version": "~0.9.*", "model_name": "AnyModel", @@ -285,7 +331,7 @@ "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.3, "_fov_xy": {}, "_height": 400, @@ -313,7 +359,7 @@ "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", - "layout": "IPY_MODEL_17b2efa311334ccdad4e751a54a4e188", + "layout": "IPY_MODEL_7d1c48aa54dd4837b6ead7436eef830a", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", @@ -322,7 +368,7 @@ "tooltip": null } }, - "894cc2d6caf24bbfacbeb454c36fee60": { + "e423d9f9d0f647779ee11584b57ba740": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -374,52 +420,6 @@ "visibility": null, "width": null } - }, - "b2f59d6ac6824f3ab54052870b74aa5d": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "HTMLModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "2.0.0", - "_view_name": "HTMLView", - "description": "", - "description_allow_html": false, - "layout": "IPY_MODEL_894cc2d6caf24bbfacbeb454c36fee60", - "placeholder": "​", - "style": "IPY_MODEL_1d90b12138434f0aa192288c64302ad9", - "tabbable": null, - "tooltip": null, - "value": "" - } - }, - "e2282debc9784ba4bb209be0b9d667e6": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "BoxModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "BoxModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "2.0.0", - "_view_name": "BoxView", - "box_style": "", - "children": [ - "IPY_MODEL_689f184a48a64b849b7a133811863ed2", - "IPY_MODEL_b2f59d6ac6824f3ab54052870b74aa5d" - ], - "layout": "IPY_MODEL_0c4ad0171dbf45f3a00ede744e67fe5c", - "tabbable": null, - "tooltip": null - } } }, "version_major": 2, diff --git a/_collections/notebooks/08_Rectangular-selection.html b/_collections/notebooks/08_Rectangular-selection.html index 68ff2f9..397299e 100644 --- a/_collections/notebooks/08_Rectangular-selection.html +++ b/_collections/notebooks/08_Rectangular-selection.html @@ -8,7 +8,7 @@ - Example of interactive rectangular selection — ipyaladin 0.5.0 documentation + Example of interactive rectangular selection — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -520,7 +520,7 @@

Example of interactive rectangular selection -

+
[2]:
@@ -555,7 +555,7 @@ 

Example of interactive rectangular selection -{"state": {"4cc8cb055d124b7f83c1920972228c0a": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "50%"}}, "e38f252d67ab4e2fbb6ad4b779d7169a": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 0.2, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 1", "fov": 0.2, "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "83.6287 22.0147", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_4cc8cb055d124b7f83c1920972228c0a", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "267f5a96a2324ce699db303a796f0515": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "0c918e4745104b4da486eac1b9a227b9": {"model_name": "ButtonStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ButtonStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "button_color": null, "font_family": null, "font_size": null, "font_style": null, "font_variant": null, "font_weight": null, "text_color": null, "text_decoration": null}}, "ae6691ab964740dcb8b3f2f717142116": {"model_name": "ButtonModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ButtonModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "ButtonView", "button_style": "", "description": "Select", "disabled": false, "icon": "", "layout": "IPY_MODEL_267f5a96a2324ce699db303a796f0515", "style": "IPY_MODEL_0c918e4745104b4da486eac1b9a227b9", "tabbable": null, "tooltip": null}}, "3d5e48931e214fd8bdbb339841c5ada9": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": "auto", "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": "auto", "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "2b0cfad1534c4a5685ae4a3904aebedb": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "93d44e6dcee3485f961f23f1864c1d6a": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_3d5e48931e214fd8bdbb339841c5ada9", "placeholder": "\u200b", "style": "IPY_MODEL_2b0cfad1534c4a5685ae4a3904aebedb", "tabbable": null, "tooltip": null, "value": ""}}, "63cb818ce33c4792b7823085bbc35b63": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": "stretch", "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": "flex", "flex": null, "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "100%"}}, "62a87fbcda474cce89ece1621469d580": {"model_name": "BoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "BoxView", "box_style": "", "children": ["IPY_MODEL_e38f252d67ab4e2fbb6ad4b779d7169a", "IPY_MODEL_ae6691ab964740dcb8b3f2f717142116", "IPY_MODEL_93d44e6dcee3485f961f23f1864c1d6a"], "layout": "IPY_MODEL_63cb818ce33c4792b7823085bbc35b63", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"0aa8f0206e8b470c88b3465067d4d603": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "50%"}}, "8e2b6141cbd24ba6a0df3d940f39e220": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.2, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 1", "fov": 0.2, "show_projection_control": false, "show_fullscreen_control": false}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "83.6287 22.0147", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_0aa8f0206e8b470c88b3465067d4d603", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "3cc4164f2060446c8ed5f2a87f0bc2c2": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "bc606a6331e54755b007400676616e19": {"model_name": "ButtonStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ButtonStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "button_color": null, "font_family": null, "font_size": null, "font_style": null, "font_variant": null, "font_weight": null, "text_color": null, "text_decoration": null}}, "57b231afbbae40fc8be684c70df80379": {"model_name": "ButtonModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ButtonModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "ButtonView", "button_style": "", "description": "Select", "disabled": false, "icon": "", "layout": "IPY_MODEL_3cc4164f2060446c8ed5f2a87f0bc2c2", "style": "IPY_MODEL_bc606a6331e54755b007400676616e19", "tabbable": null, "tooltip": null}}, "1a5fffe5fb1e446fad6811f4d7468007": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": "auto", "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": "auto", "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "59be9719f6c84dab8e42d060ee6aef29": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "e3e96ef45c8e4101814dfebb24bdaefc": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_1a5fffe5fb1e446fad6811f4d7468007", "placeholder": "\u200b", "style": "IPY_MODEL_59be9719f6c84dab8e42d060ee6aef29", "tabbable": null, "tooltip": null, "value": ""}}, "f943c63bbba547329797d758ab1e4f98": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": "stretch", "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": "flex", "flex": null, "flex_flow": "row", "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "100%"}}, "63880c971a524b798ce97b8a7def806a": {"model_name": "BoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "BoxView", "box_style": "", "children": ["IPY_MODEL_8e2b6141cbd24ba6a0df3d940f39e220", "IPY_MODEL_57b231afbbae40fc8be684c70df80379", "IPY_MODEL_e3e96ef45c8e4101814dfebb24bdaefc"], "layout": "IPY_MODEL_f943c63bbba547329797d758ab1e4f98", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/08_Rectangular-selection.ipynb b/_collections/notebooks/08_Rectangular-selection.ipynb index a2bb717..a36a047 100644 --- a/_collections/notebooks/08_Rectangular-selection.ipynb +++ b/_collections/notebooks/08_Rectangular-selection.ipynb @@ -16,17 +16,17 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:40.540962Z", - "iopub.status.busy": "2024-09-19T15:51:40.540521Z", - "iopub.status.idle": "2024-09-19T15:51:41.939575Z", - "shell.execute_reply": "2024-09-19T15:51:41.938938Z" + "iopub.execute_input": "2024-09-30T16:03:00.946796Z", + "iopub.status.busy": "2024-09-30T16:03:00.946603Z", + "iopub.status.idle": "2024-09-30T16:03:02.534752Z", + "shell.execute_reply": "2024-09-30T16:03:02.534038Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "62a87fbcda474cce89ece1621469d580", + "model_id": "63880c971a524b798ce97b8a7def806a", "version_major": 2, "version_minor": 0 }, @@ -88,10 +88,10 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:41.941514Z", - "iopub.status.busy": "2024-09-19T15:51:41.941165Z", - "iopub.status.idle": "2024-09-19T15:51:43.789787Z", - "shell.execute_reply": "2024-09-19T15:51:43.789148Z" + "iopub.execute_input": "2024-09-30T16:03:02.536878Z", + "iopub.status.busy": "2024-09-30T16:03:02.536506Z", + "iopub.status.idle": "2024-09-30T16:03:04.382090Z", + "shell.execute_reply": "2024-09-30T16:03:04.381522Z" } }, "outputs": [], @@ -150,29 +150,7 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "0c918e4745104b4da486eac1b9a227b9": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "ButtonStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "ButtonStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "2.0.0", - "_view_name": "StyleView", - "button_color": null, - "font_family": null, - "font_size": null, - "font_style": null, - "font_variant": null, - "font_weight": null, - "text_color": null, - "text_decoration": null - } - }, - "267f5a96a2324ce699db303a796f0515": { + "0aa8f0206e8b470c88b3465067d4d603": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -222,28 +200,10 @@ "right": null, "top": null, "visibility": null, - "width": null - } - }, - "2b0cfad1534c4a5685ae4a3904aebedb": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "HTMLStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "2.0.0", - "_view_name": "StyleView", - "background": null, - "description_width": "", - "font_size": null, - "text_color": null + "width": "50%" } }, - "3d5e48931e214fd8bdbb339841c5ada9": { + "1a5fffe5fb1e446fad6811f4d7468007": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -296,7 +256,7 @@ "width": null } }, - "4cc8cb055d124b7f83c1920972228c0a": { + "3cc4164f2060446c8ed5f2a87f0bc2c2": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -346,133 +306,75 @@ "right": null, "top": null, "visibility": null, - "width": "50%" + "width": null } }, - "62a87fbcda474cce89ece1621469d580": { + "57b231afbbae40fc8be684c70df80379": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", - "model_name": "BoxModel", + "model_name": "ButtonModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", - "_model_name": "BoxModel", + "_model_name": "ButtonModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", - "_view_name": "BoxView", - "box_style": "", - "children": [ - "IPY_MODEL_e38f252d67ab4e2fbb6ad4b779d7169a", - "IPY_MODEL_ae6691ab964740dcb8b3f2f717142116", - "IPY_MODEL_93d44e6dcee3485f961f23f1864c1d6a" - ], - "layout": "IPY_MODEL_63cb818ce33c4792b7823085bbc35b63", + "_view_name": "ButtonView", + "button_style": "", + "description": "Select", + "disabled": false, + "icon": "", + "layout": "IPY_MODEL_3cc4164f2060446c8ed5f2a87f0bc2c2", + "style": "IPY_MODEL_bc606a6331e54755b007400676616e19", "tabbable": null, "tooltip": null } }, - "63cb818ce33c4792b7823085bbc35b63": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "2.0.0", - "model_name": "LayoutModel", - "state": { - "_model_module": "@jupyter-widgets/base", - "_model_module_version": "2.0.0", - "_model_name": "LayoutModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "2.0.0", - "_view_name": "LayoutView", - "align_content": null, - "align_items": "stretch", - "align_self": null, - "border_bottom": null, - "border_left": null, - "border_right": null, - "border_top": null, - "bottom": null, - "display": "flex", - "flex": null, - "flex_flow": "row", - "grid_area": null, - "grid_auto_columns": null, - "grid_auto_flow": null, - "grid_auto_rows": null, - "grid_column": null, - "grid_gap": null, - "grid_row": null, - "grid_template_areas": null, - "grid_template_columns": null, - "grid_template_rows": null, - "height": null, - "justify_content": null, - "justify_items": null, - "left": null, - "margin": null, - "max_height": null, - "max_width": null, - "min_height": null, - "min_width": null, - "object_fit": null, - "object_position": null, - "order": null, - "overflow": null, - "padding": null, - "right": null, - "top": null, - "visibility": null, - "width": "100%" - } - }, - "93d44e6dcee3485f961f23f1864c1d6a": { + "59be9719f6c84dab8e42d060ee6aef29": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", - "model_name": "HTMLModel", + "model_name": "HTMLStyleModel", "state": { - "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", - "_model_name": "HTMLModel", + "_model_name": "HTMLStyleModel", "_view_count": null, - "_view_module": "@jupyter-widgets/controls", + "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", - "_view_name": "HTMLView", - "description": "", - "description_allow_html": false, - "layout": "IPY_MODEL_3d5e48931e214fd8bdbb339841c5ada9", - "placeholder": "​", - "style": "IPY_MODEL_2b0cfad1534c4a5685ae4a3904aebedb", - "tabbable": null, - "tooltip": null, - "value": "" + "_view_name": "StyleView", + "background": null, + "description_width": "", + "font_size": null, + "text_color": null } }, - "ae6691ab964740dcb8b3f2f717142116": { + "63880c971a524b798ce97b8a7def806a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", - "model_name": "ButtonModel", + "model_name": "BoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", - "_model_name": "ButtonModel", + "_model_name": "BoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", - "_view_name": "ButtonView", - "button_style": "", - "description": "Select", - "disabled": false, - "icon": "", - "layout": "IPY_MODEL_267f5a96a2324ce699db303a796f0515", - "style": "IPY_MODEL_0c918e4745104b4da486eac1b9a227b9", + "_view_name": "BoxView", + "box_style": "", + "children": [ + "IPY_MODEL_8e2b6141cbd24ba6a0df3d940f39e220", + "IPY_MODEL_57b231afbbae40fc8be684c70df80379", + "IPY_MODEL_e3e96ef45c8e4101814dfebb24bdaefc" + ], + "layout": "IPY_MODEL_f943c63bbba547329797d758ab1e4f98", "tabbable": null, "tooltip": null } }, - "e38f252d67ab4e2fbb6ad4b779d7169a": { + "8e2b6141cbd24ba6a0df3d940f39e220": { "model_module": "anywidget", "model_module_version": "~0.9.*", "model_name": "AnyModel", @@ -481,7 +383,7 @@ "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 0.2, "_fov_xy": {}, "_height": 400, @@ -511,7 +413,7 @@ "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", - "layout": "IPY_MODEL_4cc8cb055d124b7f83c1920972228c0a", + "layout": "IPY_MODEL_0aa8f0206e8b470c88b3465067d4d603", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", @@ -519,6 +421,104 @@ "tabbable": null, "tooltip": null } + }, + "bc606a6331e54755b007400676616e19": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ButtonStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "ButtonStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "StyleView", + "button_color": null, + "font_family": null, + "font_size": null, + "font_style": null, + "font_variant": null, + "font_weight": null, + "text_color": null, + "text_decoration": null + } + }, + "e3e96ef45c8e4101814dfebb24bdaefc": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HTMLModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "HTMLModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": "HTMLView", + "description": "", + "description_allow_html": false, + "layout": "IPY_MODEL_1a5fffe5fb1e446fad6811f4d7468007", + "placeholder": "​", + "style": "IPY_MODEL_59be9719f6c84dab8e42d060ee6aef29", + "tabbable": null, + "tooltip": null, + "value": "" + } + }, + "f943c63bbba547329797d758ab1e4f98": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "2.0.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": "stretch", + "align_self": null, + "border_bottom": null, + "border_left": null, + "border_right": null, + "border_top": null, + "bottom": null, + "display": "flex", + "flex": null, + "flex_flow": "row", + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": "100%" + } } }, "version_major": 2, diff --git a/_collections/notebooks/09_Displaying_Shapes.html b/_collections/notebooks/09_Displaying_Shapes.html index b8409dd..396507e 100644 --- a/_collections/notebooks/09_Displaying_Shapes.html +++ b/_collections/notebooks/09_Displaying_Shapes.html @@ -8,7 +8,7 @@ - Adding shapes / graphic overlays — ipyaladin 0.5.0 documentation + Adding shapes / graphic overlays — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -506,7 +506,7 @@

Add shapes from Space-Time Coordinates (STC) -

+
[7]:
@@ -649,7 +649,7 @@ 

Add shapes from astropy-regions objects -{"state": {"9395e1f830c4417eb584ff58b70b5d42": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "16a62392bfcb4e52b7dbf205534dd532": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 1.2, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 51", "fov": 1.2}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "202.469575 47.19525833", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_9395e1f830c4417eb584ff58b70b5d42", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "d862ee8e6d1e4bb0a97b6a1a02c6b517": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "17fc9046bfbb42c99b1e21625746844b": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", "_fov": 10.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "m31", "fov": 10}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "10.68470833 41.26875", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_d862ee8e6d1e4bb0a97b6a1a02c6b517", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"adba21ed4b874664b7d595d417b79e75": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "17c30474f6574564919ab2cca0303125": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 1.2, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "M 51", "fov": 1.2}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "202.469575 47.1952583", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_adba21ed4b874664b7d595d417b79e75", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}, "d49f2b533819474bbed60493cd45851a": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "f743cbe8310840e895ef0b5bd197a7c1": {"model_name": "AnyModel", "model_module": "anywidget", "model_module_version": "~0.9.*", "state": {"_anywidget_id": "ipyaladin.widget.Aladin", "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 10.0, "_fov_xy": {}, "_height": 400, "_init_options": {"show_simbad_pointer_control": true, "show_coo_grid_control": true, "show_settings_control": true, "show_context_menu": true, "target": "m31", "fov": 10}, "_is_loaded": true, "_is_reduced": false, "_model_module": "anywidget", "_model_module_version": "~0.9.*", "_model_name": "AnyModel", "_ready": false, "_selected_objects": [], "_survey_body": "sky", "_target": "10.6847083 41.26875", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", "_view_name": "AnyView", "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", "layout": "IPY_MODEL_d49f2b533819474bbed60493cd45851a", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/_collections/notebooks/09_Displaying_Shapes.ipynb b/_collections/notebooks/09_Displaying_Shapes.ipynb index 0e3046e..6777411 100644 --- a/_collections/notebooks/09_Displaying_Shapes.ipynb +++ b/_collections/notebooks/09_Displaying_Shapes.ipynb @@ -19,10 +19,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:45.168087Z", - "iopub.status.busy": "2024-09-19T15:51:45.167894Z", - "iopub.status.idle": "2024-09-19T15:51:46.476964Z", - "shell.execute_reply": "2024-09-19T15:51:46.476309Z" + "iopub.execute_input": "2024-09-30T16:03:05.928067Z", + "iopub.status.busy": "2024-09-30T16:03:05.927866Z", + "iopub.status.idle": "2024-09-30T16:03:10.368780Z", + "shell.execute_reply": "2024-09-30T16:03:10.368133Z" } }, "outputs": [], @@ -59,17 +59,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:46.479249Z", - "iopub.status.busy": "2024-09-19T15:51:46.478983Z", - "iopub.status.idle": "2024-09-19T15:51:47.031196Z", - "shell.execute_reply": "2024-09-19T15:51:47.030502Z" + "iopub.execute_input": "2024-09-30T16:03:10.371191Z", + "iopub.status.busy": "2024-09-30T16:03:10.370915Z", + "iopub.status.idle": "2024-09-30T16:03:11.254807Z", + "shell.execute_reply": "2024-09-30T16:03:11.254295Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "16a62392bfcb4e52b7dbf205534dd532", + "model_id": "17c30474f6574564919ab2cca0303125", "version_major": 2, "version_minor": 1 }, @@ -92,10 +92,10 @@ "execution_count": 3, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:47.033235Z", - "iopub.status.busy": "2024-09-19T15:51:47.032872Z", - "iopub.status.idle": "2024-09-19T15:51:47.137468Z", - "shell.execute_reply": "2024-09-19T15:51:47.136798Z" + "iopub.execute_input": "2024-09-30T16:03:11.256734Z", + "iopub.status.busy": "2024-09-30T16:03:11.256509Z", + "iopub.status.idle": "2024-09-30T16:03:11.360797Z", + "shell.execute_reply": "2024-09-30T16:03:11.360224Z" } }, "outputs": [], @@ -138,10 +138,10 @@ "execution_count": 4, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:47.139452Z", - "iopub.status.busy": "2024-09-19T15:51:47.139254Z", - "iopub.status.idle": "2024-09-19T15:51:47.627029Z", - "shell.execute_reply": "2024-09-19T15:51:47.626353Z" + "iopub.execute_input": "2024-09-30T16:03:11.362654Z", + "iopub.status.busy": "2024-09-30T16:03:11.362433Z", + "iopub.status.idle": "2024-09-30T16:03:11.678781Z", + "shell.execute_reply": "2024-09-30T16:03:11.678095Z" } }, "outputs": [], @@ -195,10 +195,10 @@ "execution_count": 5, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:47.629191Z", - "iopub.status.busy": "2024-09-19T15:51:47.628983Z", - "iopub.status.idle": "2024-09-19T15:51:48.328388Z", - "shell.execute_reply": "2024-09-19T15:51:48.327696Z" + "iopub.execute_input": "2024-09-30T16:03:11.681327Z", + "iopub.status.busy": "2024-09-30T16:03:11.680889Z", + "iopub.status.idle": "2024-09-30T16:03:12.520040Z", + "shell.execute_reply": "2024-09-30T16:03:12.519359Z" } }, "outputs": [ @@ -214,7 +214,7 @@ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 5, @@ -259,17 +259,17 @@ "execution_count": 6, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:48.330567Z", - "iopub.status.busy": "2024-09-19T15:51:48.330283Z", - "iopub.status.idle": "2024-09-19T15:51:48.789168Z", - "shell.execute_reply": "2024-09-19T15:51:48.788527Z" + "iopub.execute_input": "2024-09-30T16:03:12.522407Z", + "iopub.status.busy": "2024-09-30T16:03:12.521883Z", + "iopub.status.idle": "2024-09-30T16:03:13.046994Z", + "shell.execute_reply": "2024-09-30T16:03:13.046341Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "17fc9046bfbb42c99b1e21625746844b", + "model_id": "f743cbe8310840e895ef0b5bd197a7c1", "version_major": 2, "version_minor": 1 }, @@ -292,10 +292,10 @@ "execution_count": 7, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:48.791245Z", - "iopub.status.busy": "2024-09-19T15:51:48.790785Z", - "iopub.status.idle": "2024-09-19T15:51:48.908180Z", - "shell.execute_reply": "2024-09-19T15:51:48.907523Z" + "iopub.execute_input": "2024-09-30T16:03:13.048740Z", + "iopub.status.busy": "2024-09-30T16:03:13.048515Z", + "iopub.status.idle": "2024-09-30T16:03:13.166143Z", + "shell.execute_reply": "2024-09-30T16:03:13.165635Z" } }, "outputs": [], @@ -343,7 +343,7 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "16a62392bfcb4e52b7dbf205534dd532": { + "17c30474f6574564919ab2cca0303125": { "model_module": "anywidget", "model_module_version": "~0.9.*", "model_name": "AnyModel", @@ -352,7 +352,7 @@ "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", "_fov": 1.2, "_fov_xy": {}, "_height": 400, @@ -372,7 +372,7 @@ "_ready": false, "_selected_objects": [], "_survey_body": "sky", - "_target": "202.469575 47.19525833", + "_target": "202.469575 47.1952583", "_view_count": null, "_view_module": "anywidget", "_view_module_version": "~0.9.*", @@ -380,7 +380,7 @@ "_wcs": {}, "clicked_object": {}, "coo_frame": "ICRS", - "layout": "IPY_MODEL_9395e1f830c4417eb584ff58b70b5d42", + "layout": "IPY_MODEL_adba21ed4b874664b7d595d417b79e75", "overlay_survey": "", "overlay_survey_opacity": 0.0, "projection": "SIN", @@ -389,53 +389,7 @@ "tooltip": null } }, - "17fc9046bfbb42c99b1e21625746844b": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 10.0, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "fov": 10, - "show_context_menu": true, - "show_coo_grid_control": true, - "show_settings_control": true, - "show_simbad_pointer_control": true, - "target": "m31" - }, - "_is_loaded": true, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "10.68470833 41.26875", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRS", - "layout": "IPY_MODEL_d862ee8e6d1e4bb0a97b6a1a02c6b517", - "overlay_survey": "", - "overlay_survey_opacity": 0.0, - "projection": "SIN", - "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", - "tabbable": null, - "tooltip": null - } - }, - "9395e1f830c4417eb584ff58b70b5d42": { + "adba21ed4b874664b7d595d417b79e75": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -488,7 +442,7 @@ "width": null } }, - "d862ee8e6d1e4bb0a97b6a1a02c6b517": { + "d49f2b533819474bbed60493cd45851a": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -540,6 +494,52 @@ "visibility": null, "width": null } + }, + "f743cbe8310840e895ef0b5bd197a7c1": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", + "state": { + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 10.0, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "fov": 10, + "show_context_menu": true, + "show_coo_grid_control": true, + "show_settings_control": true, + "show_simbad_pointer_control": true, + "target": "m31" + }, + "_is_loaded": true, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "10.6847083 41.26875", + "_view_count": null, + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRS", + "layout": "IPY_MODEL_d49f2b533819474bbed60493cd45851a", + "overlay_survey": "", + "overlay_survey_opacity": 0.0, + "projection": "SIN", + "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", + "tabbable": null, + "tooltip": null + } } }, "version_major": 2, diff --git a/_collections/notebooks/10_Advanced-GUI.html b/_collections/notebooks/10_Advanced-GUI.html index 102c724..9023029 100644 --- a/_collections/notebooks/10_Advanced-GUI.html +++ b/_collections/notebooks/10_Advanced-GUI.html @@ -8,7 +8,7 @@ - Advanced GUI — ipyaladin 0.5.0 documentation + Advanced GUI — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + @@ -604,10 +604,10 @@

Advanced GUI -

+
diff --git a/_collections/notebooks/10_Advanced-GUI.ipynb b/_collections/notebooks/10_Advanced-GUI.ipynb index 7303044..fe89a77 100644 --- a/_collections/notebooks/10_Advanced-GUI.ipynb +++ b/_collections/notebooks/10_Advanced-GUI.ipynb @@ -15,10 +15,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:50.721733Z", - "iopub.status.busy": "2024-09-19T15:51:50.721541Z", - "iopub.status.idle": "2024-09-19T15:51:51.451502Z", - "shell.execute_reply": "2024-09-19T15:51:51.450849Z" + "iopub.execute_input": "2024-09-30T16:03:15.198307Z", + "iopub.status.busy": "2024-09-30T16:03:15.198105Z", + "iopub.status.idle": "2024-09-30T16:03:15.882664Z", + "shell.execute_reply": "2024-09-30T16:03:15.882019Z" } }, "outputs": [], @@ -32,17 +32,17 @@ "execution_count": 2, "metadata": { "execution": { - "iopub.execute_input": "2024-09-19T15:51:51.453910Z", - "iopub.status.busy": "2024-09-19T15:51:51.453468Z", - "iopub.status.idle": "2024-09-19T15:51:51.976997Z", - "shell.execute_reply": "2024-09-19T15:51:51.976370Z" + "iopub.execute_input": "2024-09-30T16:03:15.884893Z", + "iopub.status.busy": "2024-09-30T16:03:15.884594Z", + "iopub.status.idle": "2024-09-30T16:03:16.262078Z", + "shell.execute_reply": "2024-09-30T16:03:16.261424Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ddf32155b18e42998e9296112f9cb427", + "model_id": "c8856af21dea42ecbf28185ef33105bc", "version_major": 2, "version_minor": 0 }, @@ -202,46 +202,7 @@ "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { - "042ebc4bbdd24465bdf2562bd672e296": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "ToggleButtonsModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "ToggleButtonsModel", - "_options_labels": [ - "P/DSS2/color", - "P/2MASS/color", - "P/DSS2/red", - "P/XMM/PN/color", - "P/GLIMPSE360" - ], - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "2.0.0", - "_view_name": "ToggleButtonsView", - "button_style": "", - "description": "Overlay:", - "description_allow_html": false, - "disabled": false, - "icons": [], - "index": 0, - "layout": "IPY_MODEL_15230c6424274c66965a8e3a8c8bb031", - "style": "IPY_MODEL_eb4a185467734ce6bbeaf2225e8e554d", - "tabbable": null, - "tooltip": null, - "tooltips": [ - "DSS2 color", - "2MASS color", - "DSS2 red", - "P/XMM/PN/color", - "P/GLIMPSE360" - ] - } - }, - "15230c6424274c66965a8e3a8c8bb031": { + "0bc8943cc4364c2e8460aa8f9f177249": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -294,24 +255,7 @@ "width": null } }, - "33c0c8f6166c4fa8945cc8c533fd8a64": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "ToggleButtonsStyleModel", - "state": { - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "ToggleButtonsStyleModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/base", - "_view_module_version": "2.0.0", - "_view_name": "StyleView", - "button_width": "", - "description_width": "", - "font_weight": "" - } - }, - "3af9b9d40e624f028f3604e37862b9ae": { + "274a4a2692f44d2897816be798881c2a": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -364,23 +308,88 @@ "width": null } }, - "76d1dfce78684c298cab38ac7ba9fd77": { + "61a088b8ffae46a99564ef84d9e6784f": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", - "model_name": "SliderStyleModel", + "model_name": "ToggleButtonsModel", "state": { + "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", - "_model_name": "SliderStyleModel", + "_model_name": "ToggleButtonsModel", + "_options_labels": [ + "P/DSS2/color", + "P/2MASS/color", + "P/DSS2/red" + ], "_view_count": null, - "_view_module": "@jupyter-widgets/base", + "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", - "_view_name": "StyleView", - "description_width": "", - "handle_color": null + "_view_name": "ToggleButtonsView", + "button_style": "", + "description": "Image:", + "description_allow_html": false, + "disabled": false, + "icons": [], + "index": 0, + "layout": "IPY_MODEL_c9467b7efed34e71a2ed693660a8d589", + "style": "IPY_MODEL_b79f175200cb427591d9d543a08bb71f", + "tabbable": null, + "tooltip": null, + "tooltips": [ + "DSS2 color", + "2MASS color", + "DSS2 red" + ] + } + }, + "839dd72fba5e4ffdaa96fd718d51e26b": { + "model_module": "anywidget", + "model_module_version": "~0.9.*", + "model_name": "AnyModel", + "state": { + "_anywidget_id": "ipyaladin.widget.Aladin", + "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", + "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", + "_dom_classes": [], + "_esm": "function v(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{_(this.model.get(\"_height\"),this.aladinDiv),this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function C(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[v(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),_(n.get(\"_height\"),i),i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function k({model:n}){await r.init}function w({model:n,el:e}){let{aladin:a,aladinDiv:s}=C(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var W={initialize:k,render:w};export{W as default};\n", + "_fov": 2.0, + "_fov_xy": {}, + "_height": 400, + "_init_options": { + "fov": 2, + "show_context_menu": true, + "show_coo_grid_control": true, + "show_settings_control": true, + "show_simbad_pointer_control": true, + "target": "orion" + }, + "_is_loaded": false, + "_is_reduced": false, + "_model_module": "anywidget", + "_model_module_version": "~0.9.*", + "_model_name": "AnyModel", + "_ready": false, + "_selected_objects": [], + "_survey_body": "sky", + "_target": "83.82 -5.39", + "_view_count": null, + "_view_module": "anywidget", + "_view_module_version": "~0.9.*", + "_view_name": "AnyView", + "_wcs": {}, + "clicked_object": {}, + "coo_frame": "ICRS", + "layout": "IPY_MODEL_8d793245a2964d998909782edb6e45cd", + "overlay_survey": "", + "overlay_survey_opacity": 0.0, + "projection": "SIN", + "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", + "tabbable": null, + "tooltip": null } }, - "79a206c7d60d4f02a38b15f22b3f2116": { + "8d793245a2964d998909782edb6e45cd": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -433,7 +442,7 @@ "width": null } }, - "79e9e7a5d1cb4e6fa45c89d9abf0b512": { + "ae79b83b1ae64c9bbe15cfc19fd4e7ab": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -486,7 +495,111 @@ "width": null } }, - "7ce554df5a2c4426b8ca3086adffaf14": { + "b47afe22c8e7475bbcac386e1229ae72": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ToggleButtonsStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "ToggleButtonsStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "StyleView", + "button_width": "", + "description_width": "", + "font_weight": "" + } + }, + "b79f175200cb427591d9d543a08bb71f": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ToggleButtonsStyleModel", + "state": { + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "ToggleButtonsStyleModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "2.0.0", + "_view_name": "StyleView", + "button_width": "", + "description_width": "", + "font_weight": "" + } + }, + "bd8ce26ddf7a471395fb8d0120ae9e43": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ToggleButtonsModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "ToggleButtonsModel", + "_options_labels": [ + "P/DSS2/color", + "P/2MASS/color", + "P/DSS2/red", + "P/XMM/PN/color", + "P/GLIMPSE360" + ], + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": "ToggleButtonsView", + "button_style": "", + "description": "Overlay:", + "description_allow_html": false, + "disabled": false, + "icons": [], + "index": 0, + "layout": "IPY_MODEL_274a4a2692f44d2897816be798881c2a", + "style": "IPY_MODEL_b47afe22c8e7475bbcac386e1229ae72", + "tabbable": null, + "tooltip": null, + "tooltips": [ + "DSS2 color", + "2MASS color", + "DSS2 red", + "P/XMM/PN/color", + "P/GLIMPSE360" + ] + } + }, + "bdb02546f0cb4c5b9094f5f853644d25": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "FloatSliderModel", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/controls", + "_model_module_version": "2.0.0", + "_model_name": "FloatSliderModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/controls", + "_view_module_version": "2.0.0", + "_view_name": "FloatSliderView", + "behavior": "drag-tap", + "continuous_update": true, + "description": "Zoom:", + "description_allow_html": false, + "disabled": false, + "layout": "IPY_MODEL_0bc8943cc4364c2e8460aa8f9f177249", + "max": 400.0, + "min": 1.0, + "orientation": "horizontal", + "readout": false, + "readout_format": ".1f", + "step": 1.0, + "style": "IPY_MODEL_e2d28223fcb74ef5b67257470df4e516", + "tabbable": null, + "tooltip": null, + "value": 90.0 + } + }, + "c78317a07868412e8cb0ac145381f0b6": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -539,42 +652,33 @@ "width": null } }, - "8b408a4bcd7540eaae10549e219a11b0": { + "c8856af21dea42ecbf28185ef33105bc": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", - "model_name": "ToggleButtonsModel", + "model_name": "VBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", - "_model_name": "ToggleButtonsModel", - "_options_labels": [ - "P/DSS2/color", - "P/2MASS/color", - "P/DSS2/red" - ], + "_model_name": "VBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", - "_view_name": "ToggleButtonsView", - "button_style": "", - "description": "Image:", - "description_allow_html": false, - "disabled": false, - "icons": [], - "index": 0, - "layout": "IPY_MODEL_7ce554df5a2c4426b8ca3086adffaf14", - "style": "IPY_MODEL_33c0c8f6166c4fa8945cc8c533fd8a64", + "_view_name": "VBoxView", + "box_style": "", + "children": [ + "IPY_MODEL_839dd72fba5e4ffdaa96fd718d51e26b", + "IPY_MODEL_61a088b8ffae46a99564ef84d9e6784f", + "IPY_MODEL_bd8ce26ddf7a471395fb8d0120ae9e43", + "IPY_MODEL_d868b17e0067487c97dfe521a5caf769", + "IPY_MODEL_bdb02546f0cb4c5b9094f5f853644d25" + ], + "layout": "IPY_MODEL_ae79b83b1ae64c9bbe15cfc19fd4e7ab", "tabbable": null, - "tooltip": null, - "tooltips": [ - "DSS2 color", - "2MASS color", - "DSS2 red" - ] + "tooltip": null } }, - "8e9c36fed05d404ea8ced501926e34ef": { + "c9467b7efed34e71a2ed693660a8d589": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", @@ -627,7 +731,7 @@ "width": null } }, - "92213a552d0043b892c1bedf7335de29": { + "d868b17e0067487c97dfe521a5caf769": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "FloatSliderModel", @@ -645,20 +749,20 @@ "description": "Opacity:", "description_allow_html": false, "disabled": false, - "layout": "IPY_MODEL_79a206c7d60d4f02a38b15f22b3f2116", + "layout": "IPY_MODEL_c78317a07868412e8cb0ac145381f0b6", "max": 1.0, "min": 0.0, "orientation": "horizontal", "readout": false, "readout_format": ".1f", "step": 0.01, - "style": "IPY_MODEL_c305a6ec8b924729a37a55c2a5080524", + "style": "IPY_MODEL_ea4043ff68a642e49169c02592819178", "tabbable": null, "tooltip": null, "value": 0.0 } }, - "c305a6ec8b924729a37a55c2a5080524": { + "e2d28223fcb74ef5b67257470df4e516": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "SliderStyleModel", @@ -674,124 +778,20 @@ "handle_color": null } }, - "c77be6f2219240678272cbc0af02146f": { - "model_module": "anywidget", - "model_module_version": "~0.9.*", - "model_name": "AnyModel", - "state": { - "_anywidget_id": "ipyaladin.widget.Aladin", - "_base_layer_last_view": "https://alaskybis.unistra.fr/DSS/DSSColor", - "_css": ".cell-output-ipywidget-background{background:transparent}.jp-OutputArea-output,.aladin-widget{background-color:transparent}.aladin-widget .aladin-measurement-div{max-height:100px}\n", - "_dom_classes": [], - "_esm": "function _(n){n.charAt(0)===\"_\"&&(n=n.slice(1));let e=n.split(\"_\");for(let a=1;a{this.aladin.gotoRaDec(c,l),console.info(`FITS located at ra: ${c}, dec: ${l}`),URL.revokeObjectURL(o)});this.aladin.setOverlayImageLayer(d,s.name)}handleAddCatalogFromURL(e){let a=h(e.options||{});this.aladin.addCatalog(r.catalogFromURL(e.votable_URL,a))}handleAddMOCFromURL(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromURL(e.moc_URL,a))}handleAddMOCFromDict(e){let a=h(e.options||{});this.aladin.addMOC(r.MOCFromJSON(e.moc_dict,a))}handleAddOverlay(e){let a=e.regions_infos,s=h(e.graphic_options||{});s.color||(s.color=\"red\");let i=r.graphicOverlay(s);this.aladin.addOverlay(i);for(let t of a){let o=t.infos;switch(t.region_type){case\"stcs\":i.addFootprints(r.footprintsFromSTCS(o.stcs,t.options));break;case\"circle\":i.add(r.circle(o.ra,o.dec,o.radius,t.options));break;case\"ellipse\":i.add(r.ellipse(o.ra,o.dec,o.a,o.b,o.theta,t.options));break;case\"line\":t.options.lineWidth=t.options.lineWidth||3,i.add(r.vector(o.ra1,o.dec1,o.ra2,o.dec2,t.options));break;case\"polygon\":i.add(r.polygon(o.vertices,t.options));break}}}handleChangeColormap(e){this.aladin.getBaseImageLayer().setColormap(e.colormap)}handleGetJPGThumbnail(){this.aladin.exportAsPNG()}handleTriggerSelection(e){let a=e.selection_type;a===\"rectangle\"?a=\"rect\":a===\"polygon\"&&(a=\"poly\"),this.aladin.select(a)}handleAddTable(e,a){let s=h(e.options||{}),i=a[0].buffer,t=new TextDecoder(\"utf-8\"),o=new Blob([t.decode(i)]),d=URL.createObjectURL(o);r.catalogFromURL(d,Object.assign(s,{onClick:\"showTable\"}),c=>{this.aladin.addCatalog(c)},!1),URL.revokeObjectURL(d)}};var u=class{constructor(e,a,s){this.aladin=e,this.aladinDiv=a,this.model=s,this.messageHandler=new p(e,s),this.currentDivNumber=parseInt(a.id.split(\"-\").pop())}isLastDiv(){if(this.currentDivNumber===g)return!0;let e=g;for(let a=e;a>=0;a--){let s=document.getElementById(`aladin-lite-div-${a}`);if(s&&s.style.display!==\"none\"){e=a;break}}return f(e),this.currentDivNumber===e}updateWCS(){this.isLastDiv()&&this.model.set(\"_wcs\",this.aladin.getViewWCS())}update2AxisFoV(){if(!this.isLastDiv())return;let e=this.aladin.getFov();this.model.set(\"_fov_xy\",{x:e[0],y:e[1]})}subscribeAll(){let e=new m,a=new m;this.aladin.on(\"positionChanged\",t=>{if(a.locked){a.unlock();return}e.lock();let o=[t.ra,t.dec];this.updateWCS(),this.model.set(\"_target\",`${o[0]} ${o[1]}`),this.model.save_changes()}),this.model.on(\"change:_target\",()=>{if(e.locked){e.unlock();return}a.lock();let t=this.model.get(\"_target\"),[o,d]=t.split(\" \");this.aladin.gotoRaDec(o,d)});let s=new m,i=new m;this.aladin.on(\"zoomChanged\",t=>{if(i.locked){i.unlock();return}s.lock(),this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_fov\",parseFloat(t.toFixed(5))),this.model.save_changes()}),this.model.on(\"change:_fov\",()=>{if(s.locked){s.unlock();return}i.lock();let t=this.model.get(\"_fov\");this.aladin.setFoV(t)}),this.model.on(\"change:_height\",()=>{let t=this.model.get(\"_height\");this.aladinDiv.style.height=`${t}px`,this.updateWCS(),this.update2AxisFoV(),this.model.save_changes()}),this.aladin.on(\"cooFrameChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"projectionChanged\",()=>{this.updateWCS(),this.model.save_changes()}),this.aladin.on(\"layerChanged\",(t,o,d)=>{o===\"base\"&&this.model.set(\"_survey_body\",t.hipsBody||\"sky\"),!(o!==\"base\"||d!==\"ADDED\")&&(this.updateWCS(),this.model.set(\"_base_layer_last_view\",t.id),this.model.save_changes())}),this.aladin.on(\"resizeChanged\",(t,o)=>{if(t===1&&o===1){this.model.set(\"_is_reduced\",!0),this.model.save_changes();return}else this.model.set(\"_is_reduced\",!1);this.updateWCS(),this.update2AxisFoV(),this.model.set(\"_height\",o),this.model.save_changes()}),this.aladin.on(\"objectHovered\",t=>{t.data!==void 0&&this.model.send({event_type:\"object_hovered\",content:{ra:t.ra,dec:t.dec}})}),this.aladin.on(\"objectClicked\",t=>{if(t){let o={ra:t.ra,dec:t.dec};t.data!==void 0&&(o.data=t.data),this.model.set(\"clicked_object\",o),this.model.send({event_type:\"object_clicked\",content:o}),this.model.save_changes()}}),this.aladin.on(\"click\",t=>{this.model.send({event_type:\"click\",content:t})}),this.aladin.on(\"select\",t=>{let o=t.map(c=>c.map(l=>({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})));this.model.set(\"_selected_objects\",o),this.model.save_changes();let d=[];t.forEach(c=>{c.forEach(l=>{d.push({ra:l.ra,dec:l.dec,data:l.data,x:l.x,y:l.y})})}),this.model.send({event_type:\"select\",content:d})}),this.model.on(\"change:coo_frame\",()=>{this.aladin.setFrame(this.model.get(\"coo_frame\"))}),this.model.on(\"change:survey\",()=>{this.aladin.setImageSurvey(this.model.get(\"survey\"))}),this.model.on(\"change:overlay_survey\",()=>{this.aladin.setOverlayImageLayer(this.model.get(\"overlay_survey\"))}),this.model.on(\"change:overlay_survey_opacity\",()=>{this.aladin.getOverlayImageLayer().setAlpha(this.model.get(\"overlay_survey_opacity\"))}),this.eventHandlers={add_marker:this.messageHandler.handleAddMarker,change_fov:this.messageHandler.handleChangeFoV,goto_ra_dec:this.messageHandler.handleGotoRaDec,save_view_as_image:this.messageHandler.handleSaveViewAsImage,add_fits:this.messageHandler.handleAddFits,add_catalog_from_URL:this.messageHandler.handleAddCatalogFromURL,add_MOC_from_URL:this.messageHandler.handleAddMOCFromURL,add_MOC_from_dict:this.messageHandler.handleAddMOCFromDict,add_overlay:this.messageHandler.handleAddOverlay,change_colormap:this.messageHandler.handleChangeColormap,get_JPG_thumbnail:this.messageHandler.handleGetJPGThumbnail,trigger_selection:this.messageHandler.handleTriggerSelection,add_table:this.messageHandler.handleAddTable},this.model.on(\"msg:custom\",(t,o)=>{let d=t.event_name,c=this.eventHandlers[d];if(c)c.call(this,t,o);else throw new Error(`Unknown event name: ${d}`)})}unsubscribeAll(){this.model.off(\"change:_target\"),this.model.off(\"change:_fov\"),this.model.off(\"change:_height\"),this.model.off(\"change:coo_frame\"),this.model.off(\"change:survey\"),this.model.off(\"change:overlay_survey\"),this.model.off(\"change:overlay_survey_opacity\"),this.model.off(\"change:trigger_event\"),this.model.off(\"msg:custom\")}};function b(n,e){f(g+1);let a=n.get(\"_init_options\"),s={};for(let l in a)s[_(l)]=a[l];let i=document.createElement(\"div\");i.classList.add(\"aladin-widget\"),i.style.height=`${n.get(\"_height\")}px`,i.id=`aladin-lite-div-${g}`;let t=new r.aladin(i,s);e.appendChild(i);let o=n.get(\"_target\").split(\" \");t.gotoRaDec(o[0],o[1]);let d={...t.getFov()};n.set(\"_fov_xy\",{x:d[0],y:d[1]});let c={...t.getViewWCS()};return n.set(\"_wcs\",c),n.set(\"_is_loaded\",!0),n.save_changes(),{aladin:t,aladinDiv:i}}async function C({model:n}){await r.init}function k({model:n,el:e}){let{aladin:a,aladinDiv:s}=b(n,e),i=new u(a,s,n);return i.subscribeAll(),()=>{i.unsubscribeAll()}}var I={initialize:C,render:k};export{I as default};\n", - "_fov": 2.0, - "_fov_xy": {}, - "_height": 400, - "_init_options": { - "fov": 2, - "show_context_menu": true, - "show_coo_grid_control": true, - "show_settings_control": true, - "show_simbad_pointer_control": true, - "target": "orion" - }, - "_is_loaded": false, - "_is_reduced": false, - "_model_module": "anywidget", - "_model_module_version": "~0.9.*", - "_model_name": "AnyModel", - "_ready": false, - "_selected_objects": [], - "_survey_body": "sky", - "_target": "83.82 -5.39", - "_view_count": null, - "_view_module": "anywidget", - "_view_module_version": "~0.9.*", - "_view_name": "AnyView", - "_wcs": {}, - "clicked_object": {}, - "coo_frame": "ICRS", - "layout": "IPY_MODEL_79e9e7a5d1cb4e6fa45c89d9abf0b512", - "overlay_survey": "", - "overlay_survey_opacity": 0.0, - "projection": "SIN", - "survey": "https://alaskybis.unistra.fr/DSS/DSSColor", - "tabbable": null, - "tooltip": null - } - }, - "c9da8a93e92b485e97feb62b123ec5eb": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "FloatSliderModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "FloatSliderModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "2.0.0", - "_view_name": "FloatSliderView", - "behavior": "drag-tap", - "continuous_update": true, - "description": "Zoom:", - "description_allow_html": false, - "disabled": false, - "layout": "IPY_MODEL_8e9c36fed05d404ea8ced501926e34ef", - "max": 400.0, - "min": 1.0, - "orientation": "horizontal", - "readout": false, - "readout_format": ".1f", - "step": 1.0, - "style": "IPY_MODEL_76d1dfce78684c298cab38ac7ba9fd77", - "tabbable": null, - "tooltip": null, - "value": 90.0 - } - }, - "ddf32155b18e42998e9296112f9cb427": { + "ea4043ff68a642e49169c02592819178": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", - "model_name": "VBoxModel", - "state": { - "_dom_classes": [], - "_model_module": "@jupyter-widgets/controls", - "_model_module_version": "2.0.0", - "_model_name": "VBoxModel", - "_view_count": null, - "_view_module": "@jupyter-widgets/controls", - "_view_module_version": "2.0.0", - "_view_name": "VBoxView", - "box_style": "", - "children": [ - "IPY_MODEL_c77be6f2219240678272cbc0af02146f", - "IPY_MODEL_8b408a4bcd7540eaae10549e219a11b0", - "IPY_MODEL_042ebc4bbdd24465bdf2562bd672e296", - "IPY_MODEL_92213a552d0043b892c1bedf7335de29", - "IPY_MODEL_c9da8a93e92b485e97feb62b123ec5eb" - ], - "layout": "IPY_MODEL_3af9b9d40e624f028f3604e37862b9ae", - "tabbable": null, - "tooltip": null - } - }, - "eb4a185467734ce6bbeaf2225e8e554d": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "ToggleButtonsStyleModel", + "model_name": "SliderStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", - "_model_name": "ToggleButtonsStyleModel", + "_model_name": "SliderStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", - "button_width": "", "description_width": "", - "font_weight": "" + "handle_color": null } } }, diff --git a/_collections/notebooks/11_Extracting_information_from_the_view.html b/_collections/notebooks/11_Extracting_information_from_the_view.html index b84f0a7..de470cf 100644 --- a/_collections/notebooks/11_Extracting_information_from_the_view.html +++ b/_collections/notebooks/11_Extracting_information_from_the_view.html @@ -8,7 +8,7 @@ - Retrieving data from the current widget’s view — ipyaladin 0.5.0 documentation + Retrieving data from the current widget’s view — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + diff --git a/_collections/notebooks/12_Planetary_surveys.html b/_collections/notebooks/12_Planetary_surveys.html index dc84574..862e8e2 100644 --- a/_collections/notebooks/12_Planetary_surveys.html +++ b/_collections/notebooks/12_Planetary_surveys.html @@ -8,7 +8,7 @@ - Planetary surveys — ipyaladin 0.5.0 documentation + Planetary surveys — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + diff --git a/_modules/index.html b/_modules/index.html index 3bd3e0d..45210be 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -7,7 +7,7 @@ - Overview: module code — ipyaladin 0.5.0 documentation + Overview: module code — ipyaladin 0.5.1 documentation @@ -37,7 +37,7 @@ - + diff --git a/_modules/ipyaladin/widget.html b/_modules/ipyaladin/widget.html index 4bf190f..bb789ff 100644 --- a/_modules/ipyaladin/widget.html +++ b/_modules/ipyaladin/widget.html @@ -7,7 +7,7 @@ - ipyaladin.widget — ipyaladin 0.5.0 documentation + ipyaladin.widget — ipyaladin 0.5.1 documentation @@ -37,7 +37,7 @@ - + @@ -702,13 +702,16 @@

Source code for ipyaladin.widget

 
[docs] def height(self) -> int: - """The height of the Aladin Lite widget. + """The height of the widget. Returns ------- int The height of the widget in pixels. - + Setting the height to -1 will expand the widget at 100% height of its + container. This is generally a bad idea in a notebook but can be usefull + for dashbord applications. + The default height is 400 pixels. """ return self._height
@@ -1166,7 +1169,8 @@

Source code for ipyaladin.widget

         """
         warnings.warn(
             "add_moc_from_URL is replaced by add_moc that detects automatically"
-            "that the MOC was given as an URL.",
+            "that the MOC was given as an URL."
+            "This will be removed in version 1.0.0 (coming afer 0.5.1).",
             DeprecationWarning,
             stacklevel=2,
         )
@@ -1195,7 +1199,8 @@ 

Source code for ipyaladin.widget

         """
         warnings.warn(
             "add_moc_from_dict is replaced by add_moc that detects automatically"
-            "that the MOC was given as a dictionary.",
+            "that the MOC was given as a dictionary."
+            "This will be removed in version 1.0.0 (coming afer 0.5.1).",
             DeprecationWarning,
             stacklevel=2,
         )
@@ -1335,7 +1340,8 @@ 

Source code for ipyaladin.widget

         """
         warnings.warn(
             "'add_overlay_from_stcs' is deprecated, "
-            "use 'add_graphic_overlay_from_stcs' instead",
+            "use 'add_graphic_overlay_from_stcs' instead. "
+            "This will be removed in version 1.0.0 (coming afer 0.5.1).",
             DeprecationWarning,
             stacklevel=2,
         )
@@ -1427,7 +1433,8 @@ 

Source code for ipyaladin.widget

         This method is deprecated, use selection instead
         """
         warnings.warn(
-            "rectangular_selection is deprecated, use selection('rectangle') instead",
+            "rectangular_selection is deprecated, use selection('rectangle') instead"
+            "This will be removed in version 1.0.0 (coming afer 0.5.1).",
             DeprecationWarning,
             stacklevel=2,
         )
@@ -1486,7 +1493,8 @@ 

Source code for ipyaladin.widget

 
         """
         warnings.warn(
-            "add_listener is deprecated, use set_listener instead",
+            "add_listener is deprecated, use set_listener instead"
+            "This will be removed in version 1.0.0 (coming afer 0.5.1).",
             DeprecationWarning,
             stacklevel=2,
         )
diff --git a/_sources/_collections/notebooks/01_Getting_Started.ipynb.txt b/_sources/_collections/notebooks/01_Getting_Started.ipynb.txt
index c1d4209..a698e51 100644
--- a/_sources/_collections/notebooks/01_Getting_Started.ipynb.txt
+++ b/_sources/_collections/notebooks/01_Getting_Started.ipynb.txt
@@ -42,7 +42,7 @@
    ],
    "source": [
     "aladin = Aladin(\n",
-    "    survey=\"http://alasky.cds.unistra.fr/DECaPS/DR1/color/\",\n",
+    "    survey=\"CDS/P/DECaPS/DR1/color\",\n",
     "    show_coo_grid=True,\n",
     "    target=\"galactic center\",\n",
     "    coo_frame=\"galactic\",\n",
diff --git a/_sources/autoapi/ipyaladin/widget/index.rst.txt b/_sources/autoapi/ipyaladin/widget/index.rst.txt
index 222bef7..f89d3b5 100644
--- a/_sources/autoapi/ipyaladin/widget/index.rst.txt
+++ b/_sources/autoapi/ipyaladin/widget/index.rst.txt
@@ -95,7 +95,7 @@ Module Contents
       :type: int
 
       
-      The height of the Aladin Lite widget.
+      The height of the widget.
 
 
 
@@ -105,6 +105,10 @@ Module Contents
 
           int
               The height of the widget in pixels.
+              Setting the height to -1 will expand the widget at 100% height of its
+              container. This is generally a bad idea in a notebook but can be usefull
+              for dashbord applications.
+              The default height is 400 pixels.
 
 
 
diff --git a/_static/documentation_options.js b/_static/documentation_options.js
index 240446d..492efc9 100644
--- a/_static/documentation_options.js
+++ b/_static/documentation_options.js
@@ -1,5 +1,5 @@
 const DOCUMENTATION_OPTIONS = {
-    VERSION: '0.5.0',
+    VERSION: '0.5.1',
     LANGUAGE: 'en',
     COLLAPSE_INDEX: false,
     BUILDER: 'html',
diff --git a/autoapi/index.html b/autoapi/index.html
index 25f2c56..e2928ff 100644
--- a/autoapi/index.html
+++ b/autoapi/index.html
@@ -8,7 +8,7 @@
     
     
 
-    API Reference — ipyaladin 0.5.0 documentation
+    API Reference — ipyaladin 0.5.1 documentation
   
   
   
@@ -38,7 +38,7 @@
 
   
 
-    
+    
     
     
     
diff --git a/autoapi/ipyaladin/index.html b/autoapi/ipyaladin/index.html
index 857d043..53a4813 100644
--- a/autoapi/ipyaladin/index.html
+++ b/autoapi/ipyaladin/index.html
@@ -8,7 +8,7 @@
     
     
 
-    ipyaladin — ipyaladin 0.5.0 documentation
+    ipyaladin — ipyaladin 0.5.1 documentation
   
   
   
@@ -38,7 +38,7 @@
 
   
 
-    
+    
     
     
     
diff --git a/autoapi/ipyaladin/widget/index.html b/autoapi/ipyaladin/widget/index.html
index 3e84f35..b1e696c 100644
--- a/autoapi/ipyaladin/widget/index.html
+++ b/autoapi/ipyaladin/widget/index.html
@@ -8,7 +8,7 @@
     
     
 
-    ipyaladin.widget — ipyaladin 0.5.0 documentation
+    ipyaladin.widget — ipyaladin 0.5.1 documentation
   
   
   
@@ -38,7 +38,7 @@
 
   
 
-    
+    
     
     
     
@@ -507,11 +507,15 @@ 

Module Contents
property height: int[source]#
-

The height of the Aladin Lite widget.

+

The height of the widget.

Returns:
-
int

The height of the widget in pixels.

+
int

The height of the widget in pixels. +Setting the height to -1 will expand the widget at 100% height of its +container. This is generally a bad idea in a notebook but can be usefull +for dashbord applications. +The default height is 400 pixels.

diff --git a/community/community.html b/community/community.html index b4775d4..88f6f39 100644 --- a/community/community.html +++ b/community/community.html @@ -8,7 +8,7 @@ - Community — ipyaladin 0.5.0 documentation + Community — ipyaladin 0.5.1 documentation @@ -38,7 +38,7 @@ - + diff --git a/genindex.html b/genindex.html index 9733482..8928b90 100644 --- a/genindex.html +++ b/genindex.html @@ -7,7 +7,7 @@ - Index — ipyaladin 0.5.0 documentation + Index — ipyaladin 0.5.1 documentation @@ -37,7 +37,7 @@ - + diff --git a/getting_started/getting_started.html b/getting_started/getting_started.html index 1e28226..fea637a 100644 --- a/getting_started/getting_started.html +++ b/getting_started/getting_started.html @@ -8,7 +8,7 @@ - Getting Started — ipyaladin 0.5.0 documentation + Getting Started — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + diff --git a/index.html b/index.html index 0d3eb67..63f8d38 100644 --- a/index.html +++ b/index.html @@ -9,7 +9,7 @@ - The ipyaladin jupyter widget — ipyaladin 0.5.0 documentation + The ipyaladin jupyter widget — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - + diff --git a/py-modindex.html b/py-modindex.html index 98b5a06..adc184e 100644 --- a/py-modindex.html +++ b/py-modindex.html @@ -7,7 +7,7 @@ - Python Module Index — ipyaladin 0.5.0 documentation + Python Module Index — ipyaladin 0.5.1 documentation @@ -37,7 +37,7 @@ - + diff --git a/search.html b/search.html index 051cdbc..87daed8 100644 --- a/search.html +++ b/search.html @@ -6,7 +6,7 @@ - Search - ipyaladin 0.5.0 documentation + Search - ipyaladin 0.5.1 documentation @@ -36,7 +36,7 @@ - + diff --git a/searchindex.js b/searchindex.js index 2b8433d..aae980c 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"1. Detaching the widget from the notebook and keeping it on the side of the notebook": [[18, "detaching-the-widget-from-the-notebook-and-keeping-it-on-the-side-of-the-notebook"]], "2. Disabling the optimization in the notebook parameters": [[18, "disabling-the-optimization-in-the-notebook-parameters"]], "API": [[17, "api"]], "API Reference": [[12, null]], "Add shapes from Space-Time Coordinates (STC)": [[8, "Add-shapes-from-Space-Time-Coordinates-(STC)"]], "Add shapes from astropy-regions objects": [[8, "Add-shapes-from-astropy-regions-objects"]], "Adding elements to the widget": [[18, "adding-elements-to-the-widget"]], "Adding shapes / graphic overlays": [[8, null]], "Advanced GUI": [[9, null]], "Advanced use": [[18, "advanced-use"]], "Aladin commands": [[1, null]], "Built-in methods": [[2, "Built-in-methods"]], "Check that the documentation still builds": [[15, "check-that-the-documentation-still-builds"]], "Classes": [[14, "classes"]], "Community": [[15, null]], "Contribution guide": [[17, "contribution-guide"]], "Contributions": [[15, "contributions"]], "Correspondence between options": [[14, "id5"]], "Development installation": [[15, "development-installation"]], "Display Astropy table created from scratch": [[3, "Display-Astropy-table-created-from-scratch"]], "Display of a Multi Order Coverage (MOC)": [[4, null]], "Display tables resulting from an astroquery request": [[3, null]], "Example of interactive rectangular selection": [[7, null]], "From a dictionnary": [[4, "From-a-dictionnary"]], "From a mocpy object": [[4, "From-a-mocpy-object"]], "From a query": [[3, "From-a-query"]], "From an URL": [[4, "From-an-URL"]], "Functions": [[14, "functions"]], "Getting Started": [[0, null], [16, null]], "Getting the current WCS": [[10, "Getting-the-current-WCS"]], "Getting the field of view": [[10, "Getting-the-field-of-view"]], "Getting the selection": [[10, "Getting-the-selection"]], "Getting the view as a fits file": [[10, "Getting-the-view-as-a-fits-file"]], "Home-made functions": [[2, "Home-made-functions"]], "How does it work": [[15, "how-does-it-work"]], "Initialization options": [[18, "id1"]], "Initialization options for the widget": [[18, "initialization-options-for-the-widget"]], "Installation": [[16, "installation"]], "Javascript tests": [[15, "javascript-tests"]], "Linked widgets": [[5, null]], "Module Contents": [[14, "module-contents"]], "Note about the WCS": [[18, "note-about-the-wcs"]], "On click callback": [[6, null]], "Planetary surveys": [[11, null]], "Python tests": [[15, "python-tests"]], "Released versions": [[16, "released-versions"]], "Retrieving data from the current widget\u2019s view": [[10, null]], "Retrieving information from the current widget view": [[18, "retrieving-information-from-the-current-widget-view"]], "Running the tests": [[15, "running-the-tests"]], "Saving the view as an image file": [[10, "Saving-the-view-as-an-image-file"]], "Setting the view\u2019s parameters": [[18, "setting-the-view-s-parameters"]], "Submodules": [[13, "submodules"]], "Surveys of Earth": [[11, "Surveys-of-Earth"]], "The ipyaladin jupyter widget": [[17, null]], "Unreleased version": [[16, "unreleased-version"]], "Use of functions on ipyaladin widgets": [[2, null]], "User Documentation": [[17, "user-documentation"], [18, null]], "User Guide": [[17, "user-guide"]], "Using the widget": [[16, "using-the-widget"]], "ipyaladin": [[13, null]], "ipyaladin.widget": [[14, null]]}, "docnames": ["_collections/notebooks/01_Getting_Started", "_collections/notebooks/02_Base_Commands", "_collections/notebooks/03_Functions", "_collections/notebooks/04_Importing_Tables", "_collections/notebooks/05_Display_a_MOC", "_collections/notebooks/06_Linked-widgets", "_collections/notebooks/07_on-click-callback", "_collections/notebooks/08_Rectangular-selection", "_collections/notebooks/09_Displaying_Shapes", "_collections/notebooks/10_Advanced-GUI", "_collections/notebooks/11_Extracting_information_from_the_view", "_collections/notebooks/12_Planetary_surveys", "autoapi/index", "autoapi/ipyaladin/index", "autoapi/ipyaladin/widget/index", "community/community", "getting_started/getting_started", "index", "user_documentation/user_documentation"], "envversion": {"nbsphinx": 4, "sphinx": 63, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.viewcode": 1}, "filenames": ["_collections/notebooks/01_Getting_Started.ipynb", "_collections/notebooks/02_Base_Commands.ipynb", "_collections/notebooks/03_Functions.ipynb", "_collections/notebooks/04_Importing_Tables.ipynb", "_collections/notebooks/05_Display_a_MOC.ipynb", "_collections/notebooks/06_Linked-widgets.ipynb", "_collections/notebooks/07_on-click-callback.ipynb", "_collections/notebooks/08_Rectangular-selection.ipynb", "_collections/notebooks/09_Displaying_Shapes.ipynb", "_collections/notebooks/10_Advanced-GUI.ipynb", "_collections/notebooks/11_Extracting_information_from_the_view.ipynb", "_collections/notebooks/12_Planetary_surveys.ipynb", "autoapi/index.rst", "autoapi/ipyaladin/index.rst", "autoapi/ipyaladin/widget/index.rst", "community/community.md", "getting_started/getting_started.rst", "index.md", "user_documentation/user_documentation.rst"], "indexentries": {"add_catalog_from_url() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_catalog_from_URL", false]], "add_fits() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_fits", false]], "add_graphic_overlay_from_region() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_graphic_overlay_from_region", false]], "add_graphic_overlay_from_stcs() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_graphic_overlay_from_stcs", false]], "add_listener() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_listener", false]], "add_markers() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_markers", false]], "add_moc() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_moc", false]], "add_moc_from_dict() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_moc_from_dict", false]], "add_moc_from_url() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_moc_from_URL", false]], "add_overlay_from_stcs() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_overlay_from_stcs", false]], "add_table() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_table", false]], "aladin (class in ipyaladin.widget)": [[14, "ipyaladin.widget.Aladin", false]], "fov (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.fov", false]], "fov_xy (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.fov_xy", false]], "get_jpeg_thumbnail() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.get_JPEG_thumbnail", false]], "get_view_as_fits() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.get_view_as_fits", false]], "height (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.height", false]], "ipyaladin": [[13, "module-ipyaladin", false]], "ipyaladin.widget": [[14, "module-ipyaladin.widget", false]], "module": [[13, "module-ipyaladin", false], [14, "module-ipyaladin.widget", false]], "rectangular_selection() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.rectangular_selection", false]], "save_view_as_image() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.save_view_as_image", false]], "selected_objects (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.selected_objects", false]], "selection() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.selection", false]], "set_color_map() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.set_color_map", false]], "set_listener() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.set_listener", false]], "target (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.target", false]], "wcs (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.wcs", false]], "widget_should_be_loaded() (in module ipyaladin.widget)": [[14, "ipyaladin.widget.widget_should_be_loaded", false]]}, "objects": {"": [[13, 0, 0, "-", "ipyaladin"]], "ipyaladin": [[14, 0, 0, "-", "widget"]], "ipyaladin.widget": [[14, 1, 1, "", "Aladin"], [14, 4, 1, "", "widget_should_be_loaded"]], "ipyaladin.widget.Aladin": [[14, 2, 1, "", "add_catalog_from_URL"], [14, 2, 1, "", "add_fits"], [14, 2, 1, "", "add_graphic_overlay_from_region"], [14, 2, 1, "", "add_graphic_overlay_from_stcs"], [14, 2, 1, "", "add_listener"], [14, 2, 1, "", "add_markers"], [14, 2, 1, "", "add_moc"], [14, 2, 1, "", "add_moc_from_URL"], [14, 2, 1, "", "add_moc_from_dict"], [14, 2, 1, "", "add_overlay_from_stcs"], [14, 2, 1, "", "add_table"], [14, 3, 1, "", "fov"], [14, 3, 1, "", "fov_xy"], [14, 2, 1, "", "get_JPEG_thumbnail"], [14, 2, 1, "", "get_view_as_fits"], [14, 3, 1, "", "height"], [14, 2, 1, "", "rectangular_selection"], [14, 2, 1, "", "save_view_as_image"], [14, 3, 1, "", "selected_objects"], [14, 2, 1, "", "selection"], [14, 2, 1, "", "set_color_map"], [14, 2, 1, "", "set_listener"], [14, 3, 1, "", "target"], [14, 3, 1, "", "wcs"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "property", "Python property"], "4": ["py", "function", "Python function"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:property", "4": "py:function"}, "terms": {"": [1, 2, 3, 6, 7, 8, 11, 14, 17], "0": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18], "00": 3, "00000001": 9, "0000er1995aujph": 3, "00010000": 3, "00018500": 3, "00060": 3, "0009000": 3, "00090ci2003ycat": 3, "00090dr1998aj": 3, "00090em2008apj": 3, "001": 10, "0011111": 3, "00226": 8, "00227": 8, "00782497": 1, "00814140": 3, "01": [3, 9], "0133": 3, "02": [3, 4, 11], "02990ao2020ycat": 3, "03": 3, "03742777": 4, "0380": 3, "04": 8, "044": 3, "05": [3, 10], "05652591227": 3, "06190ao2020ycat": 3, "06490ao2020ycat": 3, "06660": 3, "07": 3, "070": 3, "0730": 3, "07630": 8, "07633": 8, "0790": 3, "08518": 8, "0c1": 3, "0d1": 3, "0di2011apj": 3, "0ds2019mnra": 3, "0e2022apj": 3, "0ef2016mnra": 3, "0eg2019apj": 3, "0g1": 3, "0x7f48888f4a40": 8, "1": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 17], "10": [1, 2, 4, 6, 8, 11], "100": [3, 5, 6, 7, 11], "102": 4, "10321": 4, "10323": 4, "10332": 4, "10333": 4, "10334": 4, "10356": 4, "10358": 4, "10364": 4, "10366": 4, "10445": 4, "10447": 4, "10469": 4, "10477": 4, "10479": 4, "105": 3, "10821": 4, "10823": 4, "10878": 4, "10960": 4, "10961": 4, "10963": 4, "10964": 4, "10966": 4, "10969": 4, "10971": 4, "10972": 4, "10974": 4, "10975": 4, "11": 1, "11004": 4, "11005": 4, "11007": 4, "1101": 4, "11176": 4, "11178": 4, "1118": 4, "112": [4, 11], "113": 4, "11370": 4, "11373": 4, "11405": 4, "11406": 4, "11407": 4, "11410": 4, "11411": 4, "11412": 4, "11413": 4, "11414": 4, "11416": 4, "11425": 4, "11426": 4, "11427": 4, "11428": 4, "11432": 4, "115": 3, "116": 4, "117": [4, 11], "1177": 3, "12": [1, 2, 3, 11, 14], "1200": 8, "12018": 8, "12286": 8, "123y1": 3, "12490ao2020ycat": 3, "12904": 8, "12h00m00": 1, "13": [1, 11, 14], "135": 4, "1350": 3, "14": [4, 14], "140": 3, "143s1": 3, "147": 11, "1470": 4, "1490": 3, "15": [1, 4, 11], "150": [4, 6], "151": 4, "152": 4, "153": 4, "15314140": 3, "156": 4, "157": 4, "159": 11, "16": 4, "1600": 4, "1638": 4, "1693c1": 3, "175": 3, "1751": 4, "1755": 4, "1756": 4, "1757": 4, "1758": 4, "1766": 4, "1767": 4, "1769": 4, "1770": 4, "1771": 4, "1772": 4, "1773": 4, "1776": 4, "1777": [3, 4], "1778": 4, "178": 18, "18": 11, "180": [2, 9], "1811": 4, "1817": 4, "1818": 4, "1831": [3, 4], "1835": 4, "1836": 4, "1838": 4, "1840": 4, "19": 11, "1920": 4, "1921": 4, "1922": 4, "194": [3, 4], "195": 4, "19710": 8, "198": 4, "199": 4, "1993": 3, "1999842": 8, "1f": 9, "2": [0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 14, 17], "20": [1, 3, 4, 10, 18], "200": [4, 6], "201": 4, "2018": 11, "202": 8, "203": 4, "20325": 8, "205": 3, "20596": 8, "20597": 8, "21": [3, 11, 14], "210": 4, "2135528": 11, "2195": 3, "22": 3, "220": 3, "220001005": 3, "22004505": 3, "220048605": 3, "220056005": 3, "220122205": 3, "2201i05": 3, "2201s05": 3, "22020705": 3, "2246": 3, "226": 11, "23": [2, 14], "231": 4, "23391": 8, "23395": 8, "23398": 8, "24063": 8, "24302": 8, "24414140": 3, "24949": 8, "24951": 8, "25": [8, 11, 14], "250": 11, "256": 4, "2581": 4, "2582": 4, "2588": 4, "2590": 4, "26": 4, "260": 3, "2612": 4, "2614": 4, "2620": 4, "2622": 4, "266": 1, "2669000": 3, "269": 2, "2708": 4, "2710": 4, "2716": 4, "2718": 4, "2749": 4, "277d1": 3, "28": 3, "280": 11, "2805": 3, "284": 10, "2895e1": 3, "29": 1, "298": 11, "2mass": [3, 5, 9], "3": [1, 2, 3, 4, 5, 6, 8, 10], "30": [3, 11], "30d00m00": 1, "30l1": 3, "31": 3, "316": 11, "31746": 8, "32": [3, 4, 11], "32391": 8, "32632": 8, "33": [4, 5], "34": 3, "3403817661471500416": 3, "3403817936349408000": 3, "3403818589184411648": 3, "34273": 8, "344": 3, "34527": 8, "34529": 8, "350": 11, "35192": 8, "36": [3, 4, 6], "36069": 8, "3619c1": 3, "36955": 8, "36958": 8, "37": 3, "3735": 3, "378": 4, "379": 4, "38": 3, "3805": 3, "382": 4, "383": 4, "387": 4, "39": 1, "390": 4, "391": 4, "3fgl": 3, "4": [1, 2, 3, 4, 6, 8, 11, 14], "40": [0, 11], "400": 9, "402": 4, "403": 4, "406": 4, "407": 4, "40715": 8, "40721": 8, "412": 4, "413": 4, "41640": 8, "41681662": 1, "4188": 4, "4189": 4, "42": [4, 11], "43": 4, "4363": 4, "4366": 4, "4367": 4, "4389": 4, "4400": 4, "4401": 4, "44415": 8, "44416": 8, "4450": 4, "4451": 4, "4454": 4, "4456": 4, "4457": 4, "4460": 4, "4461": 4, "4463": 4, "4476": 4, "4478": 4, "4479": 4, "4488ee": 8, "45": [8, 11], "45459": 8, "455510000": 3, "456": 4, "4561": 4, "4564": 4, "4565": 4, "45683": 8, "457": 4, "458": 3, "46": 11, "460": 4, "461": 4, "46379": 8, "46382": 8, "4656816": 8, "47": 8, "472": 4, "48": 3, "485": 3, "4877": 3, "49": 11, "4905": 3, "4sgr": 2, "5": [1, 2, 3, 4, 6, 8, 10, 11, 18], "50": [7, 10, 18], "51": [4, 8], "5112": 3, "51870": 8, "52": 3, "52539": 8, "52540": 8, "52789": 8, "52791": 8, "53": 11, "534": 4, "535518500": 3, "53a1": 3, "54": [3, 4], "55": [3, 4], "56": 3, "5655": 3, "56666": 8, "57": [4, 11], "57585": 8, "57592": 8, "58": 11, "5855583": 4, "58780251600": 3, "59": [3, 11], "5955": 3, "6": [1, 2, 3, 8], "60": 18, "600": [0, 10], "61368056017": 3, "6229": 4, "6241989": 11, "63051": 8, "63451584700": 3, "63746": 8, "63748": 8, "63749": 8, "63970": 8, "64": [1, 3], "6408": 4, "6409": 4, "6411": 4, "6412": 4, "6414": 4, "6433": 4, "6436": 4, "6438": 4, "6439": 4, "6444": 4, "6445": 4, "6447": 4, "65": 11, "6533": 4, "6544": 4, "6546": 4, "6577": 4, "6579": 4, "6582": 4, "6588": 4, "6590": 4, "6591": 4, "67d38d": 11, "69214140": 3, "6933": 4, "6935": 4, "6984": 4, "6986": 4, "7": [1, 2, 8, 11], "70": [6, 11], "7008": 4, "7011": 4, "7017": 4, "74": 4, "744": 3, "74977": 8, "74978": 8, "74982": 8, "7605": 3, "7703": 3, "7705": 3, "7805": 3, "79": 11, "7905": 3, "8": [1, 2], "800": 10, "81": 5, "823863": 2, "83": 3, "86d6ae": 18, "87": 11, "875": 3, "9": [1, 3, 11], "90": [3, 8], "900": 8, "944": 3, "9474": 3, "956288": 2, "97517807639": 3, "98": 4, "99": 4, "99277764451": 3, "9999": 2, "A": [1, 14, 16], "And": [8, 10], "As": 18, "BY": 6, "Be": 6, "For": [8, 10, 14], "If": [8, 10, 14, 15], "In": [17, 18], "It": [2, 7, 10, 11, 14, 18], "No": 8, "On": 17, "The": [1, 2, 6, 7, 8, 9, 10, 11, 14, 15, 18], "Then": [10, 15, 16], "There": [8, 15], "These": [10, 18], "To": [15, 16, 18], "With": 11, "_": [2, 7], "__": 8, "_fov": 5, "_raj": 2, "_target": 5, "abc": 14, "abl": 7, "about": [10, 17], "accept": 15, "actual": 10, "ad": 17, "add": [1, 2, 11, 14, 15, 17], "add_catalog_from_url": [2, 14], "add_fit": [1, 14], "add_graphic_overlay_from_region": [8, 14], "add_graphic_overlay_from_stc": [8, 14], "add_listen": 14, "add_mark": [1, 14], "add_moc": [4, 14], "add_moc_from_dict": 14, "add_moc_from_url": 14, "add_overlay_from_stc": 14, "add_tabl": [3, 7, 10, 11, 14], "addit": 3, "adql": 6, "advanc": 17, "affect": 15, "after": [2, 6, 10], "again": 15, "al": 11, "aladin": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18], "aladin_bi": 2, "aladinlit": 14, "alaski": [0, 4, 11], "alba": 11, "align_item": [5, 6, 7], "all": [6, 7, 14, 15, 16], "allow": [10, 14, 18], "allwis": 1, "along": 14, "alpha": 14, "also": [1, 2, 3, 8, 10, 11, 14, 18], "alwai": [1, 10], "an": [0, 1, 2, 11, 14, 15, 16, 17], "angl": [1, 8, 14], "ani": [7, 11, 14, 15], "anymor": 11, "anyth": 14, "anywher": 6, "anywidget": 15, "api": 15, "appear": [6, 14, 16], "append": 1, "appli": [2, 15], "applic": [2, 15], "ar": [1, 6, 8, 10, 11, 14, 15, 18], "arabia": 11, "arg": 14, "argument": [10, 14, 18], "argyr": 11, "around": 14, "asc": 6, "asinh": 10, "associ": 6, "astronom": [14, 15], "astropi": [1, 4, 7, 10, 11, 14, 17], "astroqueri": [7, 10, 14, 17], "attempt": 15, "auto": [7, 12], "autoapi": 12, "avail": 18, "ax": [8, 14], "axi": [1, 10, 14], "b": 5, "background_color": 18, "bar": [14, 18], "base": [1, 14], "basic": [1, 6], "basin": 11, "becaus": 10, "been": [7, 15], "befor": 15, "behind": 18, "below": [7, 16], "between": [5, 8, 10, 15, 18], "bin": [2, 6], "binary_r": 10, "bit": [10, 16], "blue": 8, "bodi": 14, "bool": 14, "boolean": 10, "border": [5, 7], "boreali": 11, "bottom": [10, 14], "box": [5, 6, 7], "box_layout": [5, 6, 7], "br": 6, "bring": [17, 18], "browser": 14, "bug": 15, "build": 17, "built": 17, "button": [7, 10, 18], "c": [2, 5, 16], "calcul": [10, 18], "call": [10, 14], "callabl": 14, "callback": [7, 9, 14, 17], "camelcas": 3, "can": [1, 2, 5, 8, 9, 10, 11, 14, 15, 16, 17, 18], "cannot": 18, "card": 8, "case": [10, 15, 18], "catalog": [10, 14, 18], "catalog_opt": 14, "caus": 18, "cd": [0, 1, 10, 11, 14, 15], "cdsportal": 6, "cell": [1, 6, 7, 10, 14, 16, 18], "center": [0, 8, 11], "centr": 15, "cgi": 6, "chang": [1, 9, 11, 14, 15], "channel": 11, "check": [14, 17], "children": [5, 6, 7], "choic": 1, "chose": 18, "circ00": 1, "circl": [6, 8, 10, 14], "circleskyregion": [8, 14], "cite": 15, "class": 18, "clean": 15, "click": [2, 7, 10, 14, 17, 18], "clicked_object": 2, "clone": 15, "close": 16, "closest": 6, "cm": 3, "cmap": [8, 10], "collect": 14, "color": [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 14, 18], "color_map_nam": 14, "com": 16, "combin": 18, "come": 2, "command": [17, 18], "commit": 15, "commun": 17, "compar": 5, "compris": 18, "conda": 16, "conserv": 14, "consid": 15, "contain": [6, 10, 12, 14], "content": 17, "contextu": 18, "continuous_upd": 9, "control": 18, "convers": 14, "convert": 2, "coo_fram": [0, 1], "coordin": [1, 2, 10, 14, 17, 18], "corner": 10, "correspond": [10, 18], "cosmetic_opt": 5, "coupl": 11, "coverag": 17, "crab": 10, "creat": [1, 8, 10, 11, 12, 14, 17, 18], "cross": [1, 11], "ctrl": 16, "ctype": 11, "current": [14, 17], "custom": 1, "d": [3, 6], "data": [2, 6, 7, 8, 14, 15, 17, 18], "databas": 3, "dec": [1, 2, 3, 6, 7], "decam": 0, "decap": 0, "decor": 14, "def": [2, 6, 7, 9], "default": [14, 18], "defin": [11, 14], "deg": [1, 3, 4, 6, 7, 8, 9, 10], "degre": [1, 14], "dej": 2, "dem": 11, "demonstr": 9, "depend": 14, "deprec": 14, "describ": [10, 14], "descript": [1, 7, 9, 18], "detach": 17, "detail": [16, 17], "detect": 14, "dev": [15, 16], "develop": 17, "dhul": 2, "dict": [2, 6, 7, 9, 14], "dictionari": [2, 9, 14], "dictionnari": 17, "differ": [5, 10, 14, 15], "dimens": 8, "directional_offset_bi": 8, "disabl": [9, 17], "discuss": 15, "disk": 14, "displai": [0, 5, 6, 7, 10, 11, 14, 17, 18], "display_a_moc": 8, "distanc": 6, "divers": 10, "dm": 2, "do": [8, 10, 14, 15, 16], "doc": 15, "document": [1, 12, 14], "doe": [11, 14, 17], "don": [10, 11], "done": 10, "doqueri": 6, "download": 16, "dr1": [0, 10], "drag": 7, "dropaxi": 8, "dss2": [2, 5, 9], "e": 10, "each": 8, "earth": [14, 17], "edg": 4, "edgecolor": [8, 14], "edit": [10, 18], "editor": 18, "edr3": 3, "effect": 1, "eg": 14, "either": [1, 10, 14, 16], "element": [1, 14, 17], "elev": 11, "ellips": 8, "ellipseskyregion": [8, 14], "elysium": 11, "enclos": 7, "end": 8, "error": 10, "et": 11, "event": [6, 7, 14], "everyth": 10, "ex": [14, 18], "exact": 8, "exampl": [3, 8, 14, 15, 16, 17], "execut": [6, 7, 10, 14], "export": 14, "expos": 17, "express": 1, "external_radiu": 4, "extract": 10, "f": [1, 6], "f08080": 2, "facecolor": 14, "fals": [5, 7, 9, 18], "far": 10, "featur": 15, "few": [1, 6, 18], "ff89ff": [1, 2], "field": [1, 14, 17, 18], "file": [14, 15, 17], "filenam": 8, "fill_color": [4, 14], "fillcolor": 14, "find": [15, 18], "first": [1, 2, 8, 10, 11, 14], "fit": [1, 8, 14, 17], "fk5": 8, "fl8y": 3, "flex": [5, 6, 7], "flex_flow": [5, 6, 7], "flip": 10, "flipud": 10, "float": [2, 14], "floatslid": 9, "follow": [5, 8, 10], "footprint": 4, "forg": 16, "form": 2, "format": [6, 8, 10, 14, 15, 18], "found": 1, "fov": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14], "fov_xi": [10, 14], "fr": [0, 1, 2, 4, 6, 11], "frame": [1, 8, 10, 18], "from": [0, 1, 2, 5, 6, 7, 9, 11, 14, 16, 17], "from_nam": [8, 10], "from_r": 4, "full": [1, 18], "full_screen": 18, "fullscreen": 18, "func": 14, "function": [17, 18], "g": 10, "g184": 3, "gaia": 3, "galact": [0, 1, 10], "gazett": [11, 14], "gca": 8, "gener": [1, 2, 10, 12], "get": [6, 14, 17], "get_jpeg_thumbnail": 14, "get_object_data": 2, "get_object_ra_dec_product": 2, "get_view_as_fit": [10, 14], "git": 15, "github": 16, "given": [14, 18], "glimpse360": 9, "go": 18, "grab": 10, "grai": 8, "graphic": [14, 17], "graphic_opt": 14, "green": 8, "grid": 18, "grid_color": 18, "grid_opac": 18, "grid_opt": 18, "gt": [1, 8], "gui": 17, "guid": 16, "h": [3, 6], "h2": 6, "ha": [14, 18], "have": [7, 8, 10, 14, 15, 16, 18], "hdu": 1, "hdu_list": 8, "hdulist": 14, "header": [8, 10], "healpix": 14, "height": [0, 7, 8, 10, 14], "hella": 11, "here": [1, 2, 10, 11, 18], "hex": 18, "hfi": 10, "hip2": 2, "hips2fit": 14, "home": [11, 17], "horizont": [9, 14], "how": [10, 17], "howev": [10, 18], "href": 1, "html": [1, 6, 7, 15, 18], "http": [0, 1, 2, 4, 6, 8, 11, 15, 16], "huski": 15, "i": [1, 2, 3, 10, 11, 14, 15, 16, 18], "icr": [1, 6, 8], "icrsd": 1, "ident": 1, "ii_337_vvv1": 4, "illustr": [1, 2, 14, 17], "imag": [1, 2, 8, 9, 14, 17], "image_format": [10, 14], "image_opt": 14, "img": [6, 10], "implement": 3, "import": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16], "improv": 15, "imread": 10, "imshow": [8, 10], "includ": [10, 14], "index": 14, "indic": [10, 14, 18], "info": [6, 8], "inform": [2, 10, 14, 15, 17], "init_opt": 14, "initi": [1, 17], "instal": [10, 17], "instanc": 10, "instanti": 16, "instead": [3, 14], "instruct": 16, "int": 14, "intend": 10, "interact": [0, 1, 14, 17, 18], "interfac": 10, "intern": 14, "internal_radiu": 4, "intersect": 8, "io": [8, 14], "ipyaladin": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 18], "ipynb": 8, "ipywidget": [5, 6, 7, 9, 18], "isidi": 11, "issu": [15, 18], "item": 5, "its": [2, 10, 14, 16, 18], "j": [2, 15], "j0534": 3, "j053431": 3, "j05343217": 3, "j053434": 3, "j05343755": 3, "j05343759": 3, "j05343821": 3, "j2000": 8, "javascript": [14, 17], "jcmtsf": 3, "jpeg": [10, 14], "jslink": 5, "json": [2, 6], "jupyt": [10, 14, 18], "keep": 17, "kei": 14, "kernel": 15, "keyword": 14, "know": 18, "label": 18, "lang": 6, "lat": 4, "later": 18, "latest": 16, "latitud": [11, 14], "layer": [1, 14, 18], "layout": [5, 6, 7], "lbc2011": 3, "left": 10, "len": 6, "length": 3, "let": [1, 2, 8, 11], "level": [5, 13], "librari": [14, 18], "lightskyblu": 3, "like": 15, "line": [3, 8, 10], "line_width": [4, 14], "lineskyregion": [8, 14], "linewidth": 14, "link": 17, "list": [1, 8, 10, 14, 18], "listen": [2, 14, 15], "listener_typ": 14, "lite": [10, 11, 14, 15, 17, 18], "liter": 2, "live": 15, "ll": [10, 15], "lmc": [2, 10], "load": [10, 14], "local": 3, "locat": 18, "logo": [10, 14], "lon": 4, "longer": 10, "longitud": [11, 14], "look": [8, 11, 14, 16], "lot": 18, "lt": [1, 8], "m": [1, 3, 5, 6, 7, 8, 15], "m1": [1, 10], "m10": 1, "m31": [1, 8, 10], "ma": [3, 11], "machin": 16, "made": [15, 17], "main_id": [6, 7], "main_idradecra_precdec_preccoo_err_majacoo_err_minacoo_err_anglecoo_qualcoo_wavelengthcoo_bibcodescript_number_id": 3, "make": [15, 18], "map": 14, "mar": 11, "marineri": 11, "marker": [1, 14], "marmo": 11, "mars_featur": 11, "mars_viking_mdim21": 11, "masmasdeg": 3, "matplotlib": [8, 10], "max": [2, 9], "max_depth": 4, "mdim21": 11, "mean": [10, 15], "melling": 4, "menu": 18, "messier": [1, 3], "meta": [2, 3], "method": [1, 10, 14, 17], "middl": 18, "might": 18, "mileston": 15, "mimic": 10, "min": 9, "mix": 9, "moc": [8, 10, 14, 17], "moc_dict": 14, "moc_opt": 14, "moc_url": 14, "mocpi": [14, 17], "mode": 18, "modifi": [1, 10], "modul": 15, "mon": 11, "mont": 11, "more": [1, 16, 18], "most": 10, "mot": 16, "move": 5, "multi": 17, "multipl": 10, "must": 14, "my_sample_t": 3, "name": [1, 3, 6, 7, 8, 9, 10, 11, 14, 18], "ned": 14, "need": [15, 16, 18], "never": 18, "new": [9, 10, 14, 15, 18], "next": [1, 10], "noachi": 11, "nomenclatur": [11, 14], "nominatim": 14, "none": [6, 7, 9, 14, 18], "norm": 10, "note": [14, 17], "notebook": [10, 14, 15, 16, 17], "now": 8, "np": 10, "npm": [15, 16], "npmj": 16, "npolygon": 8, "nside": 4, "number": 14, "numpi": 10, "nvss": 3, "obj_coo": 6, "obj_data": 6, "obj_nam": 6, "object": [1, 2, 10, 11, 14, 17], "object_click": [2, 14], "object_hov": [2, 14], "objectstr13str13int16int16float32float32int16str1str1objectint32": 3, "observ": 9, "oc": 2, "olympu": 11, "on_button_click": 7, "on_click": [2, 7], "on_survey_overlay_value_chang": 9, "on_survey_value_chang": 9, "on_surveyoverlay_opacity_value_chang": 9, "on_zoom_slider_value_chang": 9, "onc": [6, 7], "one": [2, 3, 5, 8, 15], "onli": 14, "onlin": 14, "opac": [1, 4, 9, 14, 18], "opacity_slid": 9, "open": [8, 15, 16], "openstreetmap": [11, 14], "oper": 8, "opt": 10, "optim": 17, "option": [2, 9, 16, 17], "order": [6, 14, 17], "org": 15, "orient": 9, "origin": 18, "orion": 9, "other": [3, 5, 9, 10, 11, 14, 15], "otherwis": 14, "our": 2, "out": [2, 10, 18], "outflow": 11, "output": [10, 14, 18], "outsid": 18, "overflow": 7, "overlai": [1, 9, 14, 17], "overlay_opt": 14, "overlay_survei": [1, 9], "overlay_survey_opac": [1, 9], "ow": 18, "own": [2, 8, 18], "p": [1, 2, 4, 5, 9, 10, 11], "packag": [8, 13, 14], "page": [12, 15], "pandoc": 15, "panstarr": 10, "parallax": 3, "param": 6, "paramet": [1, 2, 6, 7, 9, 14, 17], "part": 17, "pass": 15, "patch": 8, "path": [1, 10, 14], "pathlib": [1, 14], "patient": 6, "phase": 6, "photometr": 6, "photometri": 14, "photvizpreview": 6, "pink": 1, "pip": [10, 15, 16], "pixel": [10, 14], "plain": 1, "planck": 10, "plane": 0, "planet": 11, "planetari": [14, 17], "planitia": 11, "plckerc": 3, "pleas": 15, "plot": [6, 8], "plt": [8, 10], "pn": 9, "png": [2, 10, 14], "point": [6, 11, 14], "point_siz": 6, "pointer": 18, "polygon": 8, "polygonskyregion": [8, 14], "popup": [1, 14], "posit": [1, 7, 14], "possibl": 14, "practic": 18, "pre": [10, 15], "press": 7, "prettier": 15, "preview": 14, "primari": 8, "primaryhdu": 8, "prime": 1, "prime00": 1, "print": [2, 10], "process": [6, 7], "process_result": [6, 7], "produc": 9, "product": 2, "programmat": 10, "project": [8, 10, 17], "properti": [10, 14], "protocol": 18, "provid": 14, "public": 15, "purpl": [8, 10], "pyplot": [8, 10], "pytest": 15, "python": [2, 14, 17, 18], "qtabl": [3, 14], "qualiti": 14, "queri": [6, 17], "query_region": [3, 7, 10], "quick": 14, "quot": 3, "r": 6, "r2": 10, "ra": [1, 2, 3, 6, 7], "radiu": [3, 7, 8, 10], "radius_arcsec": 6, "rais": 18, "rang": 1, "re": [8, 14, 16], "read": [1, 10], "readi": 14, "readout": 9, "readout_format": 9, "readthedoc": 8, "recent": 10, "recogn": 11, "recov": 10, "rect": 14, "rectangl": [7, 8, 14], "rectangleskyregion": [8, 14], "rectangular": [14, 17], "rectangular_select": 14, "red": [2, 5, 8, 9], "redirect": 18, "redtemperatur": 2, "reduc": 18, "reflect": 10, "region": [10, 14, 17], "regionvisu": [8, 14], "rel": 7, "releas": 17, "render": 18, "repositori": [8, 15, 16], "repres": [8, 11, 14, 18], "represent": 8, "request": [6, 15, 17], "research": 15, "resolv": 14, "restart": 15, "result": [6, 17], "reticl": 18, "reticle_color": [1, 2, 18], "reticle_s": [1, 18], "retriev": [14, 17], "return": [2, 6, 10, 11, 14, 18], "rgb": 18, "rhomb": 3, "right": [7, 10, 18], "rm": 2, "root": 16, "rotat": 10, "row": [5, 6, 7], "row_limit": 10, "ruff": 15, "run": [6, 14, 16, 17], "same": [8, 10, 14], "samp": 18, "save": [2, 14, 17], "save_view_as_imag": [2, 10, 14], "scientif": [10, 14], "scope": 3, "scratch": 17, "screen": [10, 18], "screenshot": 10, "screenshot_wc": 10, "search": [1, 14], "second": [6, 10], "section": 16, "sed_img": 6, "see": [7, 10, 11, 14, 15, 16, 18], "seen": 10, "select": [6, 14, 17], "selected_object": [10, 14], "selection_typ": 14, "send": [2, 10, 18], "server": [10, 15], "servic": 14, "sesam": 14, "set": [1, 14, 16, 17], "set_color_map": [2, 14], "set_listen": [2, 6, 7, 14], "sever": 10, "sgr": 1, "shape": [1, 3, 10, 11, 14, 17], "share": [15, 18], "should": [10, 14, 16, 18], "show": 18, "show_catalog": 18, "show_context_menu": 18, "show_coo_grid": [0, 18], "show_coo_grid_control": 18, "show_coo_loc": 18, "show_fov": 18, "show_fram": 18, "show_fullscreen_control": [5, 7, 18], "show_layers_control": 18, "show_projection_control": [5, 7, 18], "show_reticl": 18, "show_settings_control": 18, "show_share_control": 18, "show_simbad_pointer_control": 18, "show_status_bar": [2, 18], "show_zoom_control": 18, "shown": 18, "showtabl": 2, "side": [2, 15, 17], "sim": [1, 6], "simbad": [1, 3, 6, 7, 10, 14, 18], "similar": 18, "simpli": 10, "sinc": [10, 11], "singl": 14, "size": 18, "sky": [0, 2, 11, 14], "skycoord": [1, 8, 10, 11, 14], "slider": 9, "slower": 18, "snake_cas": 3, "so": 10, "softwar": 18, "solar": 14, "solid": 5, "some": 18, "sourc": [2, 7, 10, 14], "source_s": [1, 2, 3, 10, 11], "sources": 3, "space": 17, "specifi": 18, "speed": 18, "sphinx": 12, "squar": 10, "src": 6, "star": 6, "start": [8, 11, 15, 17, 18], "startup": 18, "statu": 18, "stc": [14, 17], "stc_string": 14, "step": 9, "still": 17, "store": 10, "str": 14, "strasbg": [4, 6, 11], "strasbourg": [11, 15], "stretch": [5, 6, 7], "string": [1, 8, 14], "submit": 1, "submodul": 17, "subplot": [8, 10], "subset": 8, "support": [8, 14], "supportedregion": 14, "surfac": 11, "survei": [0, 1, 2, 4, 5, 9, 10, 14, 17, 18], "survey_overlay_selector": 9, "survey_selector": 9, "switch": 10, "sync": 6, "synchron": 5, "system": [10, 14], "t": [3, 10, 11, 14], "tab": 14, "tabl": [4, 7, 10, 11, 14, 17], "table_info": 7, "table_opt": 14, "take": 10, "tap": 6, "target": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14], "tau05": 3, "td": 7, "teal": [4, 10], "temp": 11, "termin": [15, 16], "terra": 11, "test": 17, "text": 1, "th": 7, "than": [10, 15], "thank": 15, "tharsi": 11, "thei": [1, 8, 14, 15], "them": [1, 2, 7, 8], "thi": [3, 10, 11, 12, 14, 15, 16, 17, 18], "third": 10, "through": 10, "time": [10, 17], "titl": 1, "to_pixel": 8, "togglebutton": 9, "tool": 14, "toolbar": 18, "tooltip": 9, "top": [1, 6, 13], "tour": 16, "toward": 18, "tr": 7, "traitlet": 15, "trigger": [2, 7, 10, 14], "trimbl": 3, "true": [0, 2, 4, 9, 10, 14, 18], "try": [5, 10], "tupl": 14, "two": [3, 8, 10, 14], "type": [8, 14], "u": [3, 4, 6, 7, 10, 11], "uint8": 8, "union": [8, 14], "unistra": [0, 1, 2], "unit": [3, 4, 7, 8, 10, 14], "unreleas": 17, "until": 15, "unzoom": 11, "updat": 10, "url": [2, 14, 17], "us": [10, 14, 15, 17], "user": [14, 16], "usno": 10, "utopia": 11, "v": 3, "vall": 11, "valu": [2, 6, 7, 9, 10, 14, 18], "vastita": 11, "vbox": 9, "ve": 10, "ver": 8, "veri": 18, "version": 17, "vertic": 8, "via": 18, "view": [0, 1, 2, 5, 7, 11, 14, 17], "viewport": 18, "vike": 11, "violet": 4, "visual": [8, 14], "viz": 2, "vizier": [2, 4, 10, 14], "vmin": 10, "votabl": [2, 14], "votable_opt": 14, "votable_url": 14, "vscode": 14, "w": 6, "wa": 15, "wai": [10, 14, 18], "want": [2, 10], "wc": [8, 11, 14, 17], "we": [1, 2, 10, 11, 15, 17, 18], "webp": [10, 14], "webpag": 16, "welcom": 15, "wether": 18, "when": [2, 10, 14, 18], "where": [6, 10, 14, 18], "whether": [14, 18], "which": 18, "whose": 2, "why": 11, "widget": [1, 6, 7, 8, 9, 11, 12, 13, 15], "widget_should_be_load": 14, "widgetcommunicationerror": 10, "widgetnotreadyerror": 10, "widgetreducederror": 18, "width": [5, 6, 7, 8], "window": [14, 18], "wish": 7, "with_logo": [10, 14], "without": 14, "won": 14, "work": [3, 8, 10, 11, 14, 17], "workaround": 18, "world": [10, 14], "would": 15, "wrap": 15, "wrapper": 14, "write": 2, "written": [1, 10], "wrong": 18, "www": 16, "x": [1, 10], "xmm": 9, "y": 10, "yellow": 8, "you": [1, 2, 7, 8, 10, 11, 14, 15, 16, 18], "your": [15, 16, 18], "zoom": [5, 9, 18], "zoom_slid": 9}, "titles": ["Getting Started", "Aladin commands", "Use of functions on ipyaladin widgets", "Display tables resulting from an astroquery request", "Display of a Multi Order Coverage (MOC)", "Linked widgets", "On click callback", "Example of interactive rectangular selection", "Adding shapes / graphic overlays", "Advanced GUI", "Retrieving data from the current widget\u2019s view", "Planetary surveys", "API Reference", "ipyaladin", "ipyaladin.widget", "Community", "Getting Started", "The ipyaladin jupyter widget", "User Documentation"], "titleterms": {"": [10, 18], "1": 18, "2": 18, "On": 6, "The": 17, "about": 18, "ad": [8, 18], "add": 8, "advanc": [9, 18], "aladin": 1, "an": [3, 4, 10], "api": [12, 17], "astropi": [3, 8], "astroqueri": 3, "between": 14, "build": 15, "built": 2, "callback": 6, "check": 15, "class": 14, "click": 6, "command": 1, "commun": 15, "content": 14, "contribut": [15, 17], "coordin": 8, "correspond": 14, "coverag": 4, "creat": 3, "current": [10, 18], "data": 10, "detach": 18, "develop": 15, "dictionnari": 4, "disabl": 18, "displai": [3, 4], "document": [15, 17, 18], "doe": 15, "earth": 11, "element": 18, "exampl": 7, "field": 10, "file": 10, "fit": 10, "from": [3, 4, 8, 10, 18], "function": [2, 14], "get": [0, 10, 16], "graphic": 8, "gui": 9, "guid": 17, "home": 2, "how": 15, "imag": 10, "inform": 18, "initi": 18, "instal": [15, 16], "interact": 7, "ipyaladin": [2, 13, 14, 17], "javascript": 15, "jupyt": 17, "keep": 18, "link": 5, "made": 2, "method": 2, "moc": 4, "mocpi": 4, "modul": 14, "multi": 4, "note": 18, "notebook": 18, "object": [4, 8], "optim": 18, "option": [14, 18], "order": 4, "overlai": 8, "paramet": 18, "planetari": 11, "python": 15, "queri": 3, "rectangular": 7, "refer": 12, "region": 8, "releas": 16, "request": 3, "result": 3, "retriev": [10, 18], "run": 15, "save": 10, "scratch": 3, "select": [7, 10], "set": 18, "shape": 8, "side": 18, "space": 8, "start": [0, 16], "stc": 8, "still": 15, "submodul": 13, "survei": 11, "tabl": 3, "test": 15, "time": 8, "unreleas": 16, "url": 4, "us": [2, 16, 18], "user": [17, 18], "version": 16, "view": [10, 18], "wc": [10, 18], "widget": [2, 5, 10, 14, 16, 17, 18], "work": 15}}) \ No newline at end of file +Search.setIndex({"alltitles": {"1. Detaching the widget from the notebook and keeping it on the side of the notebook": [[18, "detaching-the-widget-from-the-notebook-and-keeping-it-on-the-side-of-the-notebook"]], "2. Disabling the optimization in the notebook parameters": [[18, "disabling-the-optimization-in-the-notebook-parameters"]], "API": [[17, "api"]], "API Reference": [[12, null]], "Add shapes from Space-Time Coordinates (STC)": [[8, "Add-shapes-from-Space-Time-Coordinates-(STC)"]], "Add shapes from astropy-regions objects": [[8, "Add-shapes-from-astropy-regions-objects"]], "Adding elements to the widget": [[18, "adding-elements-to-the-widget"]], "Adding shapes / graphic overlays": [[8, null]], "Advanced GUI": [[9, null]], "Advanced use": [[18, "advanced-use"]], "Aladin commands": [[1, null]], "Built-in methods": [[2, "Built-in-methods"]], "Check that the documentation still builds": [[15, "check-that-the-documentation-still-builds"]], "Classes": [[14, "classes"]], "Community": [[15, null]], "Contribution guide": [[17, "contribution-guide"]], "Contributions": [[15, "contributions"]], "Correspondence between options": [[14, "id5"]], "Development installation": [[15, "development-installation"]], "Display Astropy table created from scratch": [[3, "Display-Astropy-table-created-from-scratch"]], "Display of a Multi Order Coverage (MOC)": [[4, null]], "Display tables resulting from an astroquery request": [[3, null]], "Example of interactive rectangular selection": [[7, null]], "From a dictionnary": [[4, "From-a-dictionnary"]], "From a mocpy object": [[4, "From-a-mocpy-object"]], "From a query": [[3, "From-a-query"]], "From an URL": [[4, "From-an-URL"]], "Functions": [[14, "functions"]], "Getting Started": [[0, null], [16, null]], "Getting the current WCS": [[10, "Getting-the-current-WCS"]], "Getting the field of view": [[10, "Getting-the-field-of-view"]], "Getting the selection": [[10, "Getting-the-selection"]], "Getting the view as a fits file": [[10, "Getting-the-view-as-a-fits-file"]], "Home-made functions": [[2, "Home-made-functions"]], "How does it work": [[15, "how-does-it-work"]], "Initialization options": [[18, "id1"]], "Initialization options for the widget": [[18, "initialization-options-for-the-widget"]], "Installation": [[16, "installation"]], "Javascript tests": [[15, "javascript-tests"]], "Linked widgets": [[5, null]], "Module Contents": [[14, "module-contents"]], "Note about the WCS": [[18, "note-about-the-wcs"]], "On click callback": [[6, null]], "Planetary surveys": [[11, null]], "Python tests": [[15, "python-tests"]], "Released versions": [[16, "released-versions"]], "Retrieving data from the current widget\u2019s view": [[10, null]], "Retrieving information from the current widget view": [[18, "retrieving-information-from-the-current-widget-view"]], "Running the tests": [[15, "running-the-tests"]], "Saving the view as an image file": [[10, "Saving-the-view-as-an-image-file"]], "Setting the view\u2019s parameters": [[18, "setting-the-view-s-parameters"]], "Submodules": [[13, "submodules"]], "Surveys of Earth": [[11, "Surveys-of-Earth"]], "The ipyaladin jupyter widget": [[17, null]], "Unreleased version": [[16, "unreleased-version"]], "Use of functions on ipyaladin widgets": [[2, null]], "User Documentation": [[17, "user-documentation"], [18, null]], "User Guide": [[17, "user-guide"]], "Using the widget": [[16, "using-the-widget"]], "ipyaladin": [[13, null]], "ipyaladin.widget": [[14, null]]}, "docnames": ["_collections/notebooks/01_Getting_Started", "_collections/notebooks/02_Base_Commands", "_collections/notebooks/03_Functions", "_collections/notebooks/04_Importing_Tables", "_collections/notebooks/05_Display_a_MOC", "_collections/notebooks/06_Linked-widgets", "_collections/notebooks/07_on-click-callback", "_collections/notebooks/08_Rectangular-selection", "_collections/notebooks/09_Displaying_Shapes", "_collections/notebooks/10_Advanced-GUI", "_collections/notebooks/11_Extracting_information_from_the_view", "_collections/notebooks/12_Planetary_surveys", "autoapi/index", "autoapi/ipyaladin/index", "autoapi/ipyaladin/widget/index", "community/community", "getting_started/getting_started", "index", "user_documentation/user_documentation"], "envversion": {"nbsphinx": 4, "sphinx": 63, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.viewcode": 1}, "filenames": ["_collections/notebooks/01_Getting_Started.ipynb", "_collections/notebooks/02_Base_Commands.ipynb", "_collections/notebooks/03_Functions.ipynb", "_collections/notebooks/04_Importing_Tables.ipynb", "_collections/notebooks/05_Display_a_MOC.ipynb", "_collections/notebooks/06_Linked-widgets.ipynb", "_collections/notebooks/07_on-click-callback.ipynb", "_collections/notebooks/08_Rectangular-selection.ipynb", "_collections/notebooks/09_Displaying_Shapes.ipynb", "_collections/notebooks/10_Advanced-GUI.ipynb", "_collections/notebooks/11_Extracting_information_from_the_view.ipynb", "_collections/notebooks/12_Planetary_surveys.ipynb", "autoapi/index.rst", "autoapi/ipyaladin/index.rst", "autoapi/ipyaladin/widget/index.rst", "community/community.md", "getting_started/getting_started.rst", "index.md", "user_documentation/user_documentation.rst"], "indexentries": {"add_catalog_from_url() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_catalog_from_URL", false]], "add_fits() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_fits", false]], "add_graphic_overlay_from_region() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_graphic_overlay_from_region", false]], "add_graphic_overlay_from_stcs() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_graphic_overlay_from_stcs", false]], "add_listener() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_listener", false]], "add_markers() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_markers", false]], "add_moc() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_moc", false]], "add_moc_from_dict() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_moc_from_dict", false]], "add_moc_from_url() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_moc_from_URL", false]], "add_overlay_from_stcs() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_overlay_from_stcs", false]], "add_table() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.add_table", false]], "aladin (class in ipyaladin.widget)": [[14, "ipyaladin.widget.Aladin", false]], "fov (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.fov", false]], "fov_xy (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.fov_xy", false]], "get_jpeg_thumbnail() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.get_JPEG_thumbnail", false]], "get_view_as_fits() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.get_view_as_fits", false]], "height (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.height", false]], "ipyaladin": [[13, "module-ipyaladin", false]], "ipyaladin.widget": [[14, "module-ipyaladin.widget", false]], "module": [[13, "module-ipyaladin", false], [14, "module-ipyaladin.widget", false]], "rectangular_selection() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.rectangular_selection", false]], "save_view_as_image() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.save_view_as_image", false]], "selected_objects (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.selected_objects", false]], "selection() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.selection", false]], "set_color_map() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.set_color_map", false]], "set_listener() (ipyaladin.widget.aladin method)": [[14, "ipyaladin.widget.Aladin.set_listener", false]], "target (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.target", false]], "wcs (ipyaladin.widget.aladin property)": [[14, "ipyaladin.widget.Aladin.wcs", false]], "widget_should_be_loaded() (in module ipyaladin.widget)": [[14, "ipyaladin.widget.widget_should_be_loaded", false]]}, "objects": {"": [[13, 0, 0, "-", "ipyaladin"]], "ipyaladin": [[14, 0, 0, "-", "widget"]], "ipyaladin.widget": [[14, 1, 1, "", "Aladin"], [14, 4, 1, "", "widget_should_be_loaded"]], "ipyaladin.widget.Aladin": [[14, 2, 1, "", "add_catalog_from_URL"], [14, 2, 1, "", "add_fits"], [14, 2, 1, "", "add_graphic_overlay_from_region"], [14, 2, 1, "", "add_graphic_overlay_from_stcs"], [14, 2, 1, "", "add_listener"], [14, 2, 1, "", "add_markers"], [14, 2, 1, "", "add_moc"], [14, 2, 1, "", "add_moc_from_URL"], [14, 2, 1, "", "add_moc_from_dict"], [14, 2, 1, "", "add_overlay_from_stcs"], [14, 2, 1, "", "add_table"], [14, 3, 1, "", "fov"], [14, 3, 1, "", "fov_xy"], [14, 2, 1, "", "get_JPEG_thumbnail"], [14, 2, 1, "", "get_view_as_fits"], [14, 3, 1, "", "height"], [14, 2, 1, "", "rectangular_selection"], [14, 2, 1, "", "save_view_as_image"], [14, 3, 1, "", "selected_objects"], [14, 2, 1, "", "selection"], [14, 2, 1, "", "set_color_map"], [14, 2, 1, "", "set_listener"], [14, 3, 1, "", "target"], [14, 3, 1, "", "wcs"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "property", "Python property"], "4": ["py", "function", "Python function"]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:property", "4": "py:function"}, "terms": {"": [1, 2, 3, 6, 7, 8, 11, 14, 17], "0": [1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18], "00": 3, "00000001": 9, "0000er1995aujph": 3, "00010000": 3, "00018500": 3, "00060": 3, "0009000": 3, "00090ci2003ycat": 3, "00090dr1998aj": 3, "00090em2008apj": 3, "001": 10, "0011111": 3, "00226": 8, "00227": 8, "00782497": 1, "00814140": 3, "01": [3, 9], "0133": 3, "02": [3, 4, 11], "02990ao2020ycat": 3, "03": 3, "03742777": 4, "0380": 3, "04": 8, "044": 3, "05": [3, 10], "05652591227": 3, "06190ao2020ycat": 3, "06490ao2020ycat": 3, "06660": 3, "07": 3, "070": 3, "0730": 3, "07630": 8, "07633": 8, "0790": 3, "08518": 8, "0c1": 3, "0d1": 3, "0di2011apj": 3, "0ds2019mnra": 3, "0e2022apj": 3, "0ef2016mnra": 3, "0eg2019apj": 3, "0g1": 3, "0x7fb750158e00": 8, "1": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 17], "10": [1, 2, 4, 6, 8, 11], "100": [3, 5, 6, 7, 11, 14], "102": 4, "10321": 4, "10323": 4, "10332": 4, "10333": 4, "10334": 4, "10356": 4, "10358": 4, "10364": 4, "10366": 4, "10445": 4, "10447": 4, "10469": 4, "10477": 4, "10479": 4, "105": 3, "10821": 4, "10823": 4, "10878": 4, "10960": 4, "10961": 4, "10963": 4, "10964": 4, "10966": 4, "10969": 4, "10971": 4, "10972": 4, "10974": 4, "10975": 4, "11": 1, "11004": 4, "11005": 4, "11007": 4, "1101": 4, "11176": 4, "11178": 4, "1118": 4, "112": [4, 11], "113": 4, "11370": 4, "11373": 4, "11405": 4, "11406": 4, "11407": 4, "11410": 4, "11411": 4, "11412": 4, "11413": 4, "11414": 4, "11416": 4, "11425": 4, "11426": 4, "11427": 4, "11428": 4, "11432": 4, "115": 3, "116": 4, "117": [4, 11], "1177": 3, "12": [1, 2, 3, 11, 14], "1200": 8, "12018": 8, "12286": 8, "123y1": 3, "12490ao2020ycat": 3, "12904": 8, "12h00m00": 1, "13": [1, 11, 14], "135": 4, "1350": 3, "14": [4, 14], "140": 3, "143s1": 3, "147": 11, "1470": 4, "1490": 3, "15": [1, 4, 11], "150": [4, 6], "151": 4, "152": 4, "153": 4, "15314140": 3, "156": 4, "157": 4, "159": 11, "16": 4, "1600": 4, "1638": 4, "1693c1": 3, "175": 3, "1751": 4, "1755": 4, "1756": 4, "1757": 4, "1758": 4, "1766": 4, "1767": 4, "1769": 4, "1770": 4, "1771": 4, "1772": 4, "1773": 4, "1776": 4, "1777": [3, 4], "1778": 4, "178": 18, "18": 11, "180": [2, 9], "1811": 4, "1817": 4, "1818": 4, "1831": [3, 4], "1835": 4, "1836": 4, "1838": 4, "1840": 4, "19": 11, "1920": 4, "1921": 4, "1922": 4, "194": [3, 4], "195": 4, "19710": 8, "198": 4, "199": 4, "1993": 3, "1999842": 8, "1f": 9, "2": [0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 14, 17], "20": [1, 3, 4, 10, 18], "200": [4, 6], "201": 4, "2018": 11, "202": 8, "203": 4, "20325": 8, "205": 3, "20596": 8, "20597": 8, "21": [3, 11, 14], "210": 4, "2135528": 11, "2195": 3, "22": 3, "220": 3, "220001005": 3, "22004505": 3, "220048605": 3, "220056005": 3, "220122205": 3, "2201i05": 3, "2201s05": 3, "22020705": 3, "2246": 3, "226": 11, "23": [2, 14], "231": 4, "23391": 8, "23395": 8, "23398": 8, "24063": 8, "24302": 8, "24414140": 3, "24949": 8, "24951": 8, "25": [8, 11, 14], "250": 11, "256": 4, "2581": 4, "2582": 4, "2588": 4, "2590": 4, "26": 4, "260": 3, "2612": 4, "2614": 4, "2620": 4, "2622": 4, "266": 1, "2669000": 3, "269": 2, "2708": 4, "2710": 4, "2716": 4, "2718": 4, "2749": 4, "277d1": 3, "28": 3, "280": 11, "2805": 3, "284": 10, "2895e1": 3, "29": 1, "298": 11, "2mass": [3, 5, 9], "3": [1, 2, 3, 4, 5, 6, 8, 10], "30": [3, 11], "30d00m00": 1, "30l1": 3, "31": 3, "316": 11, "31746": 8, "32": [3, 4, 11], "32391": 8, "32632": 8, "33": [4, 5], "34": 3, "3403817661471500416": 3, "3403817936349408000": 3, "3403818589184411648": 3, "34273": 8, "344": 3, "34527": 8, "34529": 8, "350": 11, "35192": 8, "36": [3, 4, 6], "36069": 8, "3619c1": 3, "36955": 8, "36958": 8, "37": 3, "3735": 3, "378": 4, "379": 4, "38": 3, "3805": 3, "382": 4, "383": 4, "387": 4, "39": 1, "390": 4, "391": 4, "3fgl": 3, "4": [1, 2, 3, 4, 6, 8, 11, 14], "40": [0, 11], "400": [9, 14], "402": 4, "403": 4, "406": 4, "407": 4, "40715": 8, "40721": 8, "412": 4, "413": 4, "41640": 8, "41681663": 1, "4188": 4, "4189": 4, "42": [4, 11], "43": 4, "4363": 4, "4366": 4, "4367": 4, "4389": 4, "4400": 4, "4401": 4, "44415": 8, "44416": 8, "4450": 4, "4451": 4, "4454": 4, "4456": 4, "4457": 4, "4460": 4, "4461": 4, "4463": 4, "4476": 4, "4478": 4, "4479": 4, "4488ee": 8, "45": [8, 11], "45459": 8, "455510000": 3, "456": 4, "4561": 4, "4564": 4, "4565": 4, "45683": 8, "457": 4, "458": 3, "46": 11, "460": 4, "461": 4, "46379": 8, "46382": 8, "4656816": 8, "47": 8, "472": 4, "48": 3, "485": 3, "4877": 3, "49": 11, "4905": 3, "4sgr": 2, "5": [1, 2, 3, 4, 6, 8, 10, 11, 18], "50": [7, 10, 18], "51": [4, 8], "5112": 3, "51870": 8, "52": 3, "52539": 8, "52540": 8, "52789": 8, "52791": 8, "53": 11, "534": 4, "535518500": 3, "53a1": 3, "54": [3, 4], "55": [3, 4], "56": 3, "5655": 3, "56666": 8, "57": [4, 11], "57585": 8, "57592": 8, "58": 11, "5855583": 4, "58780251600": 3, "59": [3, 11], "5955": 3, "6": [1, 2, 3, 8], "60": 18, "600": [0, 10], "61368056017": 3, "6229": 4, "6241989": 11, "63051": 8, "63451584700": 3, "63746": 8, "63748": 8, "63749": 8, "63970": 8, "64": [1, 3], "6408": 4, "6409": 4, "6411": 4, "6412": 4, "6414": 4, "6433": 4, "6436": 4, "6438": 4, "6439": 4, "6444": 4, "6445": 4, "6447": 4, "65": 11, "6533": 4, "6544": 4, "6546": 4, "6577": 4, "6579": 4, "6582": 4, "6588": 4, "6590": 4, "6591": 4, "67d38d": 11, "69214140": 3, "6933": 4, "6935": 4, "6984": 4, "6986": 4, "7": [1, 2, 8, 11], "70": [6, 11], "7008": 4, "7011": 4, "7017": 4, "74": 4, "744": 3, "74977": 8, "74978": 8, "74982": 8, "7605": 3, "7703": 3, "7705": 3, "7805": 3, "79": 11, "7905": 3, "8": [1, 2], "800": 10, "81": 5, "823863": 2, "83": 3, "86d6ae": 18, "87": 11, "875": 3, "9": [1, 3, 11], "90": [3, 8], "900": 8, "944": 3, "9474": 3, "956288": 2, "97517807639": 3, "98": 4, "99": 4, "99277764451": 3, "9999": 2, "A": [1, 14, 16], "And": [8, 10], "As": 18, "BY": 6, "Be": 6, "For": [8, 10, 14], "If": [8, 10, 14, 15], "In": [17, 18], "It": [2, 7, 10, 11, 14, 18], "No": 8, "On": 17, "The": [1, 2, 6, 7, 8, 9, 10, 11, 14, 15, 18], "Then": [10, 15, 16], "There": [8, 15], "These": [10, 18], "To": [15, 16, 18], "With": 11, "_": [2, 7], "__": 8, "_fov": 5, "_raj": 2, "_target": 5, "abc": 14, "abl": 7, "about": [10, 17], "accept": 15, "actual": 10, "ad": 17, "add": [1, 2, 11, 14, 15, 17], "add_catalog_from_url": [2, 14], "add_fit": [1, 14], "add_graphic_overlay_from_region": [8, 14], "add_graphic_overlay_from_stc": [8, 14], "add_listen": 14, "add_mark": [1, 14], "add_moc": [4, 14], "add_moc_from_dict": 14, "add_moc_from_url": 14, "add_overlay_from_stc": 14, "add_tabl": [3, 7, 10, 11, 14], "addit": 3, "adql": 6, "advanc": 17, "affect": 15, "after": [2, 6, 10], "again": 15, "al": 11, "aladin": [0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18], "aladin_bi": 2, "aladinlit": 14, "alaski": [4, 11], "alba": 11, "align_item": [5, 6, 7], "all": [6, 7, 14, 15, 16], "allow": [10, 14, 18], "allwis": 1, "along": 14, "alpha": 14, "also": [1, 2, 3, 8, 10, 11, 14, 18], "alwai": [1, 10], "an": [0, 1, 2, 11, 14, 15, 16, 17], "angl": [1, 8, 14], "ani": [7, 11, 14, 15], "anymor": 11, "anyth": 14, "anywher": 6, "anywidget": 15, "api": 15, "appear": [6, 14, 16], "append": 1, "appli": [2, 15], "applic": [2, 14, 15], "ar": [1, 6, 8, 10, 11, 14, 15, 18], "arabia": 11, "arg": 14, "argument": [10, 14, 18], "argyr": 11, "around": 14, "asc": 6, "asinh": 10, "associ": 6, "astronom": [14, 15], "astropi": [1, 4, 7, 10, 11, 14, 17], "astroqueri": [7, 10, 14, 17], "attempt": 15, "auto": [7, 12], "autoapi": 12, "avail": 18, "ax": [8, 14], "axi": [1, 10, 14], "b": 5, "background_color": 18, "bad": 14, "bar": [14, 18], "base": [1, 14], "basic": [1, 6], "basin": 11, "becaus": 10, "been": [7, 15], "befor": 15, "behind": 18, "below": [7, 16], "between": [5, 8, 10, 15, 18], "bin": [2, 6], "binary_r": 10, "bit": [10, 16], "blue": 8, "bodi": 14, "bool": 14, "boolean": 10, "border": [5, 7], "boreali": 11, "bottom": [10, 14], "box": [5, 6, 7], "box_layout": [5, 6, 7], "br": 6, "bring": [17, 18], "browser": 14, "bug": 15, "build": 17, "built": 17, "button": [7, 10, 18], "c": [2, 5, 16], "calcul": [10, 18], "call": [10, 14], "callabl": 14, "callback": [7, 9, 14, 17], "camelcas": 3, "can": [1, 2, 5, 8, 9, 10, 11, 14, 15, 16, 17, 18], "cannot": 18, "card": 8, "case": [10, 15, 18], "catalog": [10, 14, 18], "catalog_opt": 14, "caus": 18, "cd": [0, 1, 10, 11, 14, 15], "cdsportal": 6, "cell": [1, 6, 7, 10, 14, 16, 18], "center": [0, 8, 11], "centr": 15, "cgi": 6, "chang": [1, 9, 11, 14, 15], "channel": 11, "check": [14, 17], "children": [5, 6, 7], "choic": 1, "chose": 18, "circ00": 1, "circl": [6, 8, 10, 14], "circleskyregion": [8, 14], "cite": 15, "class": 18, "clean": 15, "click": [2, 7, 10, 14, 17, 18], "clicked_object": 2, "clone": 15, "close": 16, "closest": 6, "cm": 3, "cmap": [8, 10], "collect": 14, "color": [0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 14, 18], "color_map_nam": 14, "com": 16, "combin": 18, "come": 2, "command": [17, 18], "commit": 15, "commun": 17, "compar": 5, "compris": 18, "conda": 16, "conserv": 14, "consid": 15, "contain": [6, 10, 12, 14], "content": 17, "contextu": 18, "continuous_upd": 9, "control": 18, "convers": 14, "convert": 2, "coo_fram": [0, 1], "coordin": [1, 2, 10, 14, 17, 18], "corner": 10, "correspond": [10, 18], "cosmetic_opt": 5, "coupl": 11, "coverag": 17, "crab": 10, "creat": [1, 8, 10, 11, 12, 14, 17, 18], "cross": [1, 11], "ctrl": 16, "ctype": 11, "current": [14, 17], "custom": 1, "d": [3, 6], "dashbord": 14, "data": [2, 6, 7, 8, 14, 15, 17, 18], "databas": 3, "dec": [1, 2, 3, 6, 7], "decam": 0, "decap": 0, "decor": 14, "def": [2, 6, 7, 9], "default": [14, 18], "defin": [11, 14], "deg": [1, 3, 4, 6, 7, 8, 9, 10], "degre": [1, 14], "dej": 2, "dem": 11, "demonstr": 9, "depend": 14, "deprec": 14, "describ": [10, 14], "descript": [1, 7, 9, 18], "detach": 17, "detail": [16, 17], "detect": 14, "dev": [15, 16], "develop": 17, "dhul": 2, "dict": [2, 6, 7, 9, 14], "dictionari": [2, 9, 14], "dictionnari": 17, "differ": [5, 10, 14, 15], "dimens": 8, "directional_offset_bi": 8, "disabl": [9, 17], "discuss": 15, "disk": 14, "displai": [0, 5, 6, 7, 10, 11, 14, 17, 18], "display_a_moc": 8, "distanc": 6, "divers": 10, "dm": 2, "do": [8, 10, 14, 15, 16], "doc": 15, "document": [1, 12, 14], "doe": [11, 14, 17], "don": [10, 11], "done": 10, "doqueri": 6, "download": 16, "dr1": [0, 10], "drag": 7, "dropaxi": 8, "dss2": [2, 5, 9], "e": 10, "each": 8, "earth": [14, 17], "edg": 4, "edgecolor": [8, 14], "edit": [10, 18], "editor": 18, "edr3": 3, "effect": 1, "eg": 14, "either": [1, 10, 14, 16], "element": [1, 14, 17], "elev": 11, "ellips": 8, "ellipseskyregion": [8, 14], "elysium": 11, "enclos": 7, "end": 8, "error": 10, "et": 11, "event": [6, 7, 14], "everyth": 10, "ex": [14, 18], "exact": 8, "exampl": [3, 8, 14, 15, 16, 17], "execut": [6, 7, 10, 14], "expand": 14, "export": 14, "expos": 17, "express": 1, "external_radiu": 4, "extract": 10, "f": [1, 6], "f08080": 2, "facecolor": 14, "fals": [5, 7, 9, 18], "far": 10, "featur": 15, "few": [1, 6, 18], "ff89ff": [1, 2], "field": [1, 14, 17, 18], "file": [14, 15, 17], "filenam": 8, "fill_color": [4, 14], "fillcolor": 14, "find": [15, 18], "first": [1, 2, 8, 10, 11, 14], "fit": [1, 8, 14, 17], "fk5": 8, "fl8y": 3, "flex": [5, 6, 7], "flex_flow": [5, 6, 7], "flip": 10, "flipud": 10, "float": [2, 14], "floatslid": 9, "follow": [5, 8, 10], "footprint": 4, "forg": 16, "form": 2, "format": [6, 8, 10, 14, 15, 18], "found": 1, "fov": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14], "fov_xi": [10, 14], "fr": [1, 2, 4, 6, 11], "frame": [1, 8, 10, 18], "from": [0, 1, 2, 5, 6, 7, 9, 11, 14, 16, 17], "from_nam": [8, 10], "from_r": 4, "full": [1, 18], "full_screen": 18, "fullscreen": 18, "func": 14, "function": [17, 18], "g": 10, "g184": 3, "gaia": 3, "galact": [0, 1, 10], "gazett": [11, 14], "gca": 8, "gener": [1, 2, 10, 12, 14], "get": [6, 14, 17], "get_jpeg_thumbnail": 14, "get_object_data": 2, "get_object_ra_dec_product": 2, "get_view_as_fit": [10, 14], "git": 15, "github": 16, "given": [14, 18], "glimpse360": 9, "go": 18, "grab": 10, "grai": 8, "graphic": [14, 17], "graphic_opt": 14, "green": 8, "grid": 18, "grid_color": 18, "grid_opac": 18, "grid_opt": 18, "gt": [1, 8], "gui": 17, "guid": 16, "h": [3, 6], "h2": 6, "ha": [14, 18], "have": [7, 8, 10, 14, 15, 16, 18], "hdu": 1, "hdu_list": 8, "hdulist": 14, "header": [8, 10], "healpix": 14, "height": [0, 7, 8, 10, 14], "hella": 11, "here": [1, 2, 10, 11, 18], "hex": 18, "hfi": 10, "hip2": 2, "hips2fit": 14, "home": [11, 17], "horizont": [9, 14], "how": [10, 17], "howev": [10, 18], "href": 1, "html": [1, 6, 7, 15, 18], "http": [1, 2, 4, 6, 8, 11, 15, 16], "huski": 15, "i": [1, 2, 3, 10, 11, 14, 15, 16, 18], "icr": [1, 6, 8], "icrsd": 1, "idea": 14, "ident": 1, "ii_337_vvv1": 4, "illustr": [1, 2, 14, 17], "imag": [1, 2, 8, 9, 14, 17], "image_format": [10, 14], "image_opt": 14, "img": [6, 10], "implement": 3, "import": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16], "improv": 15, "imread": 10, "imshow": [8, 10], "includ": [10, 14], "index": 14, "indic": [10, 14, 18], "info": [6, 8], "inform": [2, 10, 14, 15, 17], "init_opt": 14, "initi": [1, 17], "instal": [10, 17], "instanc": 10, "instanti": 16, "instead": [3, 14], "instruct": 16, "int": 14, "intend": 10, "interact": [0, 1, 14, 17, 18], "interfac": 10, "intern": 14, "internal_radiu": 4, "intersect": 8, "io": [8, 14], "ipyaladin": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 16, 18], "ipynb": 8, "ipywidget": [5, 6, 7, 9, 18], "isidi": 11, "issu": [15, 18], "item": 5, "its": [2, 10, 14, 16, 18], "j": [2, 15], "j0534": 3, "j053431": 3, "j05343217": 3, "j053434": 3, "j05343755": 3, "j05343759": 3, "j05343821": 3, "j2000": 8, "javascript": [14, 17], "jcmtsf": 3, "jpeg": [10, 14], "jslink": 5, "json": [2, 6], "jupyt": [10, 14, 18], "keep": 17, "kei": 14, "kernel": 15, "keyword": 14, "know": 18, "label": 18, "lang": 6, "lat": 4, "later": 18, "latest": 16, "latitud": [11, 14], "layer": [1, 14, 18], "layout": [5, 6, 7], "lbc2011": 3, "left": 10, "len": 6, "length": 3, "let": [1, 2, 8, 11], "level": [5, 13], "librari": [14, 18], "lightskyblu": 3, "like": 15, "line": [3, 8, 10], "line_width": [4, 14], "lineskyregion": [8, 14], "linewidth": 14, "link": 17, "list": [1, 8, 10, 14, 18], "listen": [2, 14, 15], "listener_typ": 14, "lite": [10, 11, 14, 15, 17, 18], "liter": 2, "live": 15, "ll": [10, 15], "lmc": [2, 10], "load": [10, 14], "local": 3, "locat": 18, "logo": [10, 14], "lon": 4, "longer": 10, "longitud": [11, 14], "look": [8, 11, 14, 16], "lot": 18, "lt": [1, 8], "m": [1, 3, 5, 6, 7, 8, 15], "m1": [1, 10], "m10": 1, "m31": [1, 8, 10], "ma": [3, 11], "machin": 16, "made": [15, 17], "main_id": [6, 7], "main_idradecra_precdec_preccoo_err_majacoo_err_minacoo_err_anglecoo_qualcoo_wavelengthcoo_bibcodescript_number_id": 3, "make": [15, 18], "map": 14, "mar": 11, "marineri": 11, "marker": [1, 14], "marmo": 11, "mars_featur": 11, "mars_viking_mdim21": 11, "masmasdeg": 3, "matplotlib": [8, 10], "max": [2, 9], "max_depth": 4, "mdim21": 11, "mean": [10, 15], "melling": 4, "menu": 18, "messier": [1, 3], "meta": [2, 3], "method": [1, 10, 14, 17], "middl": 18, "might": 18, "mileston": 15, "mimic": 10, "min": 9, "mix": 9, "moc": [8, 10, 14, 17], "moc_dict": 14, "moc_opt": 14, "moc_url": 14, "mocpi": [14, 17], "mode": 18, "modifi": [1, 10], "modul": 15, "mon": 11, "mont": 11, "more": [1, 16, 18], "most": 10, "mot": 16, "move": 5, "multi": 17, "multipl": 10, "must": 14, "my_sample_t": 3, "name": [1, 3, 6, 7, 8, 9, 10, 11, 14, 18], "ned": 14, "need": [15, 16, 18], "never": 18, "new": [9, 10, 14, 15, 18], "next": [1, 10], "noachi": 11, "nomenclatur": [11, 14], "nominatim": 14, "none": [6, 7, 9, 14, 18], "norm": 10, "note": [14, 17], "notebook": [10, 14, 15, 16, 17], "now": 8, "np": 10, "npm": [15, 16], "npmj": 16, "npolygon": 8, "nside": 4, "number": 14, "numpi": 10, "nvss": 3, "obj_coo": 6, "obj_data": 6, "obj_nam": 6, "object": [1, 2, 10, 11, 14, 17], "object_click": [2, 14], "object_hov": [2, 14], "objectstr13str13int16int16float32float32int16str1str1objectint32": 3, "observ": 9, "oc": 2, "olympu": 11, "on_button_click": 7, "on_click": [2, 7], "on_survey_overlay_value_chang": 9, "on_survey_value_chang": 9, "on_surveyoverlay_opacity_value_chang": 9, "on_zoom_slider_value_chang": 9, "onc": [6, 7], "one": [2, 3, 5, 8, 15], "onli": 14, "onlin": 14, "opac": [1, 4, 9, 14, 18], "opacity_slid": 9, "open": [8, 15, 16], "openstreetmap": [11, 14], "oper": 8, "opt": 10, "optim": 17, "option": [2, 9, 16, 17], "order": [6, 14, 17], "org": 15, "orient": 9, "origin": 18, "orion": 9, "other": [3, 5, 9, 10, 11, 14, 15], "otherwis": 14, "our": 2, "out": [2, 10, 18], "outflow": 11, "output": [10, 14, 18], "outsid": 18, "overflow": 7, "overlai": [1, 9, 14, 17], "overlay_opt": 14, "overlay_survei": [1, 9], "overlay_survey_opac": [1, 9], "ow": 18, "own": [2, 8, 18], "p": [0, 1, 2, 4, 5, 9, 10, 11], "packag": [8, 13, 14], "page": [12, 15], "pandoc": 15, "panstarr": 10, "parallax": 3, "param": 6, "paramet": [1, 2, 6, 7, 9, 14, 17], "part": 17, "pass": 15, "patch": 8, "path": [1, 10, 14], "pathlib": [1, 14], "patient": 6, "phase": 6, "photometr": 6, "photometri": 14, "photvizpreview": 6, "pink": 1, "pip": [10, 15, 16], "pixel": [10, 14], "plain": 1, "planck": 10, "plane": 0, "planet": 11, "planetari": [14, 17], "planitia": 11, "plckerc": 3, "pleas": 15, "plot": [6, 8], "plt": [8, 10], "pn": 9, "png": [2, 10, 14], "point": [6, 11, 14], "point_siz": 6, "pointer": 18, "polygon": 8, "polygonskyregion": [8, 14], "popup": [1, 14], "posit": [1, 7, 14], "possibl": 14, "practic": 18, "pre": [10, 15], "press": 7, "prettier": 15, "preview": 14, "primari": 8, "primaryhdu": 8, "prime": 1, "prime00": 1, "print": [2, 10], "process": [6, 7], "process_result": [6, 7], "produc": 9, "product": 2, "programmat": 10, "project": [8, 10, 17], "properti": [10, 14], "protocol": 18, "provid": 14, "public": 15, "purpl": [8, 10], "pyplot": [8, 10], "pytest": 15, "python": [2, 14, 17, 18], "qtabl": [3, 14], "qualiti": 14, "queri": [6, 17], "query_region": [3, 7, 10], "quick": 14, "quot": 3, "r": 6, "r2": 10, "ra": [1, 2, 3, 6, 7], "radiu": [3, 7, 8, 10], "radius_arcsec": 6, "rais": 18, "rang": 1, "re": [8, 14, 16], "read": [1, 10], "readi": 14, "readout": 9, "readout_format": 9, "readthedoc": 8, "recent": 10, "recogn": 11, "recov": 10, "rect": 14, "rectangl": [7, 8, 14], "rectangleskyregion": [8, 14], "rectangular": [14, 17], "rectangular_select": 14, "red": [2, 5, 8, 9], "redirect": 18, "redtemperatur": 2, "reduc": 18, "reflect": 10, "region": [10, 14, 17], "regionvisu": [8, 14], "rel": 7, "releas": 17, "render": 18, "repositori": [8, 15, 16], "repres": [8, 11, 14, 18], "represent": 8, "request": [6, 15, 17], "research": 15, "resolv": 14, "restart": 15, "result": [6, 17], "reticl": 18, "reticle_color": [1, 2, 18], "reticle_s": [1, 18], "retriev": [14, 17], "return": [2, 6, 10, 11, 14, 18], "rgb": 18, "rhomb": 3, "right": [7, 10, 18], "rm": 2, "root": 16, "rotat": 10, "row": [5, 6, 7], "row_limit": 10, "ruff": 15, "run": [6, 14, 16, 17], "same": [8, 10, 14], "samp": 18, "save": [2, 14, 17], "save_view_as_imag": [2, 10, 14], "scientif": [10, 14], "scope": 3, "scratch": 17, "screen": [10, 18], "screenshot": 10, "screenshot_wc": 10, "search": [1, 14], "second": [6, 10], "section": 16, "sed_img": 6, "see": [7, 10, 11, 14, 15, 16, 18], "seen": 10, "select": [6, 14, 17], "selected_object": [10, 14], "selection_typ": 14, "send": [2, 10, 18], "server": [10, 15], "servic": 14, "sesam": 14, "set": [1, 14, 16, 17], "set_color_map": [2, 14], "set_listen": [2, 6, 7, 14], "sever": 10, "sgr": 1, "shape": [1, 3, 10, 11, 14, 17], "share": [15, 18], "should": [10, 14, 16, 18], "show": 18, "show_catalog": 18, "show_context_menu": 18, "show_coo_grid": [0, 18], "show_coo_grid_control": 18, "show_coo_loc": 18, "show_fov": 18, "show_fram": 18, "show_fullscreen_control": [5, 7, 18], "show_layers_control": 18, "show_projection_control": [5, 7, 18], "show_reticl": 18, "show_settings_control": 18, "show_share_control": 18, "show_simbad_pointer_control": 18, "show_status_bar": [2, 18], "show_zoom_control": 18, "shown": 18, "showtabl": 2, "side": [2, 15, 17], "sim": [1, 6], "simbad": [1, 3, 6, 7, 10, 14, 18], "similar": 18, "simpli": 10, "sinc": [10, 11], "singl": 14, "size": 18, "sky": [0, 2, 11, 14], "skycoord": [1, 8, 10, 11, 14], "slider": 9, "slower": 18, "snake_cas": 3, "so": 10, "softwar": 18, "solar": 14, "solid": 5, "some": 18, "sourc": [2, 7, 10, 14], "source_s": [1, 2, 3, 10, 11], "sources": 3, "space": 17, "specifi": 18, "speed": 18, "sphinx": 12, "squar": 10, "src": 6, "star": 6, "start": [8, 11, 15, 17, 18], "startup": 18, "statu": 18, "stc": [14, 17], "stc_string": 14, "step": 9, "still": 17, "store": 10, "str": 14, "strasbg": [4, 6, 11], "strasbourg": [11, 15], "stretch": [5, 6, 7], "string": [1, 8, 14], "submit": 1, "submodul": 17, "subplot": [8, 10], "subset": 8, "support": [8, 14], "supportedregion": 14, "surfac": 11, "survei": [0, 1, 2, 4, 5, 9, 10, 14, 17, 18], "survey_overlay_selector": 9, "survey_selector": 9, "switch": 10, "sync": 6, "synchron": 5, "system": [10, 14], "t": [3, 10, 11, 14], "tab": 14, "tabl": [4, 7, 10, 11, 14, 17], "table_info": 7, "table_opt": 14, "take": 10, "tap": 6, "target": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14], "tau05": 3, "td": 7, "teal": [4, 10], "temp": 11, "termin": [15, 16], "terra": 11, "test": 17, "text": 1, "th": 7, "than": [10, 15], "thank": 15, "tharsi": 11, "thei": [1, 8, 14, 15], "them": [1, 2, 7, 8], "thi": [3, 10, 11, 12, 14, 15, 16, 17, 18], "third": 10, "through": 10, "time": [10, 17], "titl": 1, "to_pixel": 8, "togglebutton": 9, "tool": 14, "toolbar": 18, "tooltip": 9, "top": [1, 6, 13], "tour": 16, "toward": 18, "tr": 7, "traitlet": 15, "trigger": [2, 7, 10, 14], "trimbl": 3, "true": [0, 2, 4, 9, 10, 14, 18], "try": [5, 10], "tupl": 14, "two": [3, 8, 10, 14], "type": [8, 14], "u": [3, 4, 6, 7, 10, 11], "uint8": 8, "union": [8, 14], "unistra": [1, 2], "unit": [3, 4, 7, 8, 10, 14], "unreleas": 17, "until": 15, "unzoom": 11, "updat": 10, "url": [2, 14, 17], "us": [10, 14, 15, 17], "useful": 14, "user": [14, 16], "usno": 10, "utopia": 11, "v": 3, "vall": 11, "valu": [2, 6, 7, 9, 10, 14, 18], "vastita": 11, "vbox": 9, "ve": 10, "ver": 8, "veri": 18, "version": 17, "vertic": 8, "via": 18, "view": [0, 1, 2, 5, 7, 11, 14, 17], "viewport": 18, "vike": 11, "violet": 4, "visual": [8, 14], "viz": 2, "vizier": [2, 4, 10, 14], "vmin": 10, "votabl": [2, 14], "votable_opt": 14, "votable_url": 14, "vscode": 14, "w": 6, "wa": 15, "wai": [10, 14, 18], "want": [2, 10], "wc": [8, 11, 14, 17], "we": [1, 2, 10, 11, 15, 17, 18], "webp": [10, 14], "webpag": 16, "welcom": 15, "wether": 18, "when": [2, 10, 14, 18], "where": [6, 10, 14, 18], "whether": [14, 18], "which": 18, "whose": 2, "why": 11, "widget": [1, 6, 7, 8, 9, 11, 12, 13, 15], "widget_should_be_load": 14, "widgetcommunicationerror": 10, "widgetnotreadyerror": 10, "widgetreducederror": 18, "width": [5, 6, 7, 8], "window": [14, 18], "wish": 7, "with_logo": [10, 14], "without": 14, "won": 14, "work": [3, 8, 10, 11, 14, 17], "workaround": 18, "world": [10, 14], "would": 15, "wrap": 15, "wrapper": 14, "write": 2, "written": [1, 10], "wrong": 18, "www": 16, "x": [1, 10], "xmm": 9, "y": 10, "yellow": 8, "you": [1, 2, 7, 8, 10, 11, 14, 15, 16, 18], "your": [15, 16, 18], "zoom": [5, 9, 18], "zoom_slid": 9}, "titles": ["Getting Started", "Aladin commands", "Use of functions on ipyaladin widgets", "Display tables resulting from an astroquery request", "Display of a Multi Order Coverage (MOC)", "Linked widgets", "On click callback", "Example of interactive rectangular selection", "Adding shapes / graphic overlays", "Advanced GUI", "Retrieving data from the current widget\u2019s view", "Planetary surveys", "API Reference", "ipyaladin", "ipyaladin.widget", "Community", "Getting Started", "The ipyaladin jupyter widget", "User Documentation"], "titleterms": {"": [10, 18], "1": 18, "2": 18, "On": 6, "The": 17, "about": 18, "ad": [8, 18], "add": 8, "advanc": [9, 18], "aladin": 1, "an": [3, 4, 10], "api": [12, 17], "astropi": [3, 8], "astroqueri": 3, "between": 14, "build": 15, "built": 2, "callback": 6, "check": 15, "class": 14, "click": 6, "command": 1, "commun": 15, "content": 14, "contribut": [15, 17], "coordin": 8, "correspond": 14, "coverag": 4, "creat": 3, "current": [10, 18], "data": 10, "detach": 18, "develop": 15, "dictionnari": 4, "disabl": 18, "displai": [3, 4], "document": [15, 17, 18], "doe": 15, "earth": 11, "element": 18, "exampl": 7, "field": 10, "file": 10, "fit": 10, "from": [3, 4, 8, 10, 18], "function": [2, 14], "get": [0, 10, 16], "graphic": 8, "gui": 9, "guid": 17, "home": 2, "how": 15, "imag": 10, "inform": 18, "initi": 18, "instal": [15, 16], "interact": 7, "ipyaladin": [2, 13, 14, 17], "javascript": 15, "jupyt": 17, "keep": 18, "link": 5, "made": 2, "method": 2, "moc": 4, "mocpi": 4, "modul": 14, "multi": 4, "note": 18, "notebook": 18, "object": [4, 8], "optim": 18, "option": [14, 18], "order": 4, "overlai": 8, "paramet": 18, "planetari": 11, "python": 15, "queri": 3, "rectangular": 7, "refer": 12, "region": 8, "releas": 16, "request": 3, "result": 3, "retriev": [10, 18], "run": 15, "save": 10, "scratch": 3, "select": [7, 10], "set": 18, "shape": 8, "side": 18, "space": 8, "start": [0, 16], "stc": 8, "still": 15, "submodul": 13, "survei": 11, "tabl": 3, "test": 15, "time": 8, "unreleas": 16, "url": 4, "us": [2, 16, 18], "user": [17, 18], "version": 16, "view": [10, 18], "wc": [10, 18], "widget": [2, 5, 10, 14, 16, 17, 18], "work": 15}}) \ No newline at end of file diff --git a/user_documentation/user_documentation.html b/user_documentation/user_documentation.html index 503b0d4..4285155 100644 --- a/user_documentation/user_documentation.html +++ b/user_documentation/user_documentation.html @@ -8,7 +8,7 @@ - User Documentation — ipyaladin 0.5.0 documentation + User Documentation — ipyaladin 0.5.1 documentation @@ -39,7 +39,7 @@ - +

MAIN_IDRADECRA_PRECDEC_PRECCOO_ERR_MAJACOO_ERR_MINACOO_ERR_ANGLECOO_QUALCOO_WAVELENGTHCOO_BIBCODESCRIPT_NUMBER_ID
"h:m:s""d:m:s"masmasdeg
objectstr13str13int16int16float32float32int16str1str1objectint32