diff --git a/notebooks/NIRISS/niriss_imaging/cal_science.png b/notebooks/NIRISS/niriss_imaging/cal_science.png new file mode 100644 index 000000000..37f629438 Binary files /dev/null and b/notebooks/NIRISS/niriss_imaging/cal_science.png differ diff --git a/notebooks/NIRISS/niriss_imaging/i2d_markers.png b/notebooks/NIRISS/niriss_imaging/i2d_markers.png new file mode 100644 index 000000000..c724268c5 Binary files /dev/null and b/notebooks/NIRISS/niriss_imaging/i2d_markers.png differ diff --git a/notebooks/NIRISS/niriss_imaging/i2d_science.png b/notebooks/NIRISS/niriss_imaging/i2d_science.png new file mode 100644 index 000000000..c45ecc788 Binary files /dev/null and b/notebooks/NIRISS/niriss_imaging/i2d_science.png differ diff --git a/notebooks/NIRISS/niriss_imaging/niriss-imaging-tutorial.ipynb b/notebooks/NIRISS/niriss_imaging/niriss-imaging-tutorial.ipynb index 962a32414..0c27bb638 100755 --- a/notebooks/NIRISS/niriss_imaging/niriss-imaging-tutorial.ipynb +++ b/notebooks/NIRISS/niriss_imaging/niriss-imaging-tutorial.ipynb @@ -67,8 +67,10 @@ "import zipfile\n", "import numpy as np\n", "import urllib.request\n", + "from IPython.display import Image\n", "\n", "# For visualizing images\n", + "import jdaviz\n", "from jdaviz import Imviz\n", "\n", "# Astropy routines for visualizing detected sources:\n", @@ -87,7 +89,8 @@ "from jwst.associations.lib.rules_level3_base import DMS_Level3_Base\n", "\n", "# To confirm which version of the pipeline you're running:\n", - "print(f\"jwst pipeline version: {jwst.__version__}\")" + "print(f\"jwst pipeline version: {jwst.__version__}\")\n", + "print(f\"jdaviz version: {jdaviz.__version__}\")" ] }, { @@ -232,9 +235,39 @@ "metadata": {}, "outputs": [], "source": [ - "viewer_uncal.stretch = 'sqrt'\n", - "viewer_uncal.set_colormap('Viridis')\n", - "viewer_uncal.cuts = '99.5%'" + "plotopt = imviz_uncal.plugins['Plot Options']\n", + "plotopt.stretch_function = 'sqrt'\n", + "plotopt.image_colormap = 'Viridis'\n", + "plotopt.stretch_preset = '99.5%'\n", + "plotopt.zoom_radius = 1024" + ] + }, + { + "cell_type": "markdown", + "id": "461d20dc-3d7b-42a2-a661-71fb34d74c08", + "metadata": {}, + "source": [ + "The viewer looks like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "26c2d93f-ae6c-476d-b5be-bb04ed454c9f", + "metadata": {}, + "outputs": [], + "source": [ + "viewer_uncal.save('./uncal_science.png')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c68e2751-e6f2-4122-b9df-17a9460fa9f4", + "metadata": {}, + "outputs": [], + "source": [ + "Image('./uncal_science.png')" ] }, { @@ -383,9 +416,39 @@ "metadata": {}, "outputs": [], "source": [ - "viewer_rate.stretch = 'sqrt'\n", - "viewer_rate.set_colormap('Viridis')\n", - "viewer_rate.cuts = '95%'" + "plotopt = imviz_rate.plugins['Plot Options']\n", + "plotopt.stretch_function = 'sqrt'\n", + "plotopt.image_colormap = 'Viridis'\n", + "plotopt.stretch_preset = '95%'\n", + "plotopt.zoom_radius = 1024" + ] + }, + { + "cell_type": "markdown", + "id": "5d058328-4929-4508-8aa3-4b2bbc29fa78", + "metadata": {}, + "source": [ + "The viewer looks like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f7a0f37d-c700-41fe-863e-6d528adeacb0", + "metadata": {}, + "outputs": [], + "source": [ + "viewer_rate.save('./rate_science.png')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1084538d-55af-45e6-bcfc-d1cfd26abcec", + "metadata": {}, + "outputs": [], + "source": [ + "Image('./rate_science.png')" ] }, { @@ -522,9 +585,39 @@ "metadata": {}, "outputs": [], "source": [ - "viewer_cal.stretch = 'sqrt'\n", - "viewer_cal.set_colormap('Viridis')\n", - "viewer_cal.cuts = '95%'" + "plotopt = imviz_cal.plugins['Plot Options']\n", + "plotopt.stretch_function = 'sqrt'\n", + "plotopt.image_colormap = 'Viridis'\n", + "plotopt.stretch_preset = '95%'\n", + "plotopt.zoom_radius = 1024" + ] + }, + { + "cell_type": "markdown", + "id": "96c99af7-77e4-42cf-ad11-782697eb8f30", + "metadata": {}, + "source": [ + "The viewer looks like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4098cbfb-f303-494b-bd67-91825d8d238c", + "metadata": {}, + "outputs": [], + "source": [ + "viewer_cal.save('./cal_science.png')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e54d1b8c-c246-49cb-b736-bcbf04c1b575", + "metadata": {}, + "outputs": [], + "source": [ + "Image('./cal_science.png')" ] }, { @@ -693,9 +786,39 @@ "metadata": {}, "outputs": [], "source": [ - "viewer_i2d.stretch = 'sqrt'\n", - "viewer_i2d.set_colormap('Viridis')\n", - "viewer_i2d.cuts = '95%'" + "plotopt = imviz_i2d.plugins['Plot Options']\n", + "plotopt.stretch_function = 'sqrt'\n", + "plotopt.image_colormap = 'Viridis'\n", + "plotopt.stretch_preset = '95%'\n", + "plotopt.zoom_radius = 1024" + ] + }, + { + "cell_type": "markdown", + "id": "0c1d744e-7578-4b52-ab2a-1eae60099494", + "metadata": {}, + "source": [ + "The viewer looks like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8741cd67-07dc-4fd6-b601-de585a889cf8", + "metadata": {}, + "outputs": [], + "source": [ + "viewer_i2d.save('./i2d_science.png')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7295d492-f955-4076-979f-6f95678a9f01", + "metadata": {}, + "outputs": [], + "source": [ + "Image('./i2d_science.png')" ] }, { @@ -757,15 +880,24 @@ "imviz_cat = Imviz()\n", "viewer_cat = imviz_cat.default_viewer\n", "imviz_cat.load_data(i2d)\n", - "\n", - "# Adjust settings for viewer\n", - "viewer_cat.stretch = 'sqrt'\n", - "viewer_cat.set_colormap('Viridis')\n", - "viewer_cat.cuts = '95%'\n", - "\n", "imviz_cat.show()" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "e8271e84-d5b6-4ba9-9b32-cfeef22ff2e2", + "metadata": {}, + "outputs": [], + "source": [ + "# Adjust settings for viewer\n", + "plotopt = imviz_cat.plugins['Plot Options']\n", + "plotopt.stretch_function = 'sqrt'\n", + "plotopt.image_colormap = 'Viridis'\n", + "plotopt.stretch_preset = '95%'\n", + "plotopt.zoom_radius = 1024" + ] + }, { "cell_type": "markdown", "id": "bb9dc081-7a24-442c-bf86-ed2faa6cf342", @@ -792,6 +924,34 @@ "viewer_cat.add_markers(ext_coord, use_skycoord=True, marker_name='extended_sources')" ] }, + { + "cell_type": "markdown", + "id": "897cfc34-4978-44df-836e-1e3ee964bf49", + "metadata": {}, + "source": [ + "Viewer looks like this:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a7e9494-8856-4fed-96a7-776a1ba41b07", + "metadata": {}, + "outputs": [], + "source": [ + "viewer_cat.save('./i2d_markers.png')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "afbd59ea-db29-444e-80a5-b412aa1460e3", + "metadata": {}, + "outputs": [], + "source": [ + "Image('./i2d_markers.png')" + ] + }, { "cell_type": "markdown", "id": "1c1d9abd-b2d4-4c5d-a5ed-a1ef98e136fd", @@ -817,7 +977,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.6" + "version": "3.11.9" } }, "nbformat": 4, diff --git a/notebooks/NIRISS/niriss_imaging/rate_science.png b/notebooks/NIRISS/niriss_imaging/rate_science.png new file mode 100644 index 000000000..54b6ce1b5 Binary files /dev/null and b/notebooks/NIRISS/niriss_imaging/rate_science.png differ diff --git a/notebooks/NIRISS/niriss_imaging/requirements.txt b/notebooks/NIRISS/niriss_imaging/requirements.txt index c6fb7dc62..82e53b572 100644 --- a/notebooks/NIRISS/niriss_imaging/requirements.txt +++ b/notebooks/NIRISS/niriss_imaging/requirements.txt @@ -1,5 +1,5 @@ -numpy -crds -jwst>=1.2.3 -jdaviz -astropy>=4.3.1 \ No newline at end of file +numpy>=1.26.4 +crds>=11.17.23 +jwst>=1.14.0 +jdaviz>=3.10.2 +astropy>=6.1.0 \ No newline at end of file diff --git a/notebooks/NIRISS/niriss_imaging/uncal_science.png b/notebooks/NIRISS/niriss_imaging/uncal_science.png new file mode 100644 index 000000000..b96ebd898 Binary files /dev/null and b/notebooks/NIRISS/niriss_imaging/uncal_science.png differ