Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tboch committed Jun 28, 2018
1 parent f737b76 commit 6ccc05c
Showing 1 changed file with 163 additions and 0 deletions.
163 changes: 163 additions & 0 deletions examples/advanced-GUI.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import ipyaladin as ipyal\n",
"import ipywidgets as widgets"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "40a6a9f686d14cfb9ae81140973c26a6",
"version_major": 2,
"version_minor": 0
},
"text/html": [
"<p>Failed to display Jupyter Widget of type <code>VBox</code>.</p>\n",
"<p>\n",
" If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean\n",
" that the widgets JavaScript is still loading. If this message persists, it\n",
" likely means that the widgets JavaScript library is either not installed or\n",
" not enabled. See the <a href=\"https://ipywidgets.readthedocs.io/en/stable/user_install.html\">Jupyter\n",
" Widgets Documentation</a> for setup instructions.\n",
"</p>\n",
"<p>\n",
" If you're reading this message in another frontend (for example, a static\n",
" rendering on GitHub or <a href=\"https://nbviewer.jupyter.org/\">NBViewer</a>),\n",
" it may mean that your frontend doesn't currently support widgets.\n",
"</p>\n"
],
"text/plain": [
"VBox(children=(Aladin(fov=2.0, options=['allow_full_zoomout', 'coo_frame', 'fov', 'full_screen', 'log', 'overlay_survey', 'overlay_survey_opacity', 'reticle_color', 'reticle_size', 'show_catalog', 'show_coo_grid', 'show_frame', 'show_fullscreen_control', 'show_goto_control', 'show_layers_control', 'show_reticle', 'show_share_control', 'show_zoom_control', 'survey', 'target'], target='orion'), ToggleButtons(description='Image:', options=('P/DSS2/color', 'P/2MASS/color', 'P/DSS2/red'), tooltips=['DSS2 color', '2MASS color', 'DSS2 red'], value='P/DSS2/color'), HBox(children=(ToggleButtons(description='Overlay:', options=('P/DSS2/color', 'P/2MASS/color', 'P/DSS2/red', 'P/XMM/PN/color', 'P/GLIMPSE360'), tooltips=['DSS2 color', '2MASS color', 'DSS2 red', 'P/XMM/PN/color', 'P/GLIMPSE360'], value='P/DSS2/color'), FloatSlider(value=0.0, description='Opacity:', max=1.0, readout_format='.1f', step=0.05))), FloatSlider(value=90.0, description='Zoom:', max=400.0, min=1.0, readout=False, readout_format='.1f', step=1.0)))"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"aladin = ipyal.Aladin(target= 'orion', fov=2)\n",
"\n",
"survey_selector = widgets.ToggleButtons(\n",
" options=['P/DSS2/color', 'P/2MASS/color', 'P/DSS2/red'],\n",
" description='Image:',\n",
" disabled=False,\n",
" tooltips=['DSS2 color', '2MASS color', 'DSS2 red'],\n",
")\n",
"def on_survey_value_change(change):\n",
" aladin.survey = change['new']\n",
"survey_selector.observe(on_survey_value_change, names='value')\n",
"\n",
" \n",
"survey_overlay_selector = widgets.ToggleButtons(\n",
" options=['P/DSS2/color', 'P/2MASS/color', 'P/DSS2/red', 'P/XMM/PN/color', 'P/GLIMPSE360'],\n",
" description='Overlay:',\n",
" disabled=False,\n",
" tooltips=['DSS2 color', '2MASS color', 'DSS2 red', 'P/XMM/PN/color', 'P/GLIMPSE360'],\n",
")\n",
"def on_survey_overlay_value_change(change):\n",
" aladin.overlay_survey = change['new']\n",
" aladin.overlay_survey_opacity = aladin.overlay_survey_opacity+0.00000001\n",
" \n",
"survey_overlay_selector.observe(on_survey_overlay_value_change, names='value')\n",
"\n",
"overlay_opacity = widgets.FloatSlider(\n",
" value=0.0,\n",
" min=0,\n",
" max=1.0,\n",
" step=0.05,\n",
" description='Opacity:',\n",
" disabled=False,\n",
" continuous_update=True,\n",
" orientation='horizontal',\n",
" readout=True,\n",
" readout_format='.1f',\n",
")\n",
"def on_surveyoverlay_opacity_value_change(change):\n",
" aladin.overlay_survey_opacity = change['new']\n",
" \n",
"overlay_opacity.observe(on_surveyoverlay_opacity_value_change, names='value')\n",
"\n",
"\n",
"zoom_slider = widgets.FloatSlider(\n",
" value=180/aladin.fov,\n",
" min=1,\n",
" max=400,\n",
" step=1,\n",
" description='Zoom:',\n",
" disabled=False,\n",
" continuous_update=True,\n",
" orientation='horizontal',\n",
" readout=False,\n",
" readout_format='.1f',\n",
") \n",
"def on_zoom_slider_value_change(change):\n",
" aladin.fov = 180/change['new']\n",
"zoom_slider.observe(on_zoom_slider_value_change, names='value')\n",
"\n",
"\n",
"widgets.VBox([aladin, survey_selector, widgets.HBox([survey_overlay_selector, overlay_opacity]), zoom_slider])"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"''"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 6ccc05c

Please sign in to comment.