Skip to content

Commit 6164937

Browse files
authored
fix storage/quota issue
1 parent 9371c4f commit 6164937

1 file changed

Lines changed: 77 additions & 4 deletions

File tree

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

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"Data Release: DP1 <br>\n",
2020
"Container Size: large <br>\n",
2121
"LSST Science Pipelines version: r29.1.1 <br>\n",
22-
"Last verified to run: 2025-06-24 <br>\n",
22+
"Last verified to run: 2025-07-25 <br>\n",
2323
"Repository: <a href=\"https://github.com/lsst/tutorial-notebooks\">github.com/lsst/tutorial-notebooks</a> <br>"
2424
]
2525
},
@@ -543,7 +543,7 @@
543543
"id": "85394b0f-7222-4624-89af-4c1f9c70d7d8",
544544
"metadata": {},
545545
"source": [
546-
"Users cannot write to the main DP1 Butler repository. Instead, make a writable local repository within your current directory 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 your current working directory."
546+
"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 `/deleted-sundays` temporary space that gets deleted weekly. Use this temporary space because the custom coadd processing produces of order a gigabyte of intermediate files."
547547
]
548548
},
549549
{
@@ -553,7 +553,7 @@
553553
"metadata": {},
554554
"outputs": [],
555555
"source": [
556-
"local_repo_name = os.path.join(os.getenv(\"HOME\"), \"my_local_repo\")\n",
556+
"local_repo_name = os.path.join('/deleted-sundays', my_username, \"my_local_repo\")\n",
557557
"out_butler = executor.use_local_butler(local_repo_name)"
558558
]
559559
},
@@ -634,13 +634,86 @@
634634
"> Figure 2: The custom `deep_coadd` image using only the selected subset of input visit images."
635635
]
636636
},
637+
{
638+
"cell_type": "markdown",
639+
"id": "a95de02e-d676-4ca3-8fb8-d1afe410e1d4",
640+
"metadata": {},
641+
"source": [
642+
"### 3.4. Copy the custom coadd output file"
643+
]
644+
},
645+
{
646+
"cell_type": "markdown",
647+
"id": "aa9eacc5-18b0-4a8a-aa05-4b45c12aeee8",
648+
"metadata": {},
649+
"source": [
650+
"The writable Butler repository used for custom coaddition is located within a temporary storage area. The Butler `retrieveArtifacts` method can be used to retrieve a copy of just the custom coadd output file, without copying intermediate files generated by the processing, and placing the custom coadd output file in a desired location. This can be useful to preserve the custom coadd image file without filling up a significant amount of disk quota in a permanent location. Start by retrieving the dataset reference for the custom coadd image output file."
651+
]
652+
},
637653
{
638654
"cell_type": "code",
639655
"execution_count": null,
640656
"id": "91ee3647-96c9-4aa9-9d61-ced39b8c1990",
641657
"metadata": {},
642658
"outputs": [],
643-
"source": []
659+
"source": [
660+
"refs = out_butler.query_datasets('deep_coadd_predetection',\n",
661+
" collections=executor.quantum_graph.metadata[\"output_run\"])"
662+
]
663+
},
664+
{
665+
"cell_type": "markdown",
666+
"id": "f5dee19c-5bc9-4f5b-af9c-aaabfec6ee77",
667+
"metadata": {},
668+
"source": [
669+
"As an example, choose to put the copy of the custom coadd output file in your space within the `/deleted-sundays` area."
670+
]
671+
},
672+
{
673+
"cell_type": "code",
674+
"execution_count": null,
675+
"id": "9e55d973-a30d-4891-a896-6b62e6b08a9c",
676+
"metadata": {},
677+
"outputs": [],
678+
"source": [
679+
"outdir = os.path.join('/deleted-sundays', my_username)"
680+
]
681+
},
682+
{
683+
"cell_type": "markdown",
684+
"id": "e639644d-14e2-47ba-92d1-03a952f634c2",
685+
"metadata": {},
686+
"source": [
687+
"*Option*: instead choose to copy the custom coadd output file to your home directory, where it will not be deleted within a week."
688+
]
689+
},
690+
{
691+
"cell_type": "code",
692+
"execution_count": null,
693+
"id": "e0f81548-e8c0-4854-b2f7-767da392f27b",
694+
"metadata": {},
695+
"outputs": [],
696+
"source": [
697+
"# outdir = os.getenv(\"HOME\")"
698+
]
699+
},
700+
{
701+
"cell_type": "markdown",
702+
"id": "1fdd59a0-0454-441d-b60f-4d6aeb10d147",
703+
"metadata": {},
704+
"source": [
705+
"Copy the FITS file containing the custom coadd image to the desired location."
706+
]
707+
},
708+
{
709+
"cell_type": "code",
710+
"execution_count": null,
711+
"id": "a3913c72-355a-4289-8061-b22785ff7df9",
712+
"metadata": {},
713+
"outputs": [],
714+
"source": [
715+
"out_butler.retrieveArtifacts(refs, outdir, preserve_path=False, transfer=\"copy\", overwrite=True)"
716+
]
644717
}
645718
],
646719
"metadata": {

0 commit comments

Comments
 (0)