legend-dataflow-scripts 0.3.0a6__tar.gz → 0.3.1__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.0a6/src/legend_dataflow_scripts.egg-info → legend_dataflow_scripts-0.3.1}/PKG-INFO +2 -2
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/pyproject.toml +1 -1
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1/src/legend_dataflow_scripts.egg-info}/PKG-INFO +2 -2
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legend_dataflow_scripts.egg-info/requires.txt +1 -1
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/_version.py +3 -3
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/dplms.py +37 -23
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/eopt.py +1 -1
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/svm.py +4 -2
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/LICENSE +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/README.md +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/setup.cfg +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legend_dataflow_scripts.egg-info/SOURCES.txt +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legend_dataflow_scripts.egg-info/dependency_links.txt +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legend_dataflow_scripts.egg-info/entry_points.txt +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legend_dataflow_scripts.egg-info/not-zip-safe +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legend_dataflow_scripts.egg-info/top_level.txt +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/evtsel.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/nopt.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/pz.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/dsp/svm_build.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/hit/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/hit/aoe.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/hit/ecal.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/hit/lq.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/par/geds/hit/qc.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/tier/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/tier/dsp.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/tier/hit.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/alias_table.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/cfgtools.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/convert_np.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/log.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/plot_dict.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/utils/pulser_removal.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/workflow/__init__.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/workflow/execenv.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/workflow/filedb.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/src/legenddataflowscripts/workflow/pre_compile_catalog.py +0 -0
- {legend_dataflow_scripts-0.3.0a6 → legend_dataflow_scripts-0.3.1}/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.1
|
|
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
|
|
@@ -19,7 +19,7 @@ Requires-Python: >=3.11
|
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
Requires-Dist: colorlog
|
|
21
21
|
Requires-Dist: dbetto>=1.2.3
|
|
22
|
-
Requires-Dist: pygama>=2.3.
|
|
22
|
+
Requires-Dist: pygama>=2.3.8
|
|
23
23
|
Requires-Dist: dspeed>=2.0
|
|
24
24
|
Requires-Dist: pylegendmeta>=1.2.5
|
|
25
25
|
Requires-Dist: legend-pydataobj>=1.16
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: legend-dataflow-scripts
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
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
|
|
@@ -19,7 +19,7 @@ Requires-Python: >=3.11
|
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
Requires-Dist: colorlog
|
|
21
21
|
Requires-Dist: dbetto>=1.2.3
|
|
22
|
-
Requires-Dist: pygama>=2.3.
|
|
22
|
+
Requires-Dist: pygama>=2.3.8
|
|
23
23
|
Requires-Dist: dspeed>=2.0
|
|
24
24
|
Requires-Dist: pylegendmeta>=1.2.5
|
|
25
25
|
Requires-Dist: legend-pydataobj>=1.16
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.3.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 3,
|
|
21
|
+
__version__ = version = '0.3.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 3, 1)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g67f81227e'
|
|
@@ -9,7 +9,9 @@ import numpy as np
|
|
|
9
9
|
import pygama.math.distributions as pmd # noqa: F401
|
|
10
10
|
from dbetto.catalog import Props
|
|
11
11
|
from lgdo import Array, Table, lh5
|
|
12
|
+
from pygama.pargen.data_cleaning import generate_cuts
|
|
12
13
|
from pygama.pargen.dplms_ge_dict import dplms_ge_dict
|
|
14
|
+
from pygama.pargen.dsp_optimize import run_one_dsp
|
|
13
15
|
|
|
14
16
|
from ....utils import build_log, convert_dict_np_to_float
|
|
15
17
|
|
|
@@ -114,12 +116,12 @@ def par_geds_dsp_dplms() -> None:
|
|
|
114
116
|
energies = lh5.read_as(
|
|
115
117
|
f"{args.raw_table_name}/daqenergy", fft_files, library="np"
|
|
116
118
|
)
|
|
117
|
-
|
|
119
|
+
eidxs = np.where(energies <= 10)[0]
|
|
118
120
|
raw_fft = lh5.read(
|
|
119
121
|
args.raw_table_name,
|
|
120
122
|
fft_files,
|
|
121
123
|
n_rows=dplms_dict["n_baselines"],
|
|
122
|
-
idx=
|
|
124
|
+
idx=eidxs,
|
|
123
125
|
)
|
|
124
126
|
t1 = time.time()
|
|
125
127
|
msg = f"Time to load fft data {(t1 - t0):.2f} s, total events {len(raw_fft)}"
|
|
@@ -142,30 +144,43 @@ def par_geds_dsp_dplms() -> None:
|
|
|
142
144
|
if isinstance(dsp_config, str | list):
|
|
143
145
|
dsp_config = Props.read_from(dsp_config)
|
|
144
146
|
|
|
147
|
+
dsp_fft = run_one_dsp(raw_fft, dsp_config, db_dict=db_dict)
|
|
148
|
+
|
|
149
|
+
cut_dict = generate_cuts(dsp_fft, cut_dict=dplms_dict["bls_cut_pars"])
|
|
150
|
+
log.debug("Cuts are %s", cut_dict)
|
|
151
|
+
idxs = np.full(len(dsp_fft), True, dtype=bool)
|
|
152
|
+
for outname, info in cut_dict.items():
|
|
153
|
+
outcol = dsp_fft.eval(info["expression"], info.get("parameters", None))
|
|
154
|
+
dsp_fft.add_column(outname, outcol)
|
|
155
|
+
for cut in cut_dict:
|
|
156
|
+
idxs = dsp_fft[cut].nda & idxs
|
|
157
|
+
|
|
158
|
+
selected_eidxs = eidxs[: len(dsp_fft)]
|
|
159
|
+
raw_fft = lh5.read(
|
|
160
|
+
args.raw_table_name,
|
|
161
|
+
fft_files,
|
|
162
|
+
n_rows=dplms_dict["n_baselines"],
|
|
163
|
+
idx=selected_eidxs[idxs],
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
log.debug("Applied Cuts")
|
|
167
|
+
|
|
168
|
+
out_dict, plot_dict = dplms_ge_dict(
|
|
169
|
+
raw_fft,
|
|
170
|
+
raw_cal,
|
|
171
|
+
dsp_config,
|
|
172
|
+
db_dict,
|
|
173
|
+
dplms_dict,
|
|
174
|
+
fom_func=eval(dplms_dict.get("fom_func", "pmd.gauss_on_step")),
|
|
175
|
+
display=1 if args.plot_path else 0,
|
|
176
|
+
)
|
|
145
177
|
if args.plot_path:
|
|
146
|
-
out_dict, plot_dict = dplms_ge_dict(
|
|
147
|
-
raw_fft,
|
|
148
|
-
raw_cal,
|
|
149
|
-
dsp_config,
|
|
150
|
-
db_dict,
|
|
151
|
-
dplms_dict,
|
|
152
|
-
fom_func=eval(dplms_dict.get("fom_func", "pmd.gauss_on_step")),
|
|
153
|
-
display=1,
|
|
154
|
-
)
|
|
155
178
|
if args.inplots:
|
|
156
179
|
with Path(args.inplots).open("rb") as r:
|
|
157
180
|
inplot_dict = pkl.load(r)
|
|
158
181
|
inplot_dict.update({"dplms": plot_dict})
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
out_dict = dplms_ge_dict(
|
|
162
|
-
raw_fft,
|
|
163
|
-
raw_cal,
|
|
164
|
-
dsp_config,
|
|
165
|
-
db_dict,
|
|
166
|
-
dplms_dict,
|
|
167
|
-
fom_func=eval(dplms_dict.get("fom_func", "pmd.gauss_on_step")),
|
|
168
|
-
)
|
|
182
|
+
else:
|
|
183
|
+
inplot_dict = {"dplms": plot_dict}
|
|
169
184
|
|
|
170
185
|
coeffs = out_dict["dplms"].pop("coefficients")
|
|
171
186
|
dplms_pars = Table(col_dict={"coefficients": Array(coeffs)})
|
|
@@ -177,7 +192,7 @@ def par_geds_dsp_dplms() -> None:
|
|
|
177
192
|
else:
|
|
178
193
|
out_dict = {}
|
|
179
194
|
dplms_pars = Table(col_dict={"coefficients": Array([])})
|
|
180
|
-
if args.inplots:
|
|
195
|
+
if args.plot_path and args.inplots:
|
|
181
196
|
with Path(args.inplots).open("rb") as r:
|
|
182
197
|
inplot_dict = pkl.load(r)
|
|
183
198
|
else:
|
|
@@ -192,7 +207,6 @@ def par_geds_dsp_dplms() -> None:
|
|
|
192
207
|
lh5_file=args.lh5_path,
|
|
193
208
|
wo_mode="overwrite",
|
|
194
209
|
)
|
|
195
|
-
|
|
196
210
|
Path(args.dsp_pars).parent.mkdir(parents=True, exist_ok=True)
|
|
197
211
|
Props.write_to(args.dsp_pars, convert_dict_np_to_float(db_dict))
|
|
198
212
|
|
|
@@ -416,7 +416,7 @@ def par_geds_dsp_eopt() -> None:
|
|
|
416
416
|
|
|
417
417
|
Path(args.qbb_grid_path).parent.mkdir(parents=True, exist_ok=True)
|
|
418
418
|
with Path(args.qbb_grid_path).open("wb") as f:
|
|
419
|
-
pkl.dump(optimisers, f)
|
|
419
|
+
pkl.dump({"eopt": optimisers}, f, protocol=pkl.HIGHEST_PROTOCOL)
|
|
420
420
|
|
|
421
421
|
else:
|
|
422
422
|
Path(args.qbb_grid_path).touch()
|
|
@@ -37,12 +37,14 @@ def par_geds_dsp_svm() -> None:
|
|
|
37
37
|
"--output-file", help="output par file", type=str, required=True
|
|
38
38
|
)
|
|
39
39
|
argparser.add_argument(
|
|
40
|
-
"--input-file",
|
|
40
|
+
"--input-file",
|
|
41
|
+
help="input par file",
|
|
42
|
+
type=str, # required=True
|
|
41
43
|
)
|
|
42
44
|
argparser.add_argument("--svm-file", help="svm file", required=True)
|
|
43
45
|
args = argparser.parse_args()
|
|
44
46
|
|
|
45
|
-
par_data = Props.read_from(args.input_file)
|
|
47
|
+
par_data = Props.read_from(args.input_file) if args.input_file else {}
|
|
46
48
|
|
|
47
49
|
file = f"'$_/{Path(args.svm_file).name}'"
|
|
48
50
|
|
|
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
|