|
34 | 34 | "\n", |
35 | 35 | "**Packages:** `lsst.daf.butler`, `lsst.afw`, `lsst.rsp`, `lsst.scarlet.lite`, `lsst.meas.extensions.scarlet`\n", |
36 | 36 | "\n", |
37 | | - "**Credit:** Originally developed by Christina Williams and the Rubin Community Science team. This notebook is partly based on DP0.2 notebook 10 on deblender data products, and benefited from helpful discussions with Fred Moolekamp and thanks to Grant Merz for raising questions about reconstructing footprints using DP1 in the Rubin Community Forum. These packages are based on <a href=\"https://ui.adsabs.harvard.edu/abs/2018A%26C....24..129M/abstract\">Melchior et al. 2018</a>, and the <a href=\"https://pmelchior.github.io/scarlet/\">Scarlet software</a> written by Peter Melchior and Fred Moolekamp. Further documentation on Scarlet is available at that site. Please consider acknowledging them if this notebook is used for the preparation of journal articles, software releases, or other notebooks.\n", |
| 37 | + "**Credit:** Originally developed by Christina Williams and the Rubin Community Science team. This notebook is partly based on DP0.2 notebook 10 on deblender data products, materials developed by Fred Moolecamp, and benefited from helpful discussions with him. Thanks to Grant Merz for raising questions about reconstructing footprints using DP1 in the Rubin Community Forum. These packages are based on <a href=\"https://ui.adsabs.harvard.edu/abs/2018A%26C....24..129M/abstract\">Melchior et al. 2018</a>, and the <a href=\"https://pmelchior.github.io/scarlet/\">Scarlet software</a> written by Peter Melchior and Fred Moolekamp. Further documentation on Scarlet is available at that site. Please consider acknowledging them if this notebook is used for the preparation of journal articles, software releases, or other notebooks.\n", |
38 | 38 | "\n", |
39 | 39 | "**Get Support:**\n", |
40 | 40 | "Everyone is encouraged to ask questions or raise issues in the \n", |
|
407 | 407 | "id": "1f2faa93-2b9d-4ca1-9d5c-7c9bab9120b1", |
408 | 408 | "metadata": {}, |
409 | 409 | "source": [ |
410 | | - "## 3. Blend and Object Models\n", |
| 410 | + "## 3. Blend and object models\n", |
411 | 411 | "\n", |
412 | 412 | "Scarlet Lite uses the multi-wavelength images to identify peaks. The scarlet models produced during deblending are available as a data product via the `object_scarlet_model` catalog. This contains all of the information needed to reconstruct the multi-band model for each source, including obtaining the flux re-distributed model. \n", |
413 | 413 | "\n", |
|
514 | 514 | "id": "40e6c982-c46a-4171-8a5f-6c478a8e0877", |
515 | 515 | "metadata": {}, |
516 | 516 | "source": [ |
517 | | - "### 3.2 Convert to a usable Blend instance\n", |
| 517 | + "### 3.2 Convert to a usable blend instance\n", |
518 | 518 | "\n", |
519 | 519 | "First, define a monkey patch that temporarily updates the `minimal_data_to_blend` LSST pipeline class in order to fix an issue with DP1 (temporarily while running this notebook). Once the fix enters the pipeline version in use, the following cell defining the monkey patch can simply be deleted without additional alteration to the notebook. The following cells will use this monkey patch version to load the blend.\n" |
520 | 520 | ] |
|
697 | 697 | "id": "feb57f86-ccdd-4d84-8546-1e48f644654c", |
698 | 698 | "metadata": {}, |
699 | 699 | "source": [ |
700 | | - "Load the subset of the image that overlaps with the blend, then use the `blend_data` and the `observation` to create a full `Blend`. All of the model information is the same as the information from the `Blend` that we created earlier. Here, attach real `Observation` data as opposed to an empty `Observation` (as was done in Section 3.2). Notice that the **observed_bands** are passed here, not the **display_bands**, as these bands must match the order of the bands in the `blend`.\n", |
| 700 | + "Load the subset of the image that overlaps with the blend, then use the `blend_data` and the `observation` to create a full `Blend`. All of the model information is the same as the information from the `Blend` that we created earlier. Here, attach real `Observation` data as opposed to an empty `Observation` (as was done in Section 3.2). Notice that the `observed_bands` are passed here, not the `display_bands`, as these bands must match the order of the bands in the `blend`.\n", |
701 | 701 | "\n", |
702 | | - "Model residuals compared to the observations are of interest for exploring how well the blend model matches the data. To do this, first load a multiband exposure as the input observation. Use the patch and tract to reconstruct the multiband deep_coadd for this blend.\n" |
| 702 | + "Model residuals compared to the observations are of interest for exploring how well the blend model matches the data. To do this, first load a multiband exposure as the input observation. Use the patch and tract to reconstruct the multiband `deep_coadd` for this blend.\n" |
703 | 703 | ] |
704 | 704 | }, |
705 | 705 | { |
|
757 | 757 | "id": "c1ba771a-1fba-47f0-8c0c-c6acba5475b2", |
758 | 758 | "metadata": {}, |
759 | 759 | "source": [ |
760 | | - "### 4.1 Display the Residuals\n", |
| 760 | + "### 4.1 Display the residuals\n", |
761 | 761 | "\n", |
762 | 762 | "Now display the scene. The function scarlet `show_scene` will include the model footprints, the model rendered (i.e. convolved with the PSF), the locations on the observed multiband image, and residuals between the real image and the model. Model residuals compared to the observations are of interest for exploring how well the blend model matches the data. \n", |
763 | 763 | "\n", |
|
773 | 773 | "metadata": {}, |
774 | 774 | "outputs": [], |
775 | 775 | "source": [ |
776 | | - "norm = sl.display.AsinhMapping(minimum=0, stretch=1, Q=10)\n", |
| 776 | + "norm = sl.display.AsinhMapping(minimum=0, stretch=10, Q=10)\n", |
777 | 777 | "\n", |
778 | 778 | "sl.display.show_scene(\n", |
779 | 779 | " blend,\n", |
|
926 | 926 | "source": [ |
927 | 927 | "fig, ax = plt.subplots(1, 3, figsize=(15, 5))\n", |
928 | 928 | "\n", |
929 | | - "# Display the deconvolved model\n", |
930 | 929 | "extent = sl.display.get_extent(object1.bbox)\n", |
931 | 930 | "rgb = sl.display.img_to_rgb(source_model[display_bands], norm=norm)\n", |
932 | 931 | "ax[0].imshow(rgb, origin='lower', extent=extent)\n", |
933 | 932 | "ax[0].set_title(\"Deconvolved Model\")\n", |
934 | 933 | "\n", |
935 | | - "# Convolve the model with the difference kernel\n", |
936 | 934 | "convolved_model = blend.observation.convolve(convolved_model)\n", |
937 | 935 | "extent = sl.display.get_extent(enlarged_box)\n", |
938 | 936 | "rgb = sl.display.img_to_rgb(convolved_model[display_bands], norm=norm)\n", |
939 | 937 | "ax[1].imshow(rgb, origin='lower', extent=extent)\n", |
940 | 938 | "ax[1].set_title(\"Convolved Model\")\n", |
941 | 939 | "\n", |
942 | | - "# Display the flux-weighted image\n", |
943 | 940 | "flux_model = object1.flux_weighted_image\n", |
944 | 941 | "extent = sl.display.get_extent(flux_model.bbox)\n", |
945 | 942 | "rgb = sl.display.img_to_rgb(flux_model[display_bands], norm=norm)\n", |
|
0 commit comments