legend-dataflow-scripts 0.3.0a1__tar.gz → 0.3.0a3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {legend_dataflow_scripts-0.3.0a1/src/legend_dataflow_scripts.egg-info → legend_dataflow_scripts-0.3.0a3}/PKG-INFO +1 -1
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3/src/legend_dataflow_scripts.egg-info}/PKG-INFO +1 -1
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/_version.py +3 -3
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/dplms.py +1 -1
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/evtsel.py +7 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/nopt.py +1 -1
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/tier/dsp.py +6 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/log.py +38 -4
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/LICENSE +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/README.md +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/pyproject.toml +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/setup.cfg +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legend_dataflow_scripts.egg-info/SOURCES.txt +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legend_dataflow_scripts.egg-info/dependency_links.txt +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legend_dataflow_scripts.egg-info/entry_points.txt +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legend_dataflow_scripts.egg-info/not-zip-safe +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legend_dataflow_scripts.egg-info/requires.txt +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legend_dataflow_scripts.egg-info/top_level.txt +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/eopt.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/pz.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/svm.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/dsp/svm_build.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/hit/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/hit/aoe.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/hit/ecal.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/hit/lq.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/par/geds/hit/qc.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/tier/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/tier/hit.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/alias_table.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/cfgtools.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/convert_np.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/plot_dict.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/utils/pulser_removal.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/workflow/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/workflow/execenv.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/workflow/filedb.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/workflow/pre_compile_catalog.py +0 -0
- {legend_dataflow_scripts-0.3.0a1 → legend_dataflow_scripts-0.3.0a3}/src/legenddataflowscripts/workflow/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: legend-dataflow-scripts
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.0a3
|
|
4
4
|
Summary: Python package for the processing scripts for LEGEND-200 data
|
|
5
5
|
Author-email: George Marshall <ggmarsh@uw.edu>, Luigi Pertoldi <gipert@pm.me>
|
|
6
6
|
Maintainer: The LEGEND Collaboration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: legend-dataflow-scripts
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.0a3
|
|
4
4
|
Summary: Python package for the processing scripts for LEGEND-200 data
|
|
5
5
|
Author-email: George Marshall <ggmarsh@uw.edu>, Luigi Pertoldi <gipert@pm.me>
|
|
6
6
|
Maintainer: The LEGEND Collaboration
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.3.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 3, 0, '
|
|
31
|
+
__version__ = version = '0.3.0a3'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 3, 0, 'a3')
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'gca936aab2'
|
|
@@ -65,7 +65,7 @@ def par_geds_dsp_dplms() -> None:
|
|
|
65
65
|
energies = lh5.read_as(
|
|
66
66
|
f"{args.raw_table_name}/daqenergy", fft_files, library="np"
|
|
67
67
|
)
|
|
68
|
-
idxs = np.where(energies
|
|
68
|
+
idxs = np.where(energies <= 10)[0]
|
|
69
69
|
raw_fft = lh5.read(
|
|
70
70
|
args.raw_table_name,
|
|
71
71
|
fft_files,
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
4
|
import json
|
|
5
|
+
import sys
|
|
5
6
|
import time
|
|
6
7
|
import warnings
|
|
7
8
|
from bisect import bisect_left
|
|
@@ -99,6 +100,12 @@ def par_geds_dsp_evtsel() -> None:
|
|
|
99
100
|
required=False,
|
|
100
101
|
)
|
|
101
102
|
|
|
103
|
+
argparser.add_argument(
|
|
104
|
+
"--channel",
|
|
105
|
+
type=str,
|
|
106
|
+
help="Channel to process; required if --raw-cal-curve is set",
|
|
107
|
+
required="--raw-cal-curve" in sys.argv,
|
|
108
|
+
)
|
|
102
109
|
argparser.add_argument("--log", help="log_file", type=str)
|
|
103
110
|
|
|
104
111
|
argparser.add_argument(
|
|
@@ -63,7 +63,7 @@ def par_geds_dsp_nopt() -> None:
|
|
|
63
63
|
energies = lh5.read_as(
|
|
64
64
|
f"{args.raw_table_name}/daqenergy", raw_files, library="np"
|
|
65
65
|
)
|
|
66
|
-
idxs = np.where(energies
|
|
66
|
+
idxs = np.where(energies <= 10)[0]
|
|
67
67
|
tb_data = lh5.read(
|
|
68
68
|
args.raw_table_name, raw_files, n_rows=opt_dict["n_events"], idx=idxs
|
|
69
69
|
)
|
|
@@ -95,6 +95,8 @@ def build_tier_dsp() -> None:
|
|
|
95
95
|
# check if the raw tables are all existing
|
|
96
96
|
if len(lh5.ls(args.input, input_tbl_name)) > 0:
|
|
97
97
|
dsp_cfg_tbl_dict[input_tbl_name] = Props.read_from(file)
|
|
98
|
+
msg = f"found table {input_tbl_name} in {args.input}"
|
|
99
|
+
log.debug(msg)
|
|
98
100
|
else:
|
|
99
101
|
msg = f"table {input_tbl_name} not found in {args.input} skipping"
|
|
100
102
|
log.info(msg)
|
|
@@ -147,6 +149,8 @@ def build_tier_dsp() -> None:
|
|
|
147
149
|
kwargs = {
|
|
148
150
|
"raw_in": args.input,
|
|
149
151
|
"dsp_out": dsp_files[i],
|
|
152
|
+
"lh5_tables": list(config.keys()),
|
|
153
|
+
"base_group": "",
|
|
150
154
|
"chan_config": config,
|
|
151
155
|
"database": database_dict,
|
|
152
156
|
"write_mode": "r",
|
|
@@ -173,6 +177,8 @@ def build_tier_dsp() -> None:
|
|
|
173
177
|
build_dsp(
|
|
174
178
|
raw_in=args.input,
|
|
175
179
|
dsp_out=args.output,
|
|
180
|
+
lh5_tables=list(dsp_cfg_tbl_dict.keys()),
|
|
181
|
+
base_group="",
|
|
176
182
|
database=database_dict,
|
|
177
183
|
chan_config=dsp_cfg_tbl_dict,
|
|
178
184
|
write_mode="r",
|
|
@@ -26,7 +26,7 @@ class StreamToLogger:
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def build_log(
|
|
29
|
-
config_dict: dict, log_file: str | None = None, fallback: str = "prod"
|
|
29
|
+
config_dict: dict | str, log_file: str | None = None, fallback: str = "prod"
|
|
30
30
|
) -> logging.Logger:
|
|
31
31
|
"""Build a logger from a configuration dictionary.
|
|
32
32
|
|
|
@@ -39,10 +39,22 @@ def build_log(
|
|
|
39
39
|
log_file
|
|
40
40
|
The path to the log file.
|
|
41
41
|
"""
|
|
42
|
-
|
|
42
|
+
# Accept either:
|
|
43
|
+
# - a str pointing to a logging properties file
|
|
44
|
+
# - a plain logging dict (handlers/formatters/etc.)
|
|
45
|
+
# - a dict already containing "options" -> {"logging": ...}
|
|
46
|
+
# If a dict is provided and it already contains an "options" key, assume
|
|
47
|
+
# caller set options explicitly (so we must not wrap it).
|
|
48
|
+
if isinstance(config_dict, str) or (
|
|
49
|
+
isinstance(config_dict, dict) and "options" not in config_dict
|
|
50
|
+
):
|
|
43
51
|
config_dict = {"options": {"logging": config_dict}}
|
|
44
52
|
|
|
45
|
-
if
|
|
53
|
+
if (
|
|
54
|
+
isinstance(config_dict, dict)
|
|
55
|
+
and "options" in config_dict
|
|
56
|
+
and "logging" in config_dict["options"]
|
|
57
|
+
):
|
|
46
58
|
log_config = config_dict["options"]["logging"]
|
|
47
59
|
# if it's a str, interpret it as a path to a file
|
|
48
60
|
if isinstance(log_config, str):
|
|
@@ -50,7 +62,29 @@ def build_log(
|
|
|
50
62
|
|
|
51
63
|
if log_file is not None:
|
|
52
64
|
Path(log_file).parent.mkdir(parents=True, exist_ok=True)
|
|
53
|
-
|
|
65
|
+
# Ensure the logging config has a handlers->dataflow entry; create
|
|
66
|
+
# minimal structure if needed so we can set the filename.
|
|
67
|
+
if isinstance(log_config, dict):
|
|
68
|
+
handlers = log_config.setdefault("handlers", {})
|
|
69
|
+
dataflow = handlers.setdefault("dataflow", {})
|
|
70
|
+
# Set the filename for the dataflow handler
|
|
71
|
+
dataflow["filename"] = log_file
|
|
72
|
+
dataflow.setdefault("class", "logging.FileHandler")
|
|
73
|
+
dataflow.setdefault("level", "INFO")
|
|
74
|
+
log_config.setdefault("version", 1)
|
|
75
|
+
if (
|
|
76
|
+
"handlers" in log_config
|
|
77
|
+
and "dataflow" in log_config["handlers"]
|
|
78
|
+
and "root" not in log_config
|
|
79
|
+
and "loggers" not in log_config
|
|
80
|
+
):
|
|
81
|
+
dataflow_level = log_config["handlers"]["dataflow"].get(
|
|
82
|
+
"level", "INFO"
|
|
83
|
+
)
|
|
84
|
+
log_config["root"] = {
|
|
85
|
+
"level": dataflow_level,
|
|
86
|
+
"handlers": ["dataflow"],
|
|
87
|
+
}
|
|
54
88
|
|
|
55
89
|
dictConfig(log_config)
|
|
56
90
|
log = logging.getLogger(config_dict["options"].get("logger", "prod"))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|