Skip to content

Instantly share code, notes, and snippets.

@nmearl
Created April 17, 2020 16:53
Show Gist options
  • Save nmearl/40633b2272b534bf0cac5961b327fa28 to your computer and use it in GitHub Desktop.
Save nmearl/40633b2272b534bf0cac5961b327fa28 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from jdaviz.app import Application\n",
"\n",
"app = Application(configuration='cubeviz')\n",
"app"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from astropy.utils.data import download_file\n",
"\n",
"# fn = download_file('https://data.sdss.org/sas/dr14/manga/spectro/redux/v2_1_2/7495/stack/manga-7495-12704-LOGCUBE.fits.gz', cache=True)\n",
"app.load_data(\"/Users/nearl/data/cubeviz/MaNGA/manga-7495-12704-LOGCUBE.fits\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Control the collapse state of the first viewer's toolbar\n",
"app.state.stack_items[0]['children'][0]['viewers'][0]['collapse'] = False"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Append new id values to the `selected_data_items` list to toggle what's plotted in the viewer\n",
"new_id = app.state.data_items[0]['id']\n",
"app.state.stack_items[0]['children'][0]['viewers'][0]['selected_data_items'].append(new_id)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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.8.2"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment