From 4a724d152d76085827b970ca127946a4b5330905 Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Tue, 22 Aug 2023 14:04:25 -0400 Subject: [PATCH] adding NB demo for roman ramps in cubeviz --- notebooks/concepts/cubeviz-roman-ramp.ipynb | 80 +++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 notebooks/concepts/cubeviz-roman-ramp.ipynb diff --git a/notebooks/concepts/cubeviz-roman-ramp.ipynb b/notebooks/concepts/cubeviz-roman-ramp.ipynb new file mode 100644 index 0000000000..7f3bd40d79 --- /dev/null +++ b/notebooks/concepts/cubeviz-roman-ramp.ipynb @@ -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 +}