|
16 | 16 | "<img align=\"left\" src=\"attachment:90083a24-00a4-4a6f-a1c3-b9b4c6b0de9e.png\" width=\"300\" style=\"padding-right: 20px;\"/>\n", |
17 | 17 | "</div>\n", |
18 | 18 | "For the Rubin Science Platform at data.lsst.cloud. <br>\n", |
19 | | - "Data Release: <i>DP1</i> <br>\n", |
20 | | - "Container Size: <i>Small</i> <br>\n", |
| 19 | + "Data Release: DP1 <br>\n", |
| 20 | + "Container Size: Large <br>\n", |
21 | 21 | "LSST Science Pipelines version: r29.1.1 <br>\n", |
22 | | - "Last verified to run: <i>2025-08-07</i> <br>\n", |
| 22 | + "Last verified to run: 2025-08-27 <br>\n", |
23 | 23 | "Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>" |
24 | 24 | ] |
25 | 25 | }, |
|
35 | 35 | "**Packages:** `lsst.afw`, `lsst.rsp`, `lsst.geom`, `lsst.gauss2d`, `astropy`, `photutils`, `galsim`\n", |
36 | 36 | "\n", |
37 | 37 | "**Credit:**\n", |
38 | | - "This notebook is partly based on DP0.2 notebook 18 on galaxy photometry, and benefitted from earlier exploration of simulated data and notebook development by Melissa Graham and Dan Taranu, helpful discussions with Jim Bosch. \n", |
| 38 | + "Originally developed by Christina Williams and the Rubin Community Science team. This notebook is partly based on DP0.2 notebook 18 on galaxy photometry, and benefitted from earlier exploration of simulated data and notebook development by Melissa Graham and Dan Taranu, helpful discussions with Jim Bosch. \n", |
39 | 39 | "\n", |
40 | 40 | "**Get Support:**\n", |
41 | 41 | "Everyone is encouraged to ask questions or raise issues in the \n", |
|
134 | 134 | "metadata": {}, |
135 | 135 | "outputs": [], |
136 | 136 | "source": [ |
137 | | - "def make_image_cutout(ra, dec, cutout_size=0.01):\n", |
| 137 | + "def make_image_cutout(ra, dec, cutout_size=0.01, band='i'):\n", |
138 | 138 | " \"\"\"\n", |
139 | | - " Wrapper function to generate a cutout using the cutout tool\n", |
| 139 | + " Wrapper function to generate a cutout using the cutout tool.\n", |
| 140 | + " Default is to show cutout in i-band.\n", |
140 | 141 | "\n", |
141 | 142 | " Parameters\n", |
142 | 143 | " ----------\n", |
143 | 144 | " ra, dec : 'float'\n", |
144 | 145 | " the ra and dec of the cutout center\n", |
145 | 146 | " cutout_size : 'float', optional\n", |
146 | | - " edge length in degrees of the cutout\n", |
| 147 | + " radial edge length in degrees of the cutout\n", |
147 | 148 | "\n", |
148 | 149 | " Returns\n", |
149 | 150 | " -------\n", |
|
160 | 161 | " results = service.search(pos=circle, calib_level=3)\n", |
161 | 162 | " table = results.to_table()\n", |
162 | 163 | " tx = np.where((table['dataproduct_subtype'] == 'lsst.deep_coadd')\n", |
163 | | - " & (table['lsst_band'] == 'r'))[0]\n", |
| 164 | + " & (table['lsst_band'] == band))[0]\n", |
164 | 165 | "\n", |
165 | 166 | " datalink_url = results[tx[0].item()].access_url\n", |
166 | 167 | " dl = DatalinkResults.from_result_url(datalink_url, session=get_pyvo_auth())\n", |
|
278 | 279 | "id": "fbc29923-d664-42b8-90cb-835d751a62ae", |
279 | 280 | "metadata": {}, |
280 | 281 | "source": [ |
281 | | - "Here, query the DP1 `objectTable` for galaxies in that field, identified as being extended (`i_extendedness` = 1). Additionally, check that their `i_kronFlux_flag_*` and `sersic_no_data_flag`, all = 0, indicating there is not a problem with modeling their shapes and light profiles. Finally, make sure to identify galaxies that are well detected, with signal to noise (`i_sersicFlux` / `i_sersicFluxErr` > 20).\n" |
| 282 | + "Here, query the DP1 `objectTable` for galaxies in that field, identified as being extended (`i_extendedness` = 1). Additionally, check that their `i_kronFlux_flag_*`, `sersic_no_data_flag`, and `shape_flag` are all = 0, indicating there is not a problem with modeling their shapes and light profiles. Finally, make sure to identify galaxies that are well detected, with signal to noise (`i_sersicFlux` / `i_sersicFluxErr` > 20).\n", |
| 283 | + "\n", |
| 284 | + "The query will retrieve a number of shape measurements and flags that will be explained in Section 3.\n" |
282 | 285 | ] |
283 | 286 | }, |
284 | 287 | { |
|
295 | 298 | " \"obj.i_kronRad, obj.i_kronFlux_flag, obj.sersic_no_data_flag, \" + \\\n", |
296 | 299 | " \"obj.i_kronFlux_flag_small_radius, \" + \\\n", |
297 | 300 | " \"obj.i_kronFlux_flag_bad_radius, \" + \\\n", |
298 | | - " \"obj.shape_xx, obj.shape_xy, obj.shape_yy, \" + \\\n", |
| 301 | + " \"obj.shape_xx, obj.shape_xy, obj.shape_yy, obj.shape_flag, \" + \\\n", |
299 | 302 | " \"obj.i_ixx, obj.i_ixy, obj.i_iyy, \" + \\\n", |
300 | 303 | " \"obj.sersic_index, obj.sersic_reff_x, \" + \\\n", |
301 | 304 | " \"obj.sersic_reff_y, obj.sersic_rho \" + \\\n", |
302 | 305 | " \"FROM dp1.Object AS obj \" + \\\n", |
303 | 306 | " \"WHERE (obj.i_sersicFlux/obj.i_sersicFluxErr > 20) AND \" + \\\n", |
304 | | - " \"(obj.i_extendedness = 1) AND \" + \\\n", |
| 307 | + " \"(obj.i_extendedness = 1) AND (obj.shape_flag = 0) AND \" + \\\n", |
305 | 308 | " \"(obj.i_kronFlux_flag_small_radius = 0) AND \" + \\\n", |
306 | 309 | " \"(obj.i_kronFlux_flag_bad_radius = 0) AND \" + \\\n", |
307 | 310 | " \"(obj.i_kronFlux_flag = 0) AND (obj.sersic_no_data_flag = 0) AND \" + \\\n", |
|
385 | 388 | "source": [ |
386 | 389 | "### 3.1 Gaussian ellipse \n", |
387 | 390 | "\n", |
388 | | - "In the next cell, use `objectTable` 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 `deepCoadd` in each band individually: `<band>_ixx`, `<band>_iyy`, `<band>_ixy` (weak lensing experts may recognize these come from the measured re-Gaussianization method of <a href=\"https://ui.adsabs.harvard.edu/abs/2003MNRAS.343..459H/abstract\">Hirata & Seljak 2003</a>, implemented by <a href=\"https://ui.adsabs.harvard.edu/abs/2005MNRAS.361.1287M/abstract\">Mandelbaum et al. 2005</a>, 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 shape parameters can be converted to more commonly used set of morphological parameters using the LSST package `ellipses`. \n", |
| 391 | + "In the next cell, use `objectTable` 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 `deepCoadd` in each band individually: `<band>_ixx`, `<band>_iyy`, `<band>_ixy` (weak lensing experts may recognize these come from the measured re-Gaussianization method of <a href=\"https://ui.adsabs.harvard.edu/abs/2003MNRAS.343..459H/abstract\">Hirata & Seljak 2003</a>, implemented by <a href=\"https://ui.adsabs.harvard.edu/abs/2005MNRAS.361.1287M/abstract\">Mandelbaum et al. 2005</a>, 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 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", |
389 | 392 | "\n", |
390 | 393 | "The cell below will demonstrate how to extract these more commonly used parameters (e.g. semi-major radius `A` or `Rmaj`, semi-minor radius `B` or `Rmin`, which can be used to obtain the axis ratio `ba` defined as Rmin/Rmaj, and the position angle `theta`. `theta` is defined in radians counterclockwise from the x-axis. \n", |
391 | 394 | "\n", |
|
513 | 516 | "id": "88d3dc48-b511-4f1a-83ef-ebd526912402", |
514 | 517 | "metadata": {}, |
515 | 518 | "source": [ |
516 | | - "### 3.2 Sersic shape\n", |
| 519 | + "### 3.3 Sersic shape\n", |
517 | 520 | "\n", |
518 | | - "Convert the Sersic morphological parameters stored in the objectTable (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`) 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`." |
| 521 | + "Convert the Sersic morphological parameters stored in the objectTable (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`." |
519 | 522 | ] |
520 | 523 | }, |
521 | 524 | { |
|
684 | 687 | "\n", |
685 | 688 | "### 5.1 BD Models\n", |
686 | 689 | "\n", |
687 | | - "BD models (where B and D refers to bulge and disk) produce measurements similar to those generated from modeling a single Sersic profile. The models are then integrated to estimate the total flux `BD_FluxB` and `BD_FluxD`. But, rather than using the best fit sersic index obtained from modeling the 6 images in each filter, the BD fluxes fix the sersic index n to either 1 (exponential disk in the case of D) or 4 (de Vaucouleurs bulge in the case of B). Note that this is not an equal decomposition of the two component sersic modeling as part of `cModel`. \n", |
| 690 | + "BD models (where B and D refers to bulge and disk) produce measurements similar to those generated from modeling a single Sersic profile. The models are then integrated to estimate the total flux `<f>_bdFluxB` and `<f>_bdFluxD`. But, rather than using the best fit sersic index obtained from modeling the 6 images in each filter, the BD fluxes are measured from a model with the sersic index n fixed to either 1 (exponential disk in the case of D) or 4 (de Vaucouleurs bulge in the case of B). Note that this is not an equal decomposition of the two component sersic modeling as part of `cModel`. \n", |
688 | 691 | "\n", |
689 | 692 | "There are known issues related to these parameters:\n", |
690 | 693 | "\n", |
691 | | - "1. The units in the DP1 schema are wrong for `bdReD` and `bdReB`. These are the effective radii and the units are pixel.\n", |
692 | | - "2. The units in the DP1 schema are wrong for ellipticity parameters `bdE1` and `bdE2`.\n", |
693 | | - "3. A bug currently affects the `objectTable` values for `bdE1`. In the meantime this parameter should not be used.\n", |
694 | | - "5. A note here for clarity: BD model shape parameters are not cataloged in the same way as the metrics for Sersic models. In the future, <a href=\"https://galsim-developers.github.io/GalSim/_build/html/shear.html\">galsim.Shear</a> can be used to convert the ellipicity parameters`bdE1` and `bdE2` to extract the shape parameters, but awaits the bug fix to `bdE1` before it can be used. \n", |
| 694 | + "1. The units in the DP1 schema are wrong for `<f>_bdReD` and `<f>_bdReB` (where `<f>_` indicates a measurement exists for each of the 6 filters). These are the effective radii measured on each filter image and the units are pixel.\n", |
| 695 | + "2. The units in the DP1 schema are wrong for ellipticity parameters `<f>_bdE1` and `<f>_bdE2`.\n", |
| 696 | + "3. A bug currently affects the `objectTable` values for `<f>_bdE1`. In the meantime this parameter should not be used.\n", |
| 697 | + "5. A note here for clarity: BD model shape parameters are not cataloged in the same way as the metrics for Sersic models. In the future, <a href=\"https://galsim-developers.github.io/GalSim/_build/html/shear.html\">galsim.Shear</a> can be used to convert the ellipicity parameters`<f>_bdE1` and `<f>_bdE2` to extract the shape parameters, but awaits the bug fix to `<f>_bdE1` before it can be used. \n", |
695 | 698 | "\n", |
696 | 699 | "It is currently recommended to not use any BD parameters for science with DP1.\n", |
697 | 700 | "\n", |
|
0 commit comments