From f240350673e7164e93c8e4f905b6cf6394384ecb Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Tue, 13 Jan 2026 15:37:52 -0500 Subject: [PATCH 1/5] changed to query_ssa --- .../3_Euclid_intro_1D_spectra.md | 69 +++++++++++++------ 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md b/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md index b2466968..eb276ad7 100644 --- a/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md +++ b/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md @@ -1,15 +1,14 @@ --- -short_title: "SIR 1D Spectra" jupytext: text_representation: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.7 + jupytext_version: 1.18.1 kernelspec: - display_name: Python 3 (ipykernel) - language: python name: python3 + display_name: python3 + language: python --- # Euclid Q1: SIR 1D Spectra @@ -22,9 +21,8 @@ kernelspec: By the end of this tutorial, you will: - Understand the basic characteristics of Euclid Q1 SIR 1D spectra. -- What columns are available in the MER catalog. -- How to query with ADQL in the MER catalog. -- How to make a simple color-magnitude diagram with the data. +- Examine the provided boolean masks +- Make a simple plot of a Euclid spectrum. +++ @@ -52,7 +50,7 @@ We rely on ``astroquery`` features that have been recently added, so please make ```{code-cell} ipython3 # Uncomment the next line to install dependencies if needed -# !pip install matplotlib astropy 'astroquery>=0.4.10' +!pip install matplotlib astropy 'astroquery>=0.4.10' ``` ```{code-cell} ipython3 @@ -62,44 +60,73 @@ import matplotlib.pyplot as plt from astropy.io import fits from astropy.table import QTable from astropy import units as u +from astropy.coordinates import SkyCoord from astropy.visualization import quantity_support from astroquery.ipac.irsa import Irsa + +#suppress warnings about deprecated units +import warnings +warnings.filterwarnings( + "ignore", + message="The unit 'Angstrom' has been deprecated", + category=u.UnitsWarning, +) + +warnings.filterwarnings( + "ignore", + message="The unit 'erg' has been deprecated", + category=u.UnitsWarning, +) ``` ## 1. Search for the spectrum of a specific galaxy First, explore what Euclid catalogs are available. Note that we need to use the object ID for our targets to be able to download their spectrum. -Search for all tables in IRSA labeled as "euclid". +Search for spectra collections in IRSA. ```{code-cell} ipython3 -Irsa.list_catalogs(filter='euclid') +Irsa.list_collections(servicetype="ssa") ``` ```{code-cell} ipython3 -table_1dspectra = 'euclid.objectid_spectrafile_association_q1' +euclid_ssa_collection = 'euclid_DpdSirCombinedSpectra' ``` ## 2. Search for the spectrum of a specific galaxy in the 1D spectra table ```{code-cell} ipython3 -obj_id = 2689918641685825137 +coord = SkyCoord( + ra=269.7 * u.deg, + dec=66.0 * u.deg +) + +search_radius = 5.0 * u.arcsec ``` -We will use TAP and an ADQL query to find the spectral data for our galaxy. (ADQL is the [IVOA Astronomical Data Query Language](https://www.ivoa.net/documents/latest/ADQL.html) and is based on SQL.) +Query the IRSA SSA service for spectra near this position ```{code-cell} ipython3 -adql_object = f"SELECT * FROM {table_1dspectra} WHERE objectid = {obj_id}" - -# Pull the data on this particular galaxy -result = Irsa.query_tap(adql_object).to_table() +ssa_result = Irsa.query_ssa( + pos=coord, + radius=search_radius, + collection=euclid_ssa_collection, +) + +#check whether any spectra were found +len(ssa_result) ``` Pull out the file name from the ``result`` table: ```{code-cell} ipython3 -spectrum_path = f"https://irsa.ipac.caltech.edu/{result['path'][0]}" +# Extract the single SSA result row +row = ssa_result[0] #in case there is more than one spectra in the search radius + + +# Each SSA row provides a direct URL to the spectrum file +spectrum_path = row["access_url"] spectrum_path ``` @@ -152,13 +179,13 @@ plt.plot(spectrum['WAVELENGTH'], np.sqrt(spectrum['VAR']), color='grey', label=' plt.legend(loc='upper right') plt.ylim(-0.15, 0.25) -plt.title(f'Object ID {obj_id}') +plt.title(f"Euclid SIR 1D Spectrum at RA={coord.ra.deg:.4f}°, Dec={coord.dec.deg:.4f}°") ``` ## About this Notebook -**Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati, Vandana Desai, Troy Raen +**Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati, Vandana Desai, Troy Raen, Jessica Krick -**Updated**: 2025-09-23 +**Updated**: 2026-01-13 **Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems. From be555599ab6956e4f91697c0ed82234ed12fb14e Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Tue, 13 Jan 2026 15:52:44 -0500 Subject: [PATCH 2/5] query_ssa and small cleanup --- .../5_Euclid_intro_SPE_catalog.md | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md index 390993ed..45828c95 100644 --- a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md +++ b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md @@ -1,5 +1,4 @@ --- -short_title: "SPE Catalogs" jupytext: text_representation: extension: .md @@ -74,6 +73,24 @@ from astroquery.ipac.irsa import Irsa # Increase Astropy’s default network timeout (in seconds) for remote name resolution and data access data.conf.remote_timeout = 60 + +#suppress warnings about deprecated units +import warnings +warnings.filterwarnings( + "ignore", + message="The unit 'Angstrom' has been deprecated", + category=u.UnitsWarning, +) + +warnings.filterwarnings( + "ignore", + message="The unit 'erg' has been deprecated", + category=u.UnitsWarning, +) +warnings.filterwarnings( + "ignore", + message="XDG_CACHE_HOME is set", +) ``` ## 1. Find the MER Tile ID that corresponds to a given RA and Dec @@ -202,15 +219,30 @@ obj_row ### Pull the spectrum of this object ```{code-cell} ipython3 -adql_object = f"SELECT * FROM {table_1dspectra} WHERE objectid = {obj_id}" - -result_table2 = Irsa.query_tap(adql_object).to_qtable() +# Query SSA for the 1D spectrum near this object's sky position +euclid_ssa_collection = "euclid_DpdSirCombinedSpectra" + +# Use the object's MER coordinates from obj_row +coord_obj = SkyCoord( + ra=float(obj_row["ra"][0]) * u.deg, + dec=float(obj_row["dec"][0]) * u.deg, +) + +#complete the query +ssa_result = Irsa.query_ssa( + pos=coord_obj, + radius=2.0 * u.arcsec, + collection=euclid_ssa_collection, +) + +ssa_result ``` ### The following steps to read in the spectrum follows the 3_Euclid_intro_1D_spectra notebook. ```{code-cell} ipython3 -spectrum_path = f"https://irsa.ipac.caltech.edu/{result_table2['path'][0]}" +# Read in the spectrum for this object from the SSA access URL +spectrum_path = ssa_result["access_url"][0] spectrum_path ``` @@ -243,11 +275,11 @@ for wl, name, snr in zip(np.atleast_1d(line_wavelengths), np.atleast_1d(line_nam plt.title(f'Object ID {obj_id}') ``` -## About this Notebook +###### About this Notebook **Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati, Vandana Desai, Troy Raen, Jessica Krick -**Updated**: 2025-12-17 +**Updated**: 2026-01-13 **Contact:** [the IRSA Helpdesk](https://irsa.ipac.caltech.edu/docs/help_desk.html) with questions or reporting problems. From af5fd1de4d9b540e21af14e2f7e6206d60754a26 Mon Sep 17 00:00:00 2001 From: jkrick Date: Wed, 14 Jan 2026 09:43:31 -0800 Subject: [PATCH 3/5] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Brigitta Sipőcz --- tutorials/euclid_access/3_Euclid_intro_1D_spectra.md | 2 +- tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md b/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md index eb276ad7..811b7208 100644 --- a/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md +++ b/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md @@ -50,7 +50,7 @@ We rely on ``astroquery`` features that have been recently added, so please make ```{code-cell} ipython3 # Uncomment the next line to install dependencies if needed -!pip install matplotlib astropy 'astroquery>=0.4.10' +# !pip install matplotlib astropy 'astroquery>=0.4.10' ``` ```{code-cell} ipython3 diff --git a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md index 45828c95..81650333 100644 --- a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md +++ b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md @@ -223,10 +223,7 @@ obj_row euclid_ssa_collection = "euclid_DpdSirCombinedSpectra" # Use the object's MER coordinates from obj_row -coord_obj = SkyCoord( - ra=float(obj_row["ra"][0]) * u.deg, - dec=float(obj_row["dec"][0]) * u.deg, -) +coord_obj = SkyCoord(obj_row["ra"][0], obj_row["dec"][0], unit=u.deg) #complete the query ssa_result = Irsa.query_ssa( @@ -275,7 +272,7 @@ for wl, name, snr in zip(np.atleast_1d(line_wavelengths), np.atleast_1d(line_nam plt.title(f'Object ID {obj_id}') ``` -###### About this Notebook +## About this Notebook **Author**: Tiffany Meshkat, Anahita Alavi, Anastasia Laity, Andreas Faisst, Brigitta Sipőcz, Dan Masters, Harry Teplitz, Jaladh Singhal, Shoubaneh Hemmati, Vandana Desai, Troy Raen, Jessica Krick From 21656640a1d0a23f9f67eb762b94893976cbab74 Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Wed, 14 Jan 2026 12:53:27 -0500 Subject: [PATCH 4/5] final version before figurng out metadata problems --- tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md index 81650333..5fee5635 100644 --- a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md +++ b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md @@ -74,7 +74,7 @@ from astroquery.ipac.irsa import Irsa # Increase Astropy’s default network timeout (in seconds) for remote name resolution and data access data.conf.remote_timeout = 60 -#suppress warnings about deprecated units +#suppress warnings about deprecated units and cache import warnings warnings.filterwarnings( "ignore", @@ -223,7 +223,7 @@ obj_row euclid_ssa_collection = "euclid_DpdSirCombinedSpectra" # Use the object's MER coordinates from obj_row -coord_obj = SkyCoord(obj_row["ra"][0], obj_row["dec"][0], unit=u.deg) +coord_obj = SkyCoord(obj_row["ra"], obj_row["dec"], unit=u.deg) #complete the query ssa_result = Irsa.query_ssa( From e9899d42e6be28c3583c9ea5e9533731b07e87d2 Mon Sep 17 00:00:00 2001 From: Jessica Krick Date: Wed, 14 Jan 2026 14:57:18 -0500 Subject: [PATCH 5/5] adding back in shorttitle metadata --- tutorials/euclid_access/3_Euclid_intro_1D_spectra.md | 1 + tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md b/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md index 811b7208..3616a202 100644 --- a/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md +++ b/tutorials/euclid_access/3_Euclid_intro_1D_spectra.md @@ -1,4 +1,5 @@ --- +short_title: "SIR 1D Spectra" jupytext: text_representation: extension: .md diff --git a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md index 5fee5635..95e65434 100644 --- a/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md +++ b/tutorials/euclid_access/5_Euclid_intro_SPE_catalog.md @@ -1,4 +1,5 @@ --- +short_title: "SPE Catalogs" jupytext: text_representation: extension: .md @@ -223,7 +224,7 @@ obj_row euclid_ssa_collection = "euclid_DpdSirCombinedSpectra" # Use the object's MER coordinates from obj_row -coord_obj = SkyCoord(obj_row["ra"], obj_row["dec"], unit=u.deg) +coord_obj = SkyCoord(obj_row["ra"][0], obj_row["dec"][0], unit=u.deg) #complete the query ssa_result = Irsa.query_ssa(