Skip to content

Commit 3a71ef0

Browse files
committed
add flags in the merge tool for the different merge strategies
1 parent f5341c3 commit 3a71ef0

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/ctapipe/tools/merge.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ class MergeTool(Tool):
8282
}
8383

8484
flags = {
85+
"single-ob": (
86+
{"HDF5Merger": {"merge_strategy": "events-single-ob"}},
87+
(
88+
"By default, the merge tool assumes it is merging multiple"
89+
" observation blocks. This option switches to merging multiple"
90+
" chunks of events of the same ob."
91+
),
92+
),
93+
"attach-monitoring": (
94+
{"HDF5Merger": {"merge_strategy": "monitoring-only"}},
95+
("Attach monitoring data from the same observation block."),
96+
),
8597
"progress": (
8698
{"MergeTool": {"progress_bar": True}},
8799
"Show a progress bar for all given input files",

src/ctapipe/tools/tests/test_merge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def test_merge_single_ob(tmp_path, dl1_file, dl1_chunks):
242242
str(path1),
243243
str(path2),
244244
f"--output={output}",
245-
"--merge-strategy=events-single-ob",
245+
"--single-ob",
246246
],
247247
cwd=tmp_path,
248248
raises=True,
@@ -268,7 +268,7 @@ def test_merge_single_ob_append(tmp_path, dl1_file, dl1_chunks):
268268
argv=[
269269
str(path1),
270270
f"--output={output}",
271-
"--merge-strategy=events-single-ob",
271+
"--single-ob",
272272
],
273273
cwd=tmp_path,
274274
raises=True,
@@ -279,7 +279,7 @@ def test_merge_single_ob_append(tmp_path, dl1_file, dl1_chunks):
279279
argv=[
280280
str(path2),
281281
f"--output={output}",
282-
"--merge-strategy=events-single-ob",
282+
"--single-ob",
283283
"--append",
284284
],
285285
cwd=tmp_path,
@@ -308,6 +308,6 @@ def test_merge_exceptions(
308308
str(dl1_mon_pointing_file),
309309
"--append",
310310
"--monitoring",
311-
"--merge-strategy=events-single-ob",
311+
"--single-ob",
312312
]
313313
run_tool(MergeTool(), argv=argv, cwd=tmp_path)

0 commit comments

Comments
 (0)