From 3d362b05d38a0bc516d392149520dd99c888fedf Mon Sep 17 00:00:00 2001 From: Shenming Fu Date: Tue, 7 Apr 2026 21:38:26 +0000 Subject: [PATCH 1/4] updated 105_6 --- .../105_6_Create_custom_coadd_images.ipynb | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb index 7a884efe..9ae89d22 100644 --- a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb +++ b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb @@ -22,7 +22,7 @@ "Data Release: Data Preview 1
\n", "Container Size: large
\n", "LSST Science Pipelines version: r29.2.0
\n", - "Last verified to run: 2025-09-02
\n", + "Last verified to run: 2026-04-07
\n", "Repository: github.com/lsst/tutorial-notebooks
" ] }, @@ -547,7 +547,38 @@ "id": "85394b0f-7222-4624-89af-4c1f9c70d7d8", "metadata": {}, "source": [ - "Users cannot write to the main DP1 Butler repository. Instead, make a writable repository where custom coadd outputs will be written. The call to `use_local_butler` creates a new directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space that gets deleted weekly. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files." + "Users cannot write to the main DP1 Butler repository. Instead, make a writable repository where custom coadd outputs will be written. \n", + "\n", + "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space that gets deleted every Sunday. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. Do not run this step (and following steps) right before or during Sunday cleaning time. \n", + "\n", + "Note `use_local_butler` does not create a top-level directory, but rather one in the scratch space; it does not create `$SCRATCH_DIR`. Thus, check whether that user scratch exists first before using it and create it if it does not.\n", + "\n", + "Remove and recreate `scratch_path` if somehow it is not a directory but does exist. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "108cb108-1ee3-4164-b6e9-b6a01a9fe639", + "metadata": {}, + "outputs": [], + "source": [ + "scratch_path = Path(os.getenv(\"SCRATCH_DIR\"))\n", + "\n", + "if not scratch_path.exists():\n", + " scratch_path.mkdir(parents=True)\n", + " \n", + "elif not scratch_path.is_dir():\n", + " scratch_path.unlink()\n", + " scratch_path.mkdir()" + ] + }, + { + "cell_type": "markdown", + "id": "a055e8f6-865e-4658-a814-aa928ca44c8d", + "metadata": {}, + "source": [ + "Set the directory that will contain the local Butler repository." ] }, { @@ -557,7 +588,7 @@ "metadata": {}, "outputs": [], "source": [ - "local_repo_path = Path(os.getenv(\"SCRATCH_DIR\"), \"my_local_repo\")\n", + "local_repo_path = Path(scratch_path, \"my_local_repo\")\n", "out_butler = executor.use_local_butler(local_repo_path)" ] }, @@ -625,7 +656,7 @@ "fig = plt.figure(figsize=(10, 8))\n", "afw_display = afwDisplay.Display(frame=fig)\n", "afw_display.scale('asinh', 'zscale')\n", - "afw_display.mtv(deepCoadd.image)\n", + "afw_display.image(deepCoadd.image)\n", "plt.gca().axis('on')\n", "plt.show()" ] @@ -736,8 +767,8 @@ "metadata": {}, "outputs": [], "source": [ - "%reset -f\n", - "! rm -r $SCRATCH_DIR/my_local_repo" + "# %reset -f\n", + "# ! rm -r $SCRATCH_DIR/my_local_repo" ] } ], From e0559983b2dbc2398b66debbcf5d873f4ab0f437 Mon Sep 17 00:00:00 2001 From: Shenming Fu Date: Wed, 8 Apr 2026 00:26:56 +0000 Subject: [PATCH 2/4] updated 105_6 --- .../105_6_Create_custom_coadd_images.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb index 9ae89d22..31a9ede8 100644 --- a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb +++ b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb @@ -549,7 +549,7 @@ "source": [ "Users cannot write to the main DP1 Butler repository. Instead, make a writable repository where custom coadd outputs will be written. \n", "\n", - "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space that gets deleted every Sunday. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. Do not run this step (and following steps) right before or during Sunday cleaning time. \n", + "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space (on the Rubin Science Platform, RSP) that gets deleted every Sunday morning (Pacific Time). Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. Do not run this step (and following steps) right before or during the Sunday cleaning time. \n", "\n", "Note `use_local_butler` does not create a top-level directory, but rather one in the scratch space; it does not create `$SCRATCH_DIR`. Thus, check whether that user scratch exists first before using it and create it if it does not.\n", "\n", From c339bd07a7f28a139ebc5e9e410cbb8d34ba8825 Mon Sep 17 00:00:00 2001 From: Shenming Fu Date: Thu, 9 Apr 2026 00:45:02 +0000 Subject: [PATCH 3/4] updated 105_6 --- .../105_6_Create_custom_coadd_images.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb index 31a9ede8..c8d97e47 100644 --- a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb +++ b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb @@ -549,7 +549,7 @@ "source": [ "Users cannot write to the main DP1 Butler repository. Instead, make a writable repository where custom coadd outputs will be written. \n", "\n", - "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space (on the Rubin Science Platform, RSP) that gets deleted every Sunday morning (Pacific Time). Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. Do not run this step (and following steps) right before or during the Sunday cleaning time. \n", + "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space (on the Rubin Science Platform, RSP) that gets deleted every Sunday around noon Pacific Time. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. Do not run this step (and following steps) right before or during the Sunday cleaning time. \n", "\n", "Note `use_local_butler` does not create a top-level directory, but rather one in the scratch space; it does not create `$SCRATCH_DIR`. Thus, check whether that user scratch exists first before using it and create it if it does not.\n", "\n", @@ -563,11 +563,13 @@ "metadata": {}, "outputs": [], "source": [ - "scratch_path = Path(os.getenv(\"SCRATCH_DIR\"))\n", + "scratch_dir = os.getenv(\"SCRATCH_DIR\")\n", + "if scratch_dir is not None:\n", + " scratch_path = Path(scratch_dir)\n", "\n", "if not scratch_path.exists():\n", " scratch_path.mkdir(parents=True)\n", - " \n", + "\n", "elif not scratch_path.is_dir():\n", " scratch_path.unlink()\n", " scratch_path.mkdir()" From 13c5f060e0c80b6c3ae7c1266d4797558c0c035d Mon Sep 17 00:00:00 2001 From: Shenming Fu Date: Thu, 9 Apr 2026 00:51:26 +0000 Subject: [PATCH 4/4] updated 105_6 --- .../105_6_Create_custom_coadd_images.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb index c8d97e47..64c12b3b 100644 --- a/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb +++ b/DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb @@ -549,7 +549,7 @@ "source": [ "Users cannot write to the main DP1 Butler repository. Instead, make a writable repository where custom coadd outputs will be written. \n", "\n", - "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space (on the Rubin Science Platform, RSP) that gets deleted every Sunday around noon Pacific Time. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. Do not run this step (and following steps) right before or during the Sunday cleaning time. \n", + "The call to `use_local_butler` sets a directory that will contain the local Butler repository, within the `$SCRATCH_DIR` temporary space (on the Rubin Science Platform, RSP) that gets deleted every Sunday around noon Pacific Time. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files. **Do not** run this step (and following steps) right before or during the Sunday cleaning time. \n", "\n", "Note `use_local_butler` does not create a top-level directory, but rather one in the scratch space; it does not create `$SCRATCH_DIR`. Thus, check whether that user scratch exists first before using it and create it if it does not.\n", "\n",