Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

niriss imaging: updates to requirements and screenshots #234

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added notebooks/NIRISS/niriss_imaging/cal_science.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/NIRISS/niriss_imaging/i2d_markers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/NIRISS/niriss_imaging/i2d_science.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
200 changes: 180 additions & 20 deletions notebooks/NIRISS/niriss_imaging/niriss-imaging-tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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__}\")"
]
},
{
Expand Down Expand Up @@ -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')"
]
},
{
Expand Down Expand Up @@ -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')"
]
},
{
Expand Down Expand Up @@ -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')"
]
},
{
Expand Down Expand Up @@ -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')"
]
},
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -817,7 +977,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Binary file added notebooks/NIRISS/niriss_imaging/rate_science.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions notebooks/NIRISS/niriss_imaging/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy
crds
jwst>=1.2.3
jdaviz
astropy>=4.3.1
numpy>=1.26.4
crds>=11.17.23
jwst>=1.14.0
jdaviz>=3.10.2
astropy>=6.1.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading