Skip to content

Commit 3d362b0

Browse files
committed
updated 105_6
1 parent 604ca87 commit 3d362b0

1 file changed

Lines changed: 37 additions & 6 deletions

File tree

DP1/100_How_to_Use_RSP_Tools/105_Image_reprocessing/105_6_Create_custom_coadd_images.ipynb

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Data Release: <a href=\"https://dp1.lsst.io/\">Data Preview 1</a> <br>\n",
2323
"Container Size: large <br>\n",
2424
"LSST Science Pipelines version: r29.2.0 <br>\n",
25-
"Last verified to run: 2025-09-02 <br>\n",
25+
"Last verified to run: 2026-04-07 <br>\n",
2626
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>"
2727
]
2828
},
@@ -547,7 +547,38 @@
547547
"id": "85394b0f-7222-4624-89af-4c1f9c70d7d8",
548548
"metadata": {},
549549
"source": [
550-
"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."
550+
"Users cannot write to the main DP1 Butler repository. Instead, make a writable repository where custom coadd outputs will be written. \n",
551+
"\n",
552+
"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",
553+
"\n",
554+
"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",
555+
"\n",
556+
"Remove and recreate `scratch_path` if somehow it is not a directory but does exist. "
557+
]
558+
},
559+
{
560+
"cell_type": "code",
561+
"execution_count": null,
562+
"id": "108cb108-1ee3-4164-b6e9-b6a01a9fe639",
563+
"metadata": {},
564+
"outputs": [],
565+
"source": [
566+
"scratch_path = Path(os.getenv(\"SCRATCH_DIR\"))\n",
567+
"\n",
568+
"if not scratch_path.exists():\n",
569+
" scratch_path.mkdir(parents=True)\n",
570+
" \n",
571+
"elif not scratch_path.is_dir():\n",
572+
" scratch_path.unlink()\n",
573+
" scratch_path.mkdir()"
574+
]
575+
},
576+
{
577+
"cell_type": "markdown",
578+
"id": "a055e8f6-865e-4658-a814-aa928ca44c8d",
579+
"metadata": {},
580+
"source": [
581+
"Set the directory that will contain the local Butler repository."
551582
]
552583
},
553584
{
@@ -557,7 +588,7 @@
557588
"metadata": {},
558589
"outputs": [],
559590
"source": [
560-
"local_repo_path = Path(os.getenv(\"SCRATCH_DIR\"), \"my_local_repo\")\n",
591+
"local_repo_path = Path(scratch_path, \"my_local_repo\")\n",
561592
"out_butler = executor.use_local_butler(local_repo_path)"
562593
]
563594
},
@@ -625,7 +656,7 @@
625656
"fig = plt.figure(figsize=(10, 8))\n",
626657
"afw_display = afwDisplay.Display(frame=fig)\n",
627658
"afw_display.scale('asinh', 'zscale')\n",
628-
"afw_display.mtv(deepCoadd.image)\n",
659+
"afw_display.image(deepCoadd.image)\n",
629660
"plt.gca().axis('on')\n",
630661
"plt.show()"
631662
]
@@ -736,8 +767,8 @@
736767
"metadata": {},
737768
"outputs": [],
738769
"source": [
739-
"%reset -f\n",
740-
"! rm -r $SCRATCH_DIR/my_local_repo"
770+
"# %reset -f\n",
771+
"# ! rm -r $SCRATCH_DIR/my_local_repo"
741772
]
742773
}
743774
],

0 commit comments

Comments
 (0)