-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding NB demo for roman ramps in cubeviz
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "b3e22694-d8ee-4c14-8931-8f8db1d7485d", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"source": [ | ||
"## PoC: Visualize a Roman L1 ramp file in Cubeviz\n", | ||
"\n", | ||
"First download a synthetic Roman L1 file:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e80524dd-bcc5-4312-879a-33780e297006", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import os\n", | ||
"from urllib.request import urlretrieve\n", | ||
"\n", | ||
"url_L1 = \"https://stsci.box.com/shared/static/24gpvqb9676acdy6hjvymc2llgcny8ul.asdf\"\n", | ||
"local_path = \"L1.asdf\"\n", | ||
"\n", | ||
"if not os.path.exists(local_path):\n", | ||
" urlretrieve(url_L1, local_path)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "0f94fbf1-6f4c-4118-917d-de824af57fe6", | ||
"metadata": {}, | ||
"source": [ | ||
"Open the ramp in Cubeviz:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "863ce611-bf38-4a97-bd1d-c0ff79d36073", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from jdaviz import Cubeviz\n", | ||
"\n", | ||
"cubeviz = Cubeviz()\n", | ||
"cubeviz.load_data(local_path, data_label='Roman L1')\n", | ||
"cubeviz.show(height=1000)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"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.11.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |