sessions of 2026-11-18 (the optimization campaign; three runs without summary, interrupted and rerun)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8a81c53cd9
commit
0cfbd1b7bc
363 files changed
+30822
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
# Lists the Perturbation labels of the given stations that a Perturbation event of detectors copy A overlaps and no Perturbation event of copy B does (what B absorbed). Args: <labels folder> <data folder> <detectors A> <detectors B> STATION...
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
labels_dir, data_dir, a, b, *stations = sys.argv[1:]
|
||||
|
||||
|
||||
def perturbations(det, st):
|
||||
out = subprocess.run([sys.executable, str(Path(det) / "scripts" / "categories.py"), str(Path(data_dir) / st)],
|
||||
capture_output=True, text=True).stdout
|
||||
return [(l.split()[0], l.split()[2]) for l in out.splitlines() if " Perturbation " in l]
|
||||
|
||||
|
||||
for st in stations:
|
||||
pa, pb = perturbations(a, st), perturbations(b, st)
|
||||
for l in map(json.loads, filter(str.strip, open(Path(labels_dir) / f"{st}.jsonl"))):
|
||||
if l["family"] != "Perturbation":
|
||||
continue
|
||||
hit = lambda ev: any(s <= l["end"] and e >= l["start"] for s, e in ev) # noqa: E731
|
||||
if hit(pa) and not hit(pb):
|
||||
print(st, l["id"], l["start"], l["end"], "|", l["description"][:200])
|
||||
Reference in new issue
Block a user