From 45a318081a8337e1244a5b5cc6e08a14bf3e4a84 Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Thu, 19 Feb 2026 19:46:08 -0500 Subject: [PATCH 1/4] Update allwise to best practices and follow template --- .../irsa-sia-examples/sia_allwise_atlas.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 tutorials/irsa-sia-examples/sia_allwise_atlas.md diff --git a/tutorials/irsa-sia-examples/sia_allwise_atlas.md b/tutorials/irsa-sia-examples/sia_allwise_atlas.md new file mode 100644 index 00000000..3dd8c0e9 --- /dev/null +++ b/tutorials/irsa-sia-examples/sia_allwise_atlas.md @@ -0,0 +1,228 @@ +--- +jupytext: + text_representation: + extension: .md + format_name: myst + format_version: 0.13 + jupytext_version: 1.19.1 +kernelspec: + name: python3 + display_name: python3 + language: python +--- + +# Searching for AllWISE Atlas Images + ++++ + +## Learning Goals + +By the end of this tutorial, you will: + +* Learn how to access IRSA's WISE AllWISE Atlas (L3a) coadded images via the Simple Image Access (SIA) service. +* identify which of IRSA's AllWISE Atlas images cover a specified coordinate. +* Visualize one of the identified images using Forefly. +* Create and display a cutout of the downloaded image. + ++++ + +## Introduction + +The AllWISE program builds upon the work of the successful Wide-field Infrared Survey Explorer mission [(WISE; Wright et al. 2010)](http://adsabs.harvard.edu/abs/2010AJ....140.1868W) by combining data from the WISE cryogenic and NEOWISE [(Mainzer et al. 2011 ApJ, 731, 53)](http://adsabs.harvard.edu/abs/2011ApJ...731...53M) post-cryogenic survey phases to form the a comprehensive view of the full mid-infrared sky. The AllWISE Images Atlas is comprised of 18,240 4-band calibrated 1.56°x1.56° FITS images, depth-of-coverage and noise maps, and image metadata produced by coadding nearly 7.9 million Single-exposure images from all survey phases. For more information about the WISE mission, see: + +https://irsa.ipac.caltech.edu/Missions/wise.html + +The [NASA/IPAC Infrared Science Archive (IRSA)](https://irsa.ipac.caltech.edu) at Caltech is the archive for AllWISE images and catalogs. The AllWISE Atlas images that are the subject of this tutorial are made accessible via the [International Virtual Observatory Alliance (IVOA)](https://ivoa.net) [Simple Image Access (SIA)](https://wiki.ivoa.net/internal/IVOA/SiaInterface/SIA-V2-Analysis.pdf) protocol. + + +```{note} +IRSA supports both SIA v1 and SIA v2 protocols. The version used depends on the specific dataset. This IRSA [website](https://irsa.ipac.caltech.edu/ibe/sia.html) provides information on which version each service uses and how to access them. Further information on how to access IRSA data with different techniques is available [here](https://irsa.ipac.caltech.edu/docs/program_interface/api_images.html) +``` + ++++ + +## Imports +- `astropy.coordinates` for defining coordinates +- `astropy.nddata` for creating an image cutout +- `astropy.wcs` for interpreting the World Coordinate System header keywords of a fits file +- `astropy.units` for attaching units to numbers passed to the SIA service +- `matplotlib.pyplot` for plotting +- `astropy.io` to manipulate FITS files +- `firefly_client` for visuzlizing images +- `astroquery/ipac.irsa` for data access + +```{code-cell} ipython3 +# Uncomment the next line to install dependencies if needed. +%pip install matplotlib astropy jupyter_firefly_extensions +``` + +```{code-cell} ipython3 +from astropy.coordinates import SkyCoord +from astropy.nddata import Cutout2D +from astropy.wcs import WCS +import astropy.units as u +import matplotlib.pyplot as plt +from astropy.io import fits +from firefly_client import FireflyClient +from astroquery.ipac.irsa import Irsa +``` + +## 1. Define the target + ++++ + +Define coordinates of a bright star + +```{code-cell} ipython3 +ra = 314.30417 +dec = 77.595559 +pos = SkyCoord(ra=ra, dec=dec, unit='deg') +``` + +## 2. Discover AllWISE Atlas images + ++++ + +IRSA provides Simple Image Access (SIA) services for various datasets. A list of available datasets and their access URLs can be found at: + +https://irsa.ipac.caltech.edu/ibe/sia.html + +This tutorial uses SIA v2 for AllWISE Atlas images. + +```{code-cell} ipython3 +names = Irsa.list_collections(filter="allwise") +names + +# We see from the resulting table that the dataset collection we are interested in is called "wise_allwise" +``` + +## 3. Search for images + +```{code-cell} ipython3 +#get a table of all images within 1 arcsecond of our target position + +dataset_name = names['collection'][0] +im_table = Irsa.query_sia(pos=(pos, 1 * u.arcsec), collection=dataset_name) +``` + +Inspect the table that is returned + +```{code-cell} ipython3 +im_table +``` + +```{code-cell} ipython3 +im_table.colnames +``` + +```{code-cell} ipython3 +# Let's look at the values in one of the columns +im_table['energy_bandpassname'] +``` + +## 4.Locate and visualize an image of interest + ++++ + +Let's search the image results for the W3 band image. + +```{code-cell} ipython3 +# You can put the URL from the column "access_url" into a browser to download the file. +# Or you can work with it in Python, as shown below. +w3_mask = im_table['energy_bandpassname'] == 'W3' +w3_table = im_table[w3_mask] + +# Lets look at the access_url of the first one: +image_url = w3_table['access_url'][0] +image_url +``` + +```{code-cell} ipython3 +#Use Astropy to examine the header of the URL from the previous step. + +hdulist = fits.open(image_url) +hdulist.info() +``` + +Download the image and open it in Astropy + +```{code-cell} ipython3 +## 7. Visualize a SPHEREx Spectral Image MEF using the Firefly Python Client. + + +# We will use the open-source astronomy data visualization software Firefly. +# Firefly has a Python client. + +#Open a Firefly viewer in a tab within jupyterlab. + +fc = FireflyClient.make_client(url="https://irsa.ipac.caltech.edu/irsaviewer") +fc = FireflyClient.make_lab_client() + +# Visualize an image by sending its URL to the viewer. + +fc.show_fits_image(file_input=image_url, + plot_id="image", + Title="Image" + ) + +#Try use the interactive tools in the viewer to explore the data. + +``` + +## 5. Extract a cutout and plot it + +```{code-cell} ipython3 +data = hdulist[0].data +wcs = WCS(hdulist[0].header) + +# make 1' x 1' cutout +cutout = Cutout2D(data, position=pos, size=1 * u.arcmin, wcs=wcs) + +# display +plt.figure() +plt.imshow(cutout.data, origin='lower') +plt.colorbar() +``` + +*** + ++++ + +## Acknowledgements + +- [Caltech/IPAC-IRSA](https://irsa.ipac.caltech.edu/) + ++++ + +## About this notebook + ++++ + +## About this notebook + +**Authors:** IRSA Data Science Team, including Troy Raen, Brigitta Sipőcz, Jessica Krick, Andreas Faisst, Jaladh Singhal, Vandana Desai, Dave Shupe + +**Updated:** 16 February 2026 + +**Contact:** [IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or problems. + +**Runtime:** As of the date above, this notebook takes about 20 seconds to run to completion on a machine with 8GB RAM and 4 CPU. +This runtime is dependent on archive servers which means runtime will vary for users. + ++++ + +## Citations + ++++ + +If you use `astropy` for published research, please cite the authors. Follow these links for more information about citing `astropy`: + +* [Citing `astropy`](https://www.astropy.org/acknowledging.html) + ++++ + +Please include the following in any published material that makes use of the WISE data products: + +"This publication makes use of data products from the Wide-field Infrared Survey Explorer, which is a joint project of the University of California, Los Angeles, and the Jet Propulsion Laboratory/California Institute of Technology, funded by the National Aeronautics and Space Administration." + +Please also cite the dataset Digital Object Identifier (DOI): [10.26131/IRSA153](https://www.ipac.caltech.edu/doi/irsa/10.26131/IRSA153) From 7826ef82fe34a1f7037953a65caffc105e576568 Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Thu, 19 Feb 2026 20:22:48 -0500 Subject: [PATCH 2/4] updating text and citations --- .../irsa-sia-examples/sia_allwise_atlas.md | 76 ++++++++----------- 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/tutorials/irsa-sia-examples/sia_allwise_atlas.md b/tutorials/irsa-sia-examples/sia_allwise_atlas.md index 3dd8c0e9..ab9b4908 100644 --- a/tutorials/irsa-sia-examples/sia_allwise_atlas.md +++ b/tutorials/irsa-sia-examples/sia_allwise_atlas.md @@ -36,7 +36,7 @@ The [NASA/IPAC Infrared Science Archive (IRSA)](https://irsa.ipac.caltech.edu) a ```{note} -IRSA supports both SIA v1 and SIA v2 protocols. The version used depends on the specific dataset. This IRSA [website](https://irsa.ipac.caltech.edu/ibe/sia.html) provides information on which version each service uses and how to access them. Further information on how to access IRSA data with different techniques is available [here](https://irsa.ipac.caltech.edu/docs/program_interface/api_images.html) +IRSA supports both SIA v1 and SIA v2 protocols. The version used depends on the specific dataset. This IRSA [website](https://irsa.ipac.caltech.edu/ibe/sia.html) provides information on which version each service uses and how to access them. Further information on how to access IRSA data with different techniques is available [here](https://irsa.ipac.caltech.edu/docs/program_interface/api_images.html). This tutorial uses SIA v2 for AllWISE Atlas images. ``` +++ @@ -49,7 +49,7 @@ IRSA supports both SIA v1 and SIA v2 protocols. The version used depends on the - `matplotlib.pyplot` for plotting - `astropy.io` to manipulate FITS files - `firefly_client` for visuzlizing images -- `astroquery/ipac.irsa` for data access +- `astroquery.ipac.irsa` for IRSA data access ```{code-cell} ipython3 # Uncomment the next line to install dependencies if needed. @@ -83,35 +83,35 @@ pos = SkyCoord(ra=ra, dec=dec, unit='deg') +++ -IRSA provides Simple Image Access (SIA) services for various datasets. A list of available datasets and their access URLs can be found at: - -https://irsa.ipac.caltech.edu/ibe/sia.html - +IRSA provides Simple Image Access (SIA) services for various datasets. A list of available datasets and their access URLs can be found [here](https://irsa.ipac.caltech.edu/ibe/sia.html). This tutorial uses SIA v2 for AllWISE Atlas images. +To search for other datasets on SIA v2, try changing the filter string. +Or remove the filter keyword altogether to get a full list of available SIA v2 datasets at IRSA. ```{code-cell} ipython3 +#first we need to know the name of the dataset on the IRSA system names = Irsa.list_collections(filter="allwise") names # We see from the resulting table that the dataset collection we are interested in is called "wise_allwise" ``` -## 3. Search for images +## 3. Search for images +Which images in the IRSA allwise dataset include our target of interest? ```{code-cell} ipython3 #get a table of all images within 1 arcsecond of our target position - -dataset_name = names['collection'][0] +dataset_name = names['collection'][0] #name of our favorite dataset = "wise_allwise" im_table = Irsa.query_sia(pos=(pos, 1 * u.arcsec), collection=dataset_name) ``` -Inspect the table that is returned - ```{code-cell} ipython3 +# Inspect the table that is returned im_table ``` ```{code-cell} ipython3 +# Look at a list of the column names included in this table im_table.colnames ``` @@ -122,9 +122,9 @@ im_table['energy_bandpassname'] ## 4.Locate and visualize an image of interest -+++ - -Let's search the image results for the W3 band image. +We start by filtering the image results for the W3 band images. +Then look at the header of one of the resulting W3 band images of our target star. +Finally, we use the open-source astronomy data visualization software Firefly to display the fits image in a new tab. ```{code-cell} ipython3 # You can put the URL from the column "access_url" into a browser to download the file. @@ -132,44 +132,33 @@ Let's search the image results for the W3 band image. w3_mask = im_table['energy_bandpassname'] == 'W3' w3_table = im_table[w3_mask] +``` + +```{code-cell} ipython3 # Lets look at the access_url of the first one: image_url = w3_table['access_url'][0] image_url -``` -```{code-cell} ipython3 #Use Astropy to examine the header of the URL from the previous step. - hdulist = fits.open(image_url) hdulist.info() ``` -Download the image and open it in Astropy - ```{code-cell} ipython3 -## 7. Visualize a SPHEREx Spectral Image MEF using the Firefly Python Client. - - -# We will use the open-source astronomy data visualization software Firefly. -# Firefly has a Python client. - -#Open a Firefly viewer in a tab within jupyterlab. - -fc = FireflyClient.make_client(url="https://irsa.ipac.caltech.edu/irsaviewer") +# Open a Firefly viewer in a tab within jupyterlab. fc = FireflyClient.make_lab_client() # Visualize an image by sending its URL to the viewer. - fc.show_fits_image(file_input=image_url, plot_id="image", Title="Image" ) #Try use the interactive tools in the viewer to explore the data. - ``` ## 5. Extract a cutout and plot it +If you want to see just a cutout of a certain region around the target, we do that below using astropy's Cutout2D. ```{code-cell} ipython3 data = hdulist[0].data @@ -196,13 +185,9 @@ plt.colorbar() ## About this notebook -+++ - -## About this notebook - **Authors:** IRSA Data Science Team, including Troy Raen, Brigitta Sipőcz, Jessica Krick, Andreas Faisst, Jaladh Singhal, Vandana Desai, Dave Shupe -**Updated:** 16 February 2026 +**Updated:** 19 February 2026 **Contact:** [IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or problems. @@ -213,16 +198,21 @@ This runtime is dependent on archive servers which means runtime will vary for u ## Citations -+++ +**Astropy:** +To see the Bibtex references for this, uncomment the below cell -If you use `astropy` for published research, please cite the authors. Follow these links for more information about citing `astropy`: +**Astroquery:** +To see the Bibtex references for this, uncomment the below cell -* [Citing `astropy`](https://www.astropy.org/acknowledging.html) +**WISE:** +This publication makes use of data products from the Wide-field Infrared Survey Explorer, which is a joint project of the University of California, Los Angeles, and the Jet Propulsion Laboratory/California Institute of Technology, funded by the National Aeronautics and Space Administration." +Digital Object Identifier (DOI): [10.26131/IRSA153](https://www.ipac.caltech.edu/doi/irsa/10.26131/IRSA153) -+++ -Please include the following in any published material that makes use of the WISE data products: - -"This publication makes use of data products from the Wide-field Infrared Survey Explorer, which is a joint project of the University of California, Los Angeles, and the Jet Propulsion Laboratory/California Institute of Technology, funded by the National Aeronautics and Space Administration." +```{code-cell} ipython3 +#import astropy +#import astroquery -Please also cite the dataset Digital Object Identifier (DOI): [10.26131/IRSA153](https://www.ipac.caltech.edu/doi/irsa/10.26131/IRSA153) +#astropy.__citation__ +#astroquery.__citation__ +``` From 8708df1f80b5fedd493d163e9463a4c2a7dd6097 Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Fri, 20 Feb 2026 11:23:03 -0500 Subject: [PATCH 3/4] fixing ci link problem --- tutorials/irsa-sia-examples/sia_allwise_atlas.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tutorials/irsa-sia-examples/sia_allwise_atlas.md b/tutorials/irsa-sia-examples/sia_allwise_atlas.md index ab9b4908..27a95924 100644 --- a/tutorials/irsa-sia-examples/sia_allwise_atlas.md +++ b/tutorials/irsa-sia-examples/sia_allwise_atlas.md @@ -11,7 +11,7 @@ kernelspec: language: python --- -# Searching for AllWISE Atlas Images +# Searching for AllWISE Images with SIA v2 +++ @@ -32,7 +32,7 @@ The AllWISE program builds upon the work of the successful Wide-field Infrared S https://irsa.ipac.caltech.edu/Missions/wise.html -The [NASA/IPAC Infrared Science Archive (IRSA)](https://irsa.ipac.caltech.edu) at Caltech is the archive for AllWISE images and catalogs. The AllWISE Atlas images that are the subject of this tutorial are made accessible via the [International Virtual Observatory Alliance (IVOA)](https://ivoa.net) [Simple Image Access (SIA)](https://wiki.ivoa.net/internal/IVOA/SiaInterface/SIA-V2-Analysis.pdf) protocol. +The [NASA/IPAC Infrared Science Archive (IRSA)](https://irsa.ipac.caltech.edu) at Caltech is the archive for AllWISE images and catalogs. The AllWISE Atlas images that are the subject of this tutorial are made accessible via the [International Virtual Observatory Alliance (IVOA)](https://ivoa.net) [Simple Image Access (SIA)](https://www.ivoa.net/documents/SIA/) protocol. ```{note} @@ -131,7 +131,6 @@ Finally, we use the open-source astronomy data visualization software Firefly to # Or you can work with it in Python, as shown below. w3_mask = im_table['energy_bandpassname'] == 'W3' w3_table = im_table[w3_mask] - ``` ```{code-cell} ipython3 @@ -208,7 +207,6 @@ To see the Bibtex references for this, uncomment the below cell This publication makes use of data products from the Wide-field Infrared Survey Explorer, which is a joint project of the University of California, Los Angeles, and the Jet Propulsion Laboratory/California Institute of Technology, funded by the National Aeronautics and Space Administration." Digital Object Identifier (DOI): [10.26131/IRSA153](https://www.ipac.caltech.edu/doi/irsa/10.26131/IRSA153) - ```{code-cell} ipython3 #import astropy #import astroquery From 24ec15f162f7d6921b53ba7130c5354c6c238f82 Mon Sep 17 00:00:00 2001 From: jkrick Date: Mon, 23 Feb 2026 10:38:23 -0800 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Jaladh Singhal --- tutorials/irsa-sia-examples/sia_allwise_atlas.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tutorials/irsa-sia-examples/sia_allwise_atlas.md b/tutorials/irsa-sia-examples/sia_allwise_atlas.md index 27a95924..0853ec62 100644 --- a/tutorials/irsa-sia-examples/sia_allwise_atlas.md +++ b/tutorials/irsa-sia-examples/sia_allwise_atlas.md @@ -144,8 +144,11 @@ hdulist.info() ``` ```{code-cell} ipython3 -# Open a Firefly viewer in a tab within jupyterlab. -fc = FireflyClient.make_lab_client() +# Uncomment when opening a Firefly viewer in a tab within Jupyter Lab with jupyter_firefly_extensions installed +# fc = FireflyClient.make_lab_client() + +# Uncomment when opening Firefly viewer in contexts other than the above +fc = FireflyClient.make_client(url="https://irsa.ipac.caltech.edu/irsaviewer") # Visualize an image by sending its URL to the viewer. fc.show_fits_image(file_input=image_url,