Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
"DOI: <a href=\"https://doi.org/10.11578/rubin/dc.20250909.20\\\">10.11578/rubin/dc.20250909.20</a> <br>"
]
},
{
"cell_type": "markdown",
"id": "07ccc088-9842-4457-a035-59a83a1b77c7",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b>Warning:</b> This tutorial will only run with LSST Science Pipelines version r29.2.0, which is behind the current recommended image for the Notebook Aspect. <a href=\"https://rsp.lsst.io/guides/notebooks/starting-and-stopping/index.html\">Learn how to select the software version for your Notebook session</a>.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "9da1a210-d858-42fe-8591-570965b8be1a",
Expand All @@ -52,7 +62,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "cfc73be0",
"metadata": {},
Expand Down Expand Up @@ -1100,7 +1109,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.13.9"
},
"toc-autonumbering": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
"DOI: <a href=\"https://doi.org/10.11578/rubin/dc.20250909.20\\\">10.11578/rubin/dc.20250909.20</a> <br>"
]
},
{
"cell_type": "markdown",
"id": "2357014a-c88f-4d3e-994a-90ddcb6f3015",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-warning\">\n",
" <b>Warning:</b> This tutorial will only run with LSST Science Pipelines version r29.2.0, which is behind the current recommended image for the Notebook Aspect. <a href=\"https://rsp.lsst.io/guides/notebooks/starting-and-stopping/index.html\">Learn how to select the software version for your Notebook session</a>.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"id": "9da1a210-d858-42fe-8591-570965b8be1a",
Expand All @@ -49,7 +59,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "cfc73be0",
"metadata": {},
Expand Down Expand Up @@ -825,7 +834,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.13.9"
},
"toc-autonumbering": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"For the Rubin Science Platform at data.lsst.cloud. <br>\n",
"Data Release: <a href=\"https://dp1.lsst.io/\">Data Preview 1</a> <br>\n",
"Container Size: large <br>\n",
"LSST Science Pipelines version: r29.2.0 <br>\n",
"Last verified to run: 2025-12-15 <br>\n",
"LSST Science Pipelines version: v30.0.10 <br>\n",
"Last verified to run: 2026-07-21 <br>\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)"
]
Expand All @@ -48,7 +48,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "cfc73be0",
"metadata": {},
Expand Down Expand Up @@ -95,7 +94,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import astropy.units as u\n",
"from astropy.io import ascii\n",
"from astropy.table import Table\n",
"\n",
"from lsst.rsp import get_tap_service\n",
"from lsst.daf.butler import Butler\n",
Expand Down Expand Up @@ -732,7 +731,7 @@
"The input file was generated by re-running source detection with `config.thresholdValue = 4` on a specific $r$-band visit image (`visit` = 2024110800263, `detector` = 3), and saving the coordinates for sources with $4.0 < SNR < 4.5$ in a small region of the visit image to the file.\n",
"The sub-threshold detection magnitudes were also saved in the file.\n",
"\n",
"Load the file as an astropy table and print the column names."
"Load the file as an astropy table, add units to the coordinates columns, and print the column names."
]
},
{
Expand All @@ -744,7 +743,9 @@
"source": [
"filepath = '/rubin/cst_repos/tutorial-notebooks-data/data/'\n",
"filename = 'dp1_105_3_subthreshold.dat'\n",
"subthresh = ascii.read(filepath+filename)\n",
"subthresh = Table.read(filepath+filename, format=\"ascii\")\n",
"subthresh[\"ra\"].unit = u.deg\n",
"subthresh[\"dec\"].unit = u.deg\n",
"print('file columns: ', subthresh.colnames)\n",
"print('file length: ', len(subthresh))"
]
Expand Down Expand Up @@ -910,7 +911,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.13.9"
},
"toc-autonumbering": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"For the Rubin Science Platform at data.lsst.cloud. <br>\n",
"Data Release: <a href=\"https://dp1.lsst.io/\">Data Preview 1</a> <br>\n",
"Container Size: large <br>\n",
"LSST Science Pipelines version: r29.2.0 <br>\n",
"Last verified to run: 2026-04-07 <br>\n",
"LSST Science Pipelines version: v30.0.10 <br>\n",
"Last verified to run: 2026-07-21 <br>\n",
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>"
]
},
Expand All @@ -47,7 +47,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "cfc73be0",
"metadata": {},
Expand Down Expand Up @@ -85,6 +84,7 @@
"outputs": [],
"source": [
"import os\n",
"import uuid\n",
"from pathlib import Path\n",
"from lsst.daf.butler import Butler\n",
"from lsst.ctrl.mpexec import SimplePipelineExecutor\n",
Expand Down Expand Up @@ -452,7 +452,8 @@
"pipeline.addConfigOverride('makeDirectWarp', 'useVisitSummaryPsf', False)\n",
"pipeline.addConfigOverride('makeDirectWarp', 'useVisitSummaryPhotoCalib', False)\n",
"pipeline.addConfigOverride('makeDirectWarp', 'useVisitSummaryWcs', False)\n",
"pipeline.addConfigOverride('makeDirectWarp', 'connections.calexp_list', 'visit_image')"
"pipeline.addConfigOverride('makeDirectWarp', 'connections.calexp_list', 'visit_image')\n",
"pipeline.addConfigOverride('makeDirectWarp', 'doSelectPreWarp', False)"
]
},
{
Expand Down Expand Up @@ -528,7 +529,9 @@
"id": "1e7dc37c-f7b5-4a60-9079-276b8b246d08",
"metadata": {},
"source": [
"Create a `SimplePipelineExecutor` object that will enable running the custom coaddition pipeline. The `SimplePipelineExecutor`'s inputs are the pipeline structural definition, the DP1 Butler object, the output collection name, and the query string."
"Create a `SimplePipelineExecutor` object that will enable running the custom coaddition pipeline. The `SimplePipelineExecutor`'s inputs are the pipeline structural definition, the DP1 Butler object, the output collection name, and the query string.\n",
"\n",
"> **Warning:** the following cell produces a pink deprecation warning that is OK to ignore for now, with v30 of the pipelines."
]
},
{
Expand Down Expand Up @@ -590,7 +593,7 @@
"metadata": {},
"outputs": [],
"source": [
"local_repo_path = Path(scratch_path, \"my_local_repo\")\n",
"local_repo_path = Path(scratch_path, f\"my_local_repo_{uuid.uuid4().hex}\")\n",
"out_butler = executor.use_local_butler(local_repo_path)"
]
},
Expand Down Expand Up @@ -757,21 +760,16 @@
"id": "044a5afe-202b-4bbd-9c96-91869f89716d",
"metadata": {},
"source": [
"To free up space, delete the writable Butler repository used for custom coaddition. If you wish to continue exploring the writable Butler repository then the following cell can be skipped, though note that the local Butler repo will still be deleted within a week because it is within temporary scratch space. In general, be very careful about any `rm -r` or similar commands that you run on RSP, as there is potential for inadvertently deleting files you wish to retain.\n",
"\n",
"*Option*: Skip the final cell below if you wish to continue working with variables previously defined in this notebook and/or continue using your writable Butler repo."
">**Reminder:** The data written out to `local_repo_path` is in the `deleted_sundays/` scratch folder and will be deleted on the next Sunday."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f9c8a16c-ed9e-46f7-81c2-43ea4206dc0d",
"id": "a628aa56-e3f9-452e-91da-82202a2ba300",
"metadata": {},
"outputs": [],
"source": [
"# %reset -f\n",
"# ! rm -r $SCRATCH_DIR/my_local_repo"
]
"source": []
}
],
"metadata": {
Expand All @@ -790,7 +788,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.13.9"
},
"toc-autonumbering": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"For the Rubin Science Platform at data.lsst.cloud. <br>\n",
"Data Release: DP1 <br>\n",
"Container Size: Large <br>\n",
"LSST Science Pipelines version: Weekly 29.2.0 <br>\n",
"Last verified to run: 2026-03-19 <br>\n",
"LSST Science Pipelines version: Weekly 30.0.10 <br>\n",
"Last verified to run: 2026-07-21 <br>\n",
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>"
]
},
Expand Down Expand Up @@ -116,48 +116,6 @@
"### 1.2. Define parameters and functions\n"
]
},
{
"cell_type": "markdown",
"id": "f0c1e8da-8196-4c1d-a929-0feb83a7287e",
"metadata": {},
"source": [
"An issue exists with an LSST pipeline class called `minimal_data_to_blend` to access the `scarlet` blend model specifically when using DP1 data. This will be fixed in the future. In the meantime, the cell below defines a function with a temporary fix for DP1 that updates the `minimal_data_to_blend` LSST pipeline class (temporarily while running this notebook)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dbda1096-cf1c-433f-ae5c-1ad761683f09",
"metadata": {},
"outputs": [],
"source": [
"def minimal_data_to_blend(cls, model_psf: np.ndarray, dtype: np.typing.DTypeLike) -> Blend:\n",
"\n",
" \"\"\"Convert the storage data model into a scarlet lite blend\n",
"\n",
" Parameters\n",
" ----------\n",
" model_psf:\n",
" PSF in model space (usually a nyquist sampled circular Gaussian).\n",
" dtype:\n",
" The data type of the model that is generated.\n",
"\n",
" Returns\n",
" -------\n",
" blend:\n",
" A scarlet blend model extracted from persisted data.\n",
" \"\"\"\n",
" model_box = Box(cls.shape, origin=cls.origin)\n",
" observation = Observation.empty(\n",
" bands=cls.bands,\n",
" psfs=cls.psf,\n",
" model_psf=model_psf,\n",
" bbox=model_box,\n",
" dtype=dtype,\n",
" )\n",
" return cls.to_blend(observation)"
]
},
{
"cell_type": "markdown",
"id": "a527bd20-372c-478a-98c4-9c0b0b9f876e",
Expand Down Expand Up @@ -543,28 +501,44 @@
"metadata": {},
"outputs": [],
"source": [
"model_psf = modelData.psf\n",
"blend_data = modelData.blends[parentId]"
"model_psf = modelData.metadata[\"model_psf\"]\n",
"blend_data = modelData.blends[parentId]\n",
"psf = blend_data.metadata[\"psf\"]\n",
"observed_bands = blend_data.metadata[\"bands\"]"
]
},
{
"cell_type": "markdown",
"id": "40e6c982-c46a-4171-8a5f-6c478a8e0877",
"id": "3e64bce8",
"metadata": {},
"source": [
"### 3.2 Convert to a usable blend instance\n",
"\n",
"Section 1.2 defined a function with a temporary fix that 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 temporary fix (and the function from Section 1.2) can simply be deleted without additional alteration to the notebook. The following cells will use this temporary fixed version to load the blend."
"The LSST pipelines do not necessarily process in order of wavelength, i.e. ugrizy. Check how many bands exist over the blend of interest, and what order they are in."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c5ddbca8-f258-44eb-8f97-558b9c9cb3bc",
"id": "d567a19b",
"metadata": {},
"outputs": [],
"source": [
"scarlet.lite.io.ScarletBlendData.minimal_data_to_blend = minimal_data_to_blend"
"print(observed_bands)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "46a89a10",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "40e6c982-c46a-4171-8a5f-6c478a8e0877",
"metadata": {},
"source": [
"### 3.2 Convert to a usable blend instance"
]
},
{
Expand All @@ -582,7 +556,7 @@
"metadata": {},
"outputs": [],
"source": [
"blend = blend_data.minimal_data_to_blend(model_psf[None, :, :], dtype=np.float32)"
"blend = blend_data.minimal_data_to_blend(model_psf[None, :, :], psf, observed_bands, dtype=np.float32)"
]
},
{
Expand All @@ -602,7 +576,7 @@
"metadata": {},
"outputs": [],
"source": [
"observed_bands = blend_data.bands\n",
"observed_bands = blend_data.metadata[\"bands\"]\n",
"print(observed_bands)"
]
},
Expand Down Expand Up @@ -844,7 +818,7 @@
"outputs": [],
"source": [
"object1 = blend.sources[1]\n",
"print(object1.record_id)"
"print(object1.metadata[\"id\"])"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"For the Rubin Science Platform at data.lsst.cloud. <br>\n",
"Data Release: <a href=\"http://dp1.lsst.io\">Data Preview 1</a> <br>\n",
"Container Size: large <br>\n",
"LSST Science Pipelines version: r29.2.0 <br>\n",
"Last verified to run: 2025-09-17 <br>\n",
"LSST Science Pipelines version: v30.0.10 <br>\n",
"Last verified to run: 2026-07-20 <br>\n",
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>"
]
},
Expand Down Expand Up @@ -305,9 +305,8 @@
"\n",
"for name, (ra, dec) in field_centers.items():\n",
" sp.ax.plot(ra, dec, marker=\"o\", color=\"red\", markersize=11.5)\n",
" x, y = sp.proj(ra, dec)\n",
" sp.ax.annotate(name, (x, y), fontsize=10, fontweight=\"bold\",\n",
" textcoords=\"offset points\", xytext=(3.4, 3.4))\n",
" sp.ax.annotate(name, (ra, dec), fontsize=10, fontweight=\"bold\",\n",
" textcoords=\"offset points\", transform=sp.ax.projection, xytext=(3.4, 3.4))\n",
"\n",
"ecl_lon = np.linspace(0, 360, 1000)\n",
"ecl_lat = np.zeros_like(ecl_lon)\n",
Expand All @@ -317,8 +316,8 @@
"ecl_dec = ecl_eq.dec.deg\n",
"\n",
"sp.ax.plot(ecl_ra, ecl_dec, color=\"gray\", linestyle=\"--\", lw=1.3, zorder=5)\n",
"sp.ax.text(*sp.proj(260, 50), \"Ecliptic\", fontsize=12, color=\"gray\",\n",
" ha=\"left\", va=\"bottom\")\n",
"sp.ax.text(0, 0, \"Ecliptic\", fontsize=12, color=\"gray\",\n",
" ha=\"left\", va=\"bottom\", transform=sp.ax.projection)\n",
"\n",
"l_vals = np.linspace(0, 360, 1000)\n",
"for b in [0, 10, -10]:\n",
Expand Down Expand Up @@ -773,7 +772,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.11"
"version": "3.13.9"
},
"toc-autonumbering": false
},
Expand Down
Loading
Loading