_cModel_devFlux\n",
- "```\n"
+ "```"
]
},
{
@@ -421,8 +398,8 @@
"metadata": {},
"outputs": [],
"source": [
- "tab['i_bdFluxB'] = tab['i_cModelFlux']*tab['i_cModel_fracDev']\n",
- "tab['i_bdFluxD'] = tab['i_cModelFlux']* (1 - tab['i_cModel_fracDev'])\n",
+ "tab['i_bdFluxB'] = tab['i_cModelFlux'] * tab['i_cModel_fracDev']\n",
+ "tab['i_bdFluxD'] = tab['i_cModelFlux'] * (1 - tab['i_cModel_fracDev'])\n",
"bdFluxD_mag = -2.50 * np.log10(tab['i_bdFluxD']) + 31.4\n",
"bdFluxB_mag = -2.50 * np.log10(tab['i_bdFluxB']) + 31.4"
]
@@ -525,7 +502,7 @@
"id": "ebf6c3b5-915a-44b9-8557-d2ae26d239ef",
"metadata": {},
"source": [
- "### 3.2 Exponential disk fluxes\n",
+ "### 3.2. Exponential disk fluxes\n",
"\n",
"Two estimates of total flux based on modeling objects as exponential disks (Sersic model with Sersic index n = 1) are in the `object` table. They are calculated using different algorithms, but the plot below demonstrates that the fluxes are very similar."
]
@@ -539,11 +516,11 @@
"source": [
"fig, ax = plt.subplots(ncols=1, nrows=1, figsize=(8, 6))\n",
"\n",
- "one2one = np.arange(0,35000,1)\n",
+ "one2one = np.arange(0, 35000, 1)\n",
"\n",
"ax.plot(tab['i_exponentialFlux'], tab['i_cModel_expFlux'], 'o', alpha=.3)\n",
"\n",
- "ax.plot(one2one,one2one,linestyle='--',color='k',label='1:1')\n",
+ "ax.plot(one2one, one2one, linestyle='--', color='k', label='1:1')\n",
"ax.set_xlabel('i_exponentialFlux')\n",
"ax.set_ylabel('i_cModel_expFlux')\n",
"plt.legend()"
@@ -573,7 +550,7 @@
"outputs": [],
"source": [
"plt.plot(tab['i_cModelFlux'], tab['i_bdFluxB'] + tab['i_bdFluxD'], '.', alpha=.3,\n",
- " color='blue')\n",
+ " color='blue')\n",
"\n",
"plt.xlabel('i_cModelFlux')\n",
"plt.ylabel('cModel Bulge + Disk components')"
@@ -957,8 +934,7 @@
"profile = np.array([tab['i_ap03Flux'][wh][indx], tab['i_ap06Flux'][wh][indx],\n",
" tab['i_ap09Flux'][wh][indx], tab['i_ap12Flux'][wh][indx],\n",
" tab['i_ap17Flux'][wh][indx], tab['i_ap25Flux'][wh][indx],\n",
- " tab['i_ap35Flux'][wh][indx],\n",
- " tab['i_ap50Flux'][wh][indx]]) / area\n",
+ " tab['i_ap35Flux'][wh][indx], tab['i_ap50Flux'][wh][indx]]) / area\n",
"\n",
"plt.plot(rad, profile, linestyle=':',\n",
" label='Large Radius R='\n",
@@ -970,13 +946,12 @@
" & (cmodel_mag > 20) & (cmodel_mag < 21.5))[0]\n",
"\n",
"indx = 0\n",
- "print(\"large galaxy mag = \",cmodel_mag[wh][indx],\" small galaxy mag = \",cmodel_mag[wh2][indx])\n",
+ "print(\"large galaxy mag = \", cmodel_mag[wh][indx], \" small galaxy mag = \", cmodel_mag[wh2][indx])\n",
"\n",
"profile = np.array([tab['i_ap03Flux'][wh2][indx], tab['i_ap06Flux'][wh2][indx],\n",
" tab['i_ap09Flux'][wh2][indx], tab['i_ap12Flux'][wh2][indx],\n",
" tab['i_ap17Flux'][wh2][indx], tab['i_ap25Flux'][wh2][indx],\n",
- " tab['i_ap35Flux'][wh2][indx],\n",
- " tab['i_ap50Flux'][wh2][indx]])/area\n",
+ " tab['i_ap35Flux'][wh2][indx], tab['i_ap50Flux'][wh2][indx]])/area\n",
"\n",
"plt.plot(rad, profile,\n",
" label='Small Radius R='\n",
@@ -1080,11 +1055,11 @@
"source": [
"#### 5.2. CMD with GaaP\n",
"\n",
- "This section demonstrates using GaaP photometry to calculate accurate galaxy colors to identify different types of galaxies. First, define magnitudes from g, r, and i band photometry. The second cell will then compare the colors of galaxies that overlap the galaxy cluster with that in the field. In clusters, galaxies tend to be old, red elliptical galaxies and thus exhibit a well defined red sequence in color space. \n",
+ "This section demonstrates using GaaP photometry to calculate accurate galaxy colors to identify different types of galaxies. First, define magnitudes from g, r, and i band photometry, then compare the colors of galaxies that overlap the galaxy cluster with that in the field. In clusters, galaxies tend to be old, red elliptical galaxies and thus exhibit a well defined red sequence in color space. \n",
"\n",
- "The earlier query in Section 2 returned galaxies from a blank, \"field\" location (the ECDFS). These will be dominated by bluer star forming galaxies which are most common in field environments.\n",
+ "The earlier query in Section 2 returned signal-to-noise ratio $>20$ galaxies from a blank, \"field\" location (the ECDFS) and stored them in the `tab` table. These will be dominated by bluer star forming galaxies which are most common in field environments.\n",
"\n",
- "Below, add a new query near a known galaxy cluster PSZ2 G309.43-72.86 at redshift z=0.35. \n"
+ "Add a new query near a known galaxy cluster PSZ2 G309.43-72.86 at redshift z=0.35, from the ELAIS-S1 field, and use a signal-to-noise ratio $>50$ instead of $20$."
]
},
{
@@ -1096,8 +1071,6 @@
"source": [
"cluster_ra = 10.2082\n",
"cluster_dec = -44.1307\n",
- "\n",
- "\n",
"query = \"SELECT obj.objectId, obj.coord_ra, obj.coord_dec, \" + \\\n",
" \"obj.detect_fromBlend, obj.detect_isIsolated, \" + \\\n",
" \"obj.i_blendedness, obj.i_extendedness, \" + \\\n",
@@ -1110,7 +1083,7 @@
" \"(obj.i_extendedness = 1) AND \" + \\\n",
" \"(obj.i_kronFlux_flag = 0) AND (obj.i_cModel_flag = 0) AND \" + \\\n",
" \"CONTAINS(POINT('ICRS', obj.coord_ra, obj.coord_dec), \" + \\\n",
- " \"CIRCLE('ICRS',\"+str(cluster_ra)+\",\"+str(cluster_dec)+\", 0.2)) = 1 \"\n"
+ " \"CIRCLE('ICRS',\"+str(cluster_ra)+\",\"+str(cluster_dec)+\", 0.2)) = 1 \""
]
},
{
@@ -1123,30 +1096,11 @@
"job = service.submit_job(query)\n",
"job.run()\n",
"job.wait(phases=['COMPLETED', 'ERROR'])\n",
- "print('Job phase is', job.phase)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "18bc593d-bf80-44c1-9a33-158606fa2c8c",
- "metadata": {},
- "outputs": [],
- "source": [
+ "print('Job phase is', job.phase)\n",
"if job.phase == 'ERROR':\n",
" job.raise_if_error()\n",
- "assert job.phase == 'COMPLETED'"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "32400242-e8f6-4461-941a-8617f75960de",
- "metadata": {},
- "outputs": [],
- "source": [
- "results = job.fetch_result()\n",
- "tab2 = results.to_table()"
+ "assert job.phase == 'COMPLETED'\n",
+ "tab2 = job.fetch_result().to_table()"
]
},
{
@@ -1181,7 +1135,7 @@
"metadata": {},
"outputs": [],
"source": [
- "fig, (ax, ax1) = plt.subplots(ncols=1, nrows=2, figsize=(10, 6))\n",
+ "fig, (ax, ax1) = plt.subplots(ncols=1, nrows=2, figsize=(10, 6), sharex=True)\n",
"\n",
"ax.plot(i_field_cmodel_mag, (r_field_gaap_mag-i_field_gaap_mag),\n",
" '.', alpha=.1, color='blue', label='Field Galaxies (ECDFS)')\n",
@@ -1191,7 +1145,7 @@
"ax.legend()\n",
"\n",
"ax1.plot(i_cluster_cmodel_mag, (r_cluster_gaap_mag-i_cluster_gaap_mag),\n",
- " '.', alpha=.1, color='r', label='Cluster Galaxies (PSZ2 G309.43-72.86)')\n",
+ " '.', alpha=.1, color='r', label='Cluster Galaxies (PSZ2 G309.43-72.86; ELAIS-S1)')\n",
"ax1.set_xlabel('i-band Magnitude [cModel]')\n",
"ax1.set_ylabel('r-i color')\n",
"ax1.set_ylim([-1, 2])\n",
@@ -1203,7 +1157,7 @@
"id": "b4e3745a-8e04-4243-898c-10c8d25aae4b",
"metadata": {},
"source": [
- "> **Figure 10:** The r − i vs. i color-magnitude diagram for galaxies selected in the queries. Top panel shows the galaxies selected from in a random field that does not contain a galaxy cluster (ECDFS). The bottom panel shows galaxies from a field with a galaxy cluster, PSZ2 G309.43-72.86. The cluster galaxies appear as a \"red sequence\" with red r-i colors, because the Balmer / 4000 Angstrom break spectral feature that traces older stars sits between the bands."
+ "> **Figure 10:** The r − i vs. i color-magnitude diagram for galaxies selected in the queries. Top panel shows the SNR$>20$ galaxies selected from in a random field that does not contain a galaxy cluster (ECDFS). The bottom panel shows the SNR$>50$ galaxies from a field with a galaxy cluster, PSZ2 G309.43-72.86. The cluster galaxies appear as a \"red sequence\" with red r-i colors, because the Balmer / 4000 Angstrom break spectral feature that traces older stars sits between the bands. The faint-end cutoff is different for the two subsets due to the different SNR used in the query selection."
]
},
{
diff --git a/DP2/300_Science_demos/303_Galaxies/303_2_Galaxy_Shapes.ipynb b/DP2/300_Science_demos/303_Galaxies/303_2_Galaxy_shapes.ipynb
similarity index 99%
rename from DP2/300_Science_demos/303_Galaxies/303_2_Galaxy_Shapes.ipynb
rename to DP2/300_Science_demos/303_Galaxies/303_2_Galaxy_shapes.ipynb
index 2ab1f26f..51fd9de8 100644
--- a/DP2/300_Science_demos/303_Galaxies/303_2_Galaxy_Shapes.ipynb
+++ b/DP2/300_Science_demos/303_Galaxies/303_2_Galaxy_shapes.ipynb
@@ -10,7 +10,7 @@
"id": "325aa8a5-92fd-4913-a471-ad1617343be6",
"metadata": {},
"source": [
- "# 303.2. Galaxy Shapes in DP2\n",
+ "# 303.2. Galaxy shapes in DP2\n",
"\n",
"\n",
"\n",
@@ -18,12 +18,13 @@
"\n",
"
\n",
"\n",
- "For the Rubin Science Platform at data.lsst.cloud.
\n",
- "Data Release: Data Preview 2
\n",
- "Container Size: Large
\n",
- "LSST Science Pipelines version: r30.0.10
\n",
- "Last verified to run: 2026-08-18
\n",
- "Repository: github.com/lsst/tutorial-notebooks
"
+ "For the Rubin Science Platform at data.lsst.cloud.\\\n",
+ "Data Release: [Data Preview 2](https://dp2.lsst.io/)\\\n",
+ "Container Size: Large\\\n",
+ "LSST Science Pipelines version: r30.0.11\\\n",
+ "Last verified to run: 2026-09-04\\\n",
+ "Repository: [github.com/lsst/tutorial-notebooks](https://github.com/lsst/tutorial-notebooks)\\\n",
+ "DOI: [10.11578/rubin/dc.20250909.20](https://doi.org/10.11578/rubin/dc.20250909.20)"
]
},
{
@@ -97,9 +98,8 @@
"import matplotlib.pyplot as plt\n",
"import io\n",
"\n",
- "from pyvo.dal.adhoc import DatalinkResults, SodaQuery\n",
+ "from pyvo.dal.adhoc import SodaQuery\n",
"\n",
- "from astropy.wcs import WCS\n",
"from astropy.coordinates import SkyCoord\n",
"import astropy.units as u\n",
"\n",
@@ -110,7 +110,6 @@
"import lsst.afw.display as afwDisplay\n",
"import lsst.afw.geom.ellipses as ellipses\n",
"from lsst.gauss2d import Ellipse, EllipseMajor, Covariance\n",
- "import lsst.images\n",
"from lsst.images.serialization import read_archive\n",
"\n",
"import galsim as gs"
@@ -151,7 +150,7 @@
" -------\n",
" cutout : 'lsst.images object'\n",
" \"\"\"\n",
- " \n",
+ "\n",
" sia_client = discovery.get_sia_client()\n",
"\n",
" eff_wl = 622.1e-09\n",
@@ -182,7 +181,7 @@
" sq.circle = (cutout_ra, cutout_dec, Radius)\n",
" cutout_bytes = sq.execute_stream().read()\n",
" sq.raise_if_error()\n",
- " \n",
+ "\n",
" cutout = read_archive(io.BytesIO(cutout_bytes))\n",
" return cutout"
]
@@ -222,7 +221,7 @@
"metadata": {},
"outputs": [],
"source": [
- "afwDisplay.setDefaultBackend('matplotlib')\n"
+ "afwDisplay.setDefaultBackend('matplotlib')"
]
},
{
@@ -241,9 +240,7 @@
"outputs": [],
"source": [
"discovery = RSPDiscovery(\"dp2\")\n",
- "service = discovery.get_tap_client()\n",
- "\n",
- "assert service is not None"
+ "service = discovery.get_tap_client()"
]
},
{
@@ -380,7 +377,7 @@
"id": "265a726e-38a3-4767-bbb1-dc1126927a5d",
"metadata": {},
"source": [
- "### 3.1 Gaussian ellipse \n",
+ "### 3.1. Gaussian ellipse \n",
"\n",
"In the next cell, use `Object` table shape parameters to reconstruct the galaxy shape, approximated as a 2D Gaussian. The LSST pipelines measures this shape, parameterized by three parameters or \"moments\" measured on the `deep_coadd` in each band individually: `_ixx`, `_iyy`, `_ixy` (weak lensing experts may recognize these come from the measured re-Gaussianization method of Hirata & Seljak 2003, implemented by Mandelbaum et al. 2005, and called HSM moments. The corresponding moments measured on the reference band or `refBand` are also stored as `shape_xx`, `shape_yy`, and `shape_xy`. These moments have not been corrected for the point spread function (PSF; thus not applicable for weak lensing) but PSF effects are small for galaxy sizes much larger than the PSF. These shape parameters can be converted to more commonly used set of morphological parameters using the LSST package `ellipses`. \n",
"\n",
@@ -462,7 +459,7 @@
"id": "25d6f1f5-c09b-4442-b2a1-d333a2cd510c",
"metadata": {},
"source": [
- "### 3.2 Kron ellipse\n",
+ "### 3.2. Kron ellipse\n",
"\n",
"In the next cell, reconstruct the Kron aperture. The method of the Kron implementation in the LSST pipelines is to use the `Object` table parameter `_kronRad`, in combination with the same axis-ratio and rotation angle that come from the Gaussian shape parameters from section 3.1.\n",
"\n",
@@ -510,9 +507,9 @@
"id": "88d3dc48-b511-4f1a-83ef-ebd526912402",
"metadata": {},
"source": [
- "### 3.3 Sersic profiles\n",
+ "### 3.3. Sersic profiles\n",
"\n",
- "#### 3.3.1 Sersic parameters in x-y\n",
+ "#### 3.3.1. Sersic parameters in x-y\n",
"\n",
"Convert the Sersic morphological parameters stored in the `Object` table (the effective Sersic radii in x and y directions, `sersic_reff_x`, `sersic_reff_y`, and the correlation coefficient from the multiband Sersic model fit `sersic_rho` that is related to orientation angle) into the more conventional sersic parameters (axis ratio `ba` defined as the ratio of the semi-minor half-light radius divided to semi-major half-light radius, the position angle `pa`, and the semi-major half-light radius `r_major`). The position angle (`pa`) convention is counter-clockwise relative to the x-axis. In this case, return the `pa` in units of degrees instead of the previous example in radians, to demonstrate its use with `photutils`."
]
@@ -570,8 +567,8 @@
"source": [
"cutout_size = 0.008\n",
"\n",
- "cutout = make_image_cutout(tab['coord_ra'][0],\n",
- " tab['coord_dec'][0], cutout_size=cutout_size)"
+ "cutout = make_image_cutout(tab['coord_ra'][0], tab['coord_dec'][0],\n",
+ " cutout_size=cutout_size)"
]
},
{
@@ -596,7 +593,7 @@
"plt.subplot(projection=astropy_wcs)\n",
"\n",
"plt.imshow(cutout.image.array, origin='lower', cmap='gray', vmin=1,\n",
- " vmax=1000, norm='asinh',aspect='equal')\n",
+ " vmax=1000, norm='asinh', aspect='equal')\n",
"\n",
"gaussell_pix_ellipse = gaussell_ellipse.to_pixel(astropy_wcs)\n",
"gaussell_pix_ellipse.plot(color=colors[0], lw=3, label='Gaussian (shape) ellipse')\n",
@@ -641,7 +638,7 @@
"id": "bfd70329-c439-413b-8de1-521b7f975809",
"metadata": {},
"source": [
- "### 4.1 Standard Sersic parameters\n",
+ "### 4.1. Standard Sersic parameters\n",
"\n",
"New in DP2, the `Object` table now contains standard Sersic parameters (semi-major and minor half-light radii, position angle) which can be used in place of the x-y parameters that were needed in DP1. For this section, as a demonstration, replace those calculated in Section 3.3.1 using the x-y Sersic parameters with the ones stored in the `Object` table."
]
@@ -678,7 +675,7 @@
" flux=tab['i_sersicFlux'][0]).shear(q=ba, beta=pa * gs.degrees)\n",
"img_h, img_w = cutout.image.array.shape\n",
"\n",
- "sersic_model = sersic.drawImage(nx=img_w, ny=img_h, scale=arcsec_per_pix).array\n",
+ "sersic_model = sersic.drawImage(nx=img_w, ny=img_h, scale=arcsec_per_pix).array\n",
"\n",
"print('Total flux of model = ', np.sum(sersic_model),\n",
" 'nJy, very close to flux from Object table = ',\n",
@@ -725,11 +722,11 @@
"outputs": [],
"source": [
"ba = tab['exponential_reff_minor'][0]/tab['exponential_reff_major'][0]\n",
+ "use_beta = (tab['exponential_theta'][0] + 90) * gs.degrees\n",
"sm = gs.Sersic(n=1, half_light_radius=tab['exponential_reff_major'][0] * np.sqrt(ba),\n",
- " flux=tab['i_exponentialFlux'][0]).shear(q=ba,\n",
- " beta=(tab['exponential_theta'][0] + 90) * gs.degrees)\n",
+ " flux=tab['i_exponentialFlux'][0]).shear(q=ba, beta=use_beta)\n",
"\n",
- "exp_model = sm.drawImage(nx=img_w, ny=img_h, scale=arcsec_per_pix).array\n",
+ "exp_model = sm.drawImage(nx=img_w, ny=img_h, scale=arcsec_per_pix).array\n",
"\n",
"print('Total flux of model = ', np.sum(exp_model), 'nJy, very close to flux from Object table = ',\n",
" tab['i_exponentialFlux'][0], ' nJy')\n",
@@ -818,7 +815,7 @@
"source": [
"Next, have `galsim` generate an image of the best `cModel` shape.\n",
"\n",
- "> Note: de Vaucouleurs profiles have sharp central cusps and also large wings which ideally requires a large grid of frequencies for the Fast Fourier Transform (FFT). Since we are only trying to visualize the light profile and are not concerned with re-calculating photometry with high accuracy, this warning can be safely ignored. "
+ "> **Warning**: The following cell produces a pink warning message that is safe to ignore. It appears because the de Vaucouleurs profiles have sharp central cusps and also large wings which ideally requires a large grid of frequencies for the Fast Fourier Transform (FFT). Because this demonstration is only visualizing the light profile, and is not concerned with re-calculating photometry with high accuracy, this warning can be safely ignored. "
]
},
{
@@ -920,7 +917,7 @@
"print('Total flux of model = ', np.sum(img_w_psf), 'nJy, very close to flux from Object table = ',\n",
" tab['i_cModelFlux'][0], ' nJy')\n",
"\n",
- "plt.title(f\"Reconstructed cModel (convolved with PSF)\")\n",
+ "plt.title(\"Reconstructed cModel (convolved with PSF)\")\n",
"plt.colorbar(label='Pixel Flux')\n",
"plt.show()"
]
diff --git a/DP2/300_Science_demos/303_Galaxies/303_3_Color_selections.ipynb b/DP2/300_Science_demos/303_Galaxies/303_3_Color_selections.ipynb
index a30fd7c4..02a56cae 100644
--- a/DP2/300_Science_demos/303_Galaxies/303_3_Color_selections.ipynb
+++ b/DP2/300_Science_demos/303_Galaxies/303_3_Color_selections.ipynb
@@ -18,12 +18,13 @@
"\n",
"\n",
"\n",
- "For the Rubin Science Platform at data.lsst.cloud.
\n",
- "Data Release: Data Preview 2
\n",
- "Container Size: large
\n",
- "LSST Science Pipelines version: r30.0.11
\n",
- "Last verified to run: 2026-09-02
\n",
- "Repository: github.com/lsst/tutorial-notebooks
"
+ "For the Rubin Science Platform at data.lsst.cloud.\\\n",
+ "Data Release: [Data Preview 2](https://dp2.lsst.io/)\\\n",
+ "Container Size: Large\\\n",
+ "LSST Science Pipelines version: r30.0.11\\\n",
+ "Last verified to run: 2026-09-04\\\n",
+ "Repository: [github.com/lsst/tutorial-notebooks](https://github.com/lsst/tutorial-notebooks)\\\n",
+ "DOI: [10.11578/rubin/dc.20250909.20](https://doi.org/10.11578/rubin/dc.20250909.20)"
]
},
{
@@ -59,7 +60,7 @@
"\n",
"Thus, galaxies at high redshifts can be identified by their very red colors between filters that bridge the Lyman break feature (and are named after their selection method as Lyman break galaxies or LBGs). Since intergalactic hydrogen absorbs the light blueward of the Lyman break, the flux of true z ~ 3 galaxies drops as the Lyman-break redshifts into the LSST u-band, and at z ~ 4 in the LSST g-band.\n",
"\n",
- "This notebook demonstrates the Lyman break color selection on DP1 data for galaxies at z ~ 4 as an example (referred to as g-band dropouts), and provides some validation metrics for its performance. It makes use of color selections defined and used in the literature with data from facilities with similar filter sets (band pass shapes and effective wavelengths). These are using the Canada-France-Hawaii Telescope Legacy Survey (CFHTLS) as presented in [Hildebrandt et al., 2009](https://ui.adsabs.harvard.edu/abs/2009A%26A...498..725H/abstract) and [van der Burg et al., 2010](https://ui.adsabs.harvard.edu/abs/2010A%26A...523A..74V/abstract). A similar selection was performed using Subaru Hyper-Suprime Cam data in [Ono et al. 2018](https://ui.adsabs.harvard.edu/abs/2018PASJ...70S..10O/abstract).\n"
+ "This notebook demonstrates the Lyman break color selection on DP2 data for galaxies at z ~ 4 as an example (referred to as g-band dropouts), and provides some validation metrics for its performance. It makes use of color selections defined and used in the literature with data from facilities with similar filter sets (band pass shapes and effective wavelengths). These are using the Canada-France-Hawaii Telescope Legacy Survey (CFHTLS) as presented in [Hildebrandt et al., 2009](https://ui.adsabs.harvard.edu/abs/2009A%26A...498..725H/abstract) and [van der Burg et al., 2010](https://ui.adsabs.harvard.edu/abs/2010A%26A...523A..74V/abstract). A similar selection was performed using Subaru Hyper-Suprime Cam data in [Ono et al. 2018](https://ui.adsabs.harvard.edu/abs/2018PASJ...70S..10O/abstract).\n"
]
},
{
@@ -96,7 +97,6 @@
"import io\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
- "from astropy.io import fits\n",
"from astropy.coordinates import SkyCoord\n",
"import astropy.units as u\n",
"from astropy.visualization import ZScaleInterval, LinearStretch, ImageNormalize\n",
@@ -127,9 +127,7 @@
"outputs": [],
"source": [
"discovery = RSPDiscovery(\"dp2\")\n",
- "tap_service = discovery.get_tap_client()\n",
- "\n",
- "assert tap_service is not None"
+ "tap_service = discovery.get_tap_client()"
]
},
{
@@ -433,7 +431,7 @@
"id": "d0e7c80f-0587-4c17-93d8-a52096d4c99e",
"metadata": {},
"source": [
- "### 2.3 Plot color color diagrams\n",
+ "### 2.3. Plot color color diagrams\n",
"\n",
"First, store some shorthand parameters for the colors in the selection, and for parameters to color-code the galaxies by."
]
@@ -479,7 +477,7 @@
"source": [
"Define a figure for the color color diagram. Plot all the Rubin galaxies from the query in Section 2.1 (gray), all Rubin galaxies that satisfy the LBG color selection (blue), and the true spectroscopically confirmed high-redshift galaxies as bold colored symbols. Stars indicate the true high-redshift galaxies that meet the color selection and plus signs are the true high-redshift galaxies that do not. \n",
"\n",
- "#### 2.3.1 Magnitude dependence\n",
+ "#### 2.3.1. Magnitude dependence\n",
"\n",
"Color-code the galaxies by their i-band magnitude, to see if spectroscopically confirmed galaxies that are missed by the LBG selection might be faint, suggesting photometric scatter could contribute to missed galaxies."
]
@@ -537,9 +535,9 @@
"id": "ef30522a-274c-4ac2-99f2-4a391646d729",
"metadata": {},
"source": [
- "> Figure 1: A color-color diagram showing g - r vs r - i colors for all Rubin galaxies (gray). The Lyman-break color selection window is shown in black dashed lines. Blue points indicate Rubin galaxies that meet the color criteria for being at high-redshift. Stars and pluses indicate Rubin galaxies that are spectroscopically confirmed by VANDELS to lie at z > 3.5 but do and do not meet the color selection (respectively). Confirmed galaxies are color coded by i-band magnitude and their successful selection does not show any trend with magnitude (which might be expected if photometric scatter).\n",
+ "> **Figure 1:** A color-color diagram showing g - r vs r - i colors for all Rubin galaxies (gray). The Lyman-break color selection window is shown in black dashed lines. Blue points indicate Rubin galaxies that meet the color criteria for being at high-redshift. Stars and pluses indicate Rubin galaxies that are spectroscopically confirmed by VANDELS to lie at z > 3.5 but do and do not meet the color selection (respectively). Confirmed galaxies are color coded by i-band magnitude and their successful selection does not show any trend with magnitude (which might be expected if photometric scatter).\n",
"\n",
- "#### 2.3.2 Imaging depth dependence\n",
+ "#### 2.3.2. Imaging depth dependence\n",
"\n",
"Color-code the galaxies by their g-band flux error, a proxy for the depth of the g-band imaging, to see if spectroscopically confirmed galaxies that are missed by the LBG selection might because the g-band imaging was not deep enough to provide a robust lower limit on the dropout color."
]
@@ -598,7 +596,7 @@
"id": "b2849d83-8780-4a28-8b31-2f52e5365aa0",
"metadata": {},
"source": [
- "> Figure 2: Like Figure 1, except that confirmed galaxies are color coded by g-band flux uncertainty as a proxy for variations in the depth or integration time in the g-band filter imaging. Their unsuccessful selection does not show any trend with image depth (which might be expected if galaxies in shallower imaging have smaller lower limits to the g-r color)."
+ "> **Figure 2:** Like Figure 1, except that confirmed galaxies are color coded by g-band flux uncertainty as a proxy for variations in the depth or integration time in the g-band filter imaging. Their unsuccessful selection does not show any trend with image depth (which might be expected if galaxies in shallower imaging have smaller lower limits to the g-r color)."
]
},
{
@@ -606,7 +604,7 @@
"id": "8062a269-a6c8-43b2-ae46-88ebc8790912",
"metadata": {},
"source": [
- "#### 2.3.3 Redshift dependence\n",
+ "#### 2.3.3. Redshift dependence\n",
"\n",
"Since there is no obvious trend with magnitude or imaging depth, color code the spectroscopically confirmed high-redshift galaxies by their spectroscopic redshift. At the higher redshift end of the selection window, the g-band flux is completely undetected when the filter probes blueward of the Lyman limit (912A). But at lower end of the redshift selection window the g-band will probe blueward of Lyman alpha (1216A) and redward of the Lyman limit (912A) but will only be partially absorbed because of the Lyman-alpha forest. The amount of flux can vary. In the plot below, color-code by spectroscopic redshift to see if the bluer galaxies are at lower redshifts."
]
@@ -663,7 +661,7 @@
"id": "4e702cae-4406-424f-abec-ec2375cfe0b6",
"metadata": {},
"source": [
- "> Figure 3: Like Figure 1, except that confirmed galaxies are color coded by spectroscopic redshift, and their successful selection does not show any trend with redshift."
+ "> **Figure 3:** Like Figure 1, except that confirmed galaxies are color coded by spectroscopic redshift, and their successful selection does not show any trend with redshift."
]
},
{
@@ -671,7 +669,7 @@
"id": "2f0b8d97-06de-4226-b21b-782f7cbe56c5",
"metadata": {},
"source": [
- "#### 2.3.4 Interpretation\n",
+ "#### 2.3.4. Interpretation\n",
"\n",
"The color selection identifies a large number of true high-redshift galaxies. A number of confirmed galaxies fall outside the selection window. While the color selection is not designed to be 100% inclusive of high redshift galaxies, it should select a relatively pure sample with few interlopers. Galaxies may reside outside the selection box do not seem to trend with any single property tested in Section 2.3.1-2.3.3, but may be caused by a combination of photometric scatter, variation in depth of the g-band imaging, and that the strength of the g-r color will vary across the redshift selection window. Other effects also contribute: dust attenuation in the galaxy will redden the restframe UV probed by the r-i color and similarly decreasing the brightness of the observed r band flux (thus making the g-r color less robustly constrained).\n",
"\n",
@@ -758,27 +756,28 @@
" if len(band_match) > 0:\n",
" try:\n",
" datalink_url = band_match['access_url'][0]\n",
- " \n",
+ "\n",
" dl_result = DatalinkResults.from_result_url(\n",
- " datalink_url, \n",
- " session=session)\n",
- " \n",
+ " datalink_url, session=session)\n",
+ "\n",
" sq = SodaQuery.from_resource(\n",
" dl_result,\n",
" dl_result.get_adhocservice_by_id(\"cutout-sync\"),\n",
" session=session)\n",
- " \n",
+ "\n",
" sq.circle = (ra * u.deg, dec * u.deg, 10.0 / 3600.0 * u.deg)\n",
" cutout_bytes = sq.execute_stream().read()\n",
"\n",
" cutout = read_archive(io.BytesIO(cutout_bytes))\n",
" img_array = cutout.array\n",
"\n",
- " norm = ImageNormalize(img_array, interval=ZScaleInterval(), stretch=LinearStretch())\n",
+ " norm = ImageNormalize(img_array, interval=ZScaleInterval(),\n",
+ " stretch=LinearStretch())\n",
" ax.imshow(img_array, origin='lower', cmap='gray', norm=norm)\n",
- " \n",
+ "\n",
" cy, cx = img_array.shape[0]//2, img_array.shape[1]//2\n",
- " ax.add_patch(plt.Circle((cx, cy), radius=6, color='cyan', fill=False, lw=1.5, alpha=0.7))\n",
+ " ax.add_patch(plt.Circle((cx, cy), radius=6, color='cyan', fill=False,\n",
+ " lw=1.5, alpha=0.7))\n",
"\n",
" except Exception as e:\n",
" ax.text(0.5, 0.5, 'SODA Error', ha='center', va='center',\n",
@@ -826,7 +825,7 @@
"id": "cfb13a25-127d-4594-9e61-685f93e76e73",
"metadata": {},
"source": [
- "> Figure 4: Deep coadd image cutouts of a few confirmed high-redshift galaxies that are selected as LBGs from the Rubin imaging. As expected for galaxies at z > 3.5, the galaxies are not detected in the u-band, their flux is significantly decreased in the g-band, and are detected in r and i-bands.\n",
+ "> **Figure 4:** Deep coadd image cutouts of a few confirmed high-redshift galaxies that are selected as LBGs from the Rubin imaging. As expected for galaxies at z > 3.5, the galaxies are not detected in the u-band, their flux is significantly decreased in the g-band, and are detected in r and i-bands.\n",
"\n",
"Optionally, also generate cutouts of the true high-redshift galaxies that were missed the color selection. Now plot the 4-filter cutouts for the real high redshift galaxies confirmed by VANDELS but that the Rubin color selection missed. They are a mix of galaxies with too-blue g-r colors and too-red r-i colors."
]
@@ -988,8 +987,16 @@
"id": "82d9acbc-e0c4-4049-90c6-1b8f13af5326",
"metadata": {},
"source": [
- "> Figure 5: Histogram of the redshifts of all spectroscopically confirmed galaxies that enter the Lyman-break color selection, indicating a very low interloper fraction. The selection window with Rubin data matches the one characterized by Ono et al. 2018 (green) using HSC data and the same color criteria (3.2 < z < 4.5)."
+ "> **Figure 5:** Histogram of the redshifts of all spectroscopically confirmed galaxies that enter the Lyman-break color selection, indicating a very low interloper fraction. The selection window with Rubin data matches the one characterized by Ono et al. 2018 (green) using HSC data and the same color criteria (3.2 < z < 4.5)."
]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "b68ce501-1e5e-4dbd-a872-5189fe0a959b",
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {