Skip to content

Commit

Permalink
adding ipyvuetify depedency, and specutils while i'm at it
Browse files Browse the repository at this point in the history
  • Loading branch information
SaOgaz committed May 23, 2019
1 parent 91695f4 commit 64949e4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 283 deletions.
55 changes: 42 additions & 13 deletions examples/cubeviz-example.ipynb
Expand Up @@ -50,9 +50,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Matplotlib is building the font cache using fc-list. This may take a moment.\n"
]
}
],
"source": [
"from jdaviz.vizcomponents.applications import cubeviz\n",
"from jdaviz.vizcomponents.vizapp import VizApp\n",
Expand All @@ -68,33 +76,54 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: FITSFixedWarning: PLATEID = 7495 / Current plate \n",
"a string value was expected. [astropy.wcs.wcs]\n",
"WARNING:astropy:FITSFixedWarning: PLATEID = 7495 / Current plate \n",
"a string value was expected.\n",
"/Users/ogaz/miniconda3/envs/test/lib/python3.6/site-packages/glue/viewers/common/viewer.py:179: UserWarning: Add large data set?\n",
" warnings.warn(message)\n"
]
}
],
"source": [
"c = cubeviz.CubeViz(filename, vizapp)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {
"scrolled": true
},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "35b9eea9e569426188b0084c2c1397d3",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Layout(children=[Flex(children=[Layout(children=[Flex(children=[Layout(children=[Menu(children=[Btn(children=[…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"c.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
187 changes: 12 additions & 175 deletions examples/viewer1d-example.ipynb
Expand Up @@ -2,36 +2,14 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style>.container { width:100% !important; }</style>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"from IPython.core.display import display, HTML\n",
"display(HTML(\"<style>.container { width:100% !important; }</style>\"))\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import ipyvuetify as v"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -50,11 +28,11 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"filename = 'manga-7495-12704-LOGCUBE_fixed.fits.gz'"
"filename = '../../../cubeviz/data/manga-7495-12704-LOGCUBE_fixed.fits.gz'"
]
},
{
Expand All @@ -66,57 +44,20 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from jdaviz.vizcomponents.viewer import Viewer1D\n",
"from jdaviz.vizcomponents.viewer import ViewerND\n",
"from jdaviz.vizcomponents.vizapp import VizApp\n",
"vizapp = VizApp()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: FITSFixedWarning: PLATEID = 7495 / Current plate \n",
"a string value was expected. [astropy.wcs.wcs]\n",
"WARNING:astropy:FITSFixedWarning: PLATEID = 7495 / Current plate \n",
"a string value was expected.\n"
]
},
{
"data": {
"text/plain": [
"[[Data (label: manga-7495-12704-LOGCUBE_fixed.fits[FLUX]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[IVAR]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[MASK]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[WAVE]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[SPECRES]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[SPECRESD]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[OBSINFO]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[UIMG]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[GIMG]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[RIMG]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[IIMG]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[ZIMG]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[UPSF]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[GPSF]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[RPSF]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[IPSF]),\n",
" Data (label: manga-7495-12704-LOGCUBE_fixed.fits[ZPSF])]]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"vizapp.glue_app.add_data(filename)"
]
Expand All @@ -130,126 +71,22 @@
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"vnd = Viewer1D(vizapp)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a1ec49990bcd48f59bd4a0370f4376f9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Layout(children=[VBox(children=(HBox(children=(BasicJupyterToolbar(children=(ToggleButton(children=(Image(valu…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"vnd.show()"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"out = vnd.show()"
"vnd = ViewerND(vizapp)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fe109f0f2c09462ba3b202309c2fd814",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Layout(children=[VBox(children=(HBox(children=(BasicJupyterToolbar(children=(ToggleButton(children=(Image(valu…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"def on_menu_click(widget, event, data):\n",
" if len(layout.children) == 1:\n",
" layout.children = layout.children + [info]\n",
" info.children=[f'Item {items.index(widget)+1} clicked']\n",
" \n",
"\n",
"items = [v.ListTile(children=[\n",
" v.ListTileTitle(children=[\n",
" f'Click me {i}'])]) \n",
" for i in range(1, 5)]\n",
"\n",
"for item in items:\n",
" item.on_event('click', on_menu_click)\n",
"\n",
"menu = v.Menu(offset_y=True, children=[\n",
" v.Btn(slot='activator', color='primary', children=[\n",
" 'menu', \n",
" v.Icon(right=True, children=[\n",
" 'arrow_drop_down'\n",
" ])\n",
" ]),\n",
" v.List(children=items)\n",
"])\n",
"\n",
"info = v.Chip()\n",
"\n",
"v.Layout(children=[vnd._v1d.main_widget, \n",
" v.Btn(color='primary', children=[v.Icon(left=True, children=['fingerprint']),'Icon left']),\n",
" menu])"
"vnd.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -274,7 +111,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 64949e4

Please sign in to comment.