Skip to content

Commit 106c689

Browse files
committed
Guide to generate image cutouts with DRP outputs
1 parent 6ae4ba4 commit 106c689

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#########################################
2+
Generating image cutouts with DRP outputs
3+
#########################################
4+
5+
To generate image cutouts using the `plotImageSubtractionCutouts` task from `analysis_ap` you need to use the
6+
code listed below.
7+
8+
Note, the code differs from its general implementation when using DRP outputs, since you
9+
are required to iterate through each of the references individually, retrieve the diaSources (using the
10+
`goodSeeingDiff_diaSrcTable` not `goodSeeingDiff_diaSrc` to have data in the correct format for this task).
11+
12+
.. code-block:: text
13+
14+
repo = /repo/main
15+
collections = /path/to/your/DRP/collection
16+
butler = dafButler.Butler(repo, collections=collections)
17+
18+
cutoutConfigDrp = PlotImageSubtractionCutoutsConfig()
19+
cutoutTaskDrp = PlotImageSubtractionCutoutsTask(
20+
config=cutoutConfigDrp, output_path=output
21+
)
22+
23+
data_refs = butler.query_datasets(
24+
"goodSeeingDiff_diaSrcTable", where=where, limit=limit
25+
)
26+
27+
for ref in data_refs:
28+
try:
29+
dv_diaSourceTable = butler.get(ref)
30+
except:
31+
print(f"Could not load diaSource table for {ref.dataId}")
32+
continue
33+
else:
34+
dv_diaSourceTable["instrument"] = "LSSTComCam"
35+
cutoutTaskDrp.run(dv_diaSourceTable, butler)

0 commit comments

Comments
 (0)