legend-daq2lh5 1.5.0__py3-none-any.whl → 1.6.1__py3-none-any.whl

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.
daq2lh5/raw_buffer.py CHANGED
@@ -66,6 +66,7 @@ keys.
66
66
 
67
67
  from __future__ import annotations
68
68
 
69
+ import logging
69
70
  import os
70
71
 
71
72
  import lgdo
@@ -74,6 +75,8 @@ from lgdo.lh5 import LH5Store
74
75
 
75
76
  from .buffer_processor.buffer_processor import buffer_processor
76
77
 
78
+ log = logging.getLogger(__name__)
79
+
77
80
 
78
81
  class RawBuffer:
79
82
  r"""Base class to represent a buffer of raw data.
@@ -183,6 +186,8 @@ class RawBufferList(list):
183
186
  self.keyed_dict = {}
184
187
  for rb in self:
185
188
  for key in rb.key_list:
189
+ if key in self.keyed_dict:
190
+ log.warning(f"Key {key} is duplicate.")
186
191
  self.keyed_dict[key] = rb
187
192
  return self.keyed_dict
188
193
 
@@ -418,7 +423,7 @@ def expand_rblist_dict(config: dict, kw_dict: dict[str, str]) -> None:
418
423
 
419
424
 
420
425
  def write_to_lh5_and_clear(
421
- raw_buffers: list[RawBuffer], lh5_store: LH5Store = None, **kwargs
426
+ raw_buffers: list[RawBuffer], lh5_store: LH5Store = None, db_dict=None, **kwargs
422
427
  ) -> None:
423
428
  r"""Write a list of :class:`.RawBuffer`\ s to LH5 files and then clears them.
424
429
 
@@ -456,10 +461,18 @@ def write_to_lh5_and_clear(
456
461
  if len(group) == 0:
457
462
  group = "/" # in case out_stream ends with :
458
463
 
464
+ if db_dict is None:
465
+ database = None
466
+ elif rb.out_name in db_dict:
467
+ database = db_dict[rb.out_name]
468
+ elif group in db_dict:
469
+ database = db_dict[group]
470
+ else:
471
+ database = None
459
472
  # If a proc_spec if present for this RawBuffer, process that data and then write to the file!
460
473
  if rb.proc_spec is not None:
461
474
  # Perform the processing as requested in the `proc_spec` from `out_spec` in build_raw
462
- lgdo_to_write = buffer_processor(rb)
475
+ lgdo_to_write = buffer_processor(rb, db_dict=database)
463
476
  else:
464
477
  lgdo_to_write = rb.lgdo
465
478
 
@@ -1,16 +1,17 @@
1
1
  Metadata-Version: 2.4
2
- Name: legend_daq2lh5
3
- Version: 1.5.0
2
+ Name: legend-daq2lh5
3
+ Version: 1.6.1
4
4
  Summary: Convert digitizer data to LH5
5
- Home-page: https://github.com/legend-exp/legend-daq2lh5
6
- Author: Jason Detwiler
7
- Author-email: jasondet@uw.edu
8
- Maintainer: The LEGEND Collaboration
9
- License: GPL-3.0
5
+ Author-email: Jason Detwiler <jasondet@uw.edu>
6
+ Maintainer: The LEGEND collaboration
7
+ Project-URL: Homepage, https://github.com/legend-exp/legend-daq2lh5
8
+ Project-URL: Bug Tracker, https://github.com/legend-exp/legend-daq2lh5/issues
9
+ Project-URL: Discussions, https://github.com/legend-exp/legend-daq2lh5/discussions
10
+ Project-URL: Changelog, https://github.com/legend-exp/legend-daq2lh5/releases
10
11
  Classifier: Development Status :: 4 - Beta
11
12
  Classifier: Intended Audience :: Developers
12
- Classifier: Intended Audience :: Information Technology
13
13
  Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
15
  Classifier: Operating System :: MacOS
15
16
  Classifier: Operating System :: POSIX
16
17
  Classifier: Operating System :: Unix
@@ -18,19 +19,15 @@ Classifier: Programming Language :: Python
18
19
  Classifier: Programming Language :: Python :: 3
19
20
  Classifier: Programming Language :: Python :: 3 :: Only
20
21
  Classifier: Topic :: Scientific/Engineering
21
- Classifier: Topic :: Scientific/Engineering :: Information Analysis
22
- Classifier: Topic :: Scientific/Engineering :: Mathematics
23
- Classifier: Topic :: Scientific/Engineering :: Physics
24
- Classifier: Topic :: Software Development
25
22
  Requires-Python: >=3.9
26
23
  Description-Content-Type: text/markdown
27
24
  License-File: LICENSE
28
- Requires-Dist: dspeed>=1.3.0a4
25
+ Requires-Dist: dspeed>=1.3
26
+ Requires-Dist: fcio>=0.7.8
29
27
  Requires-Dist: h5py>=3.2.0
30
28
  Requires-Dist: hdf5plugin
31
29
  Requires-Dist: legend-pydataobj>=1.6
32
30
  Requires-Dist: numpy>=1.21
33
- Requires-Dist: pyfcutils
34
31
  Requires-Dist: pyyaml
35
32
  Requires-Dist: tqdm>=4.27
36
33
  Requires-Dist: xmltodict
@@ -38,7 +35,9 @@ Provides-Extra: all
38
35
  Requires-Dist: legend-daq2lh5[docs,test]; extra == "all"
39
36
  Provides-Extra: docs
40
37
  Requires-Dist: furo; extra == "docs"
38
+ Requires-Dist: jupyter; extra == "docs"
41
39
  Requires-Dist: myst-parser; extra == "docs"
40
+ Requires-Dist: nbsphinx; extra == "docs"
42
41
  Requires-Dist: sphinx; extra == "docs"
43
42
  Requires-Dist: sphinx-copybutton; extra == "docs"
44
43
  Requires-Dist: sphinx-inline-tabs; extra == "docs"
@@ -0,0 +1,46 @@
1
+ daq2lh5/__init__.py,sha256=VPmwKuZSA0icpce05ojhnsKWhR4_QUgD0oVXUoN9wks,975
2
+ daq2lh5/_version.py,sha256=vFpyllSQPpQuwzP7Cf743S6HuWgZRMOD31pPfh-WoZM,511
3
+ daq2lh5/build_raw.py,sha256=wehR1jADL_ponguOMfAsMTxsebE-qdztFw4Txm76fpw,10716
4
+ daq2lh5/cli.py,sha256=7bPfH1XbyAS48wZn_0unj4Y5MD5kF7V34Q5srn4jKVM,2913
5
+ daq2lh5/data_decoder.py,sha256=45ckhpfqKh6_FfPUn_iETZLjRFd4VtvQhet4l2KvldA,10606
6
+ daq2lh5/data_streamer.py,sha256=-uns1Y9iReVSJTXGCXD05QQLfqjbQn-VodEmDj7uSJo,16016
7
+ daq2lh5/logging.py,sha256=rYNeToaZBTCaIiC42a4CUroAo1PCOreTXbpEZyMO8Fo,987
8
+ daq2lh5/raw_buffer.py,sha256=I4qt6UGOrlOAgtcM198w655TkouSRfLYMne00QeUJQA,17844
9
+ daq2lh5/utils.py,sha256=Pc8Oh0ZVBqwwVehyhSJttHnX5tWbOyEZPk-rVg8mb0c,839
10
+ daq2lh5/buffer_processor/__init__.py,sha256=7k6v_KPximtv7805QnX4-xp_S3vqvqwDfdV3q95oZJo,84
11
+ daq2lh5/buffer_processor/buffer_processor.py,sha256=mG4kJXt8V9Jji_UTBfllRffIVqLPf2BPKJQ1S2m9NWU,14668
12
+ daq2lh5/buffer_processor/lh5_buffer_processor.py,sha256=dKND-18TTPDZH8VxdEaQNZPK7w_G-dC4fsBns1NIjMY,8409
13
+ daq2lh5/compass/__init__.py,sha256=mOXHWp7kRDgNTPQty3E8k2KPSy_vAzjneKfAcCVaPyE,132
14
+ daq2lh5/compass/compass_config_parser.py,sha256=zeAsOo1dOJPGLL8-zkAcdYRkqt8BodtOPi96n7fWsl4,12300
15
+ daq2lh5/compass/compass_event_decoder.py,sha256=kiPOaEu8SgLD2wbSPbBahcbTBBRAIw35wtVLBcwPcXY,7386
16
+ daq2lh5/compass/compass_header_decoder.py,sha256=AA-Md2FIT3nD4mXX9CrWvbbfmKiA436-BTmzcU3_XOY,2823
17
+ daq2lh5/compass/compass_streamer.py,sha256=zSl7IqO0ID0wcixkLE9QVEG3bF9hfGVITVPomCeOFTM,8841
18
+ daq2lh5/fc/__init__.py,sha256=bB1j6r-bDmylNi0iutQeAJGjsDSjLSoXMqFfXWwfb8I,141
19
+ daq2lh5/fc/fc_config_decoder.py,sha256=Mlll1SI4HPmTo6EGubkyP-QcmEfmO-kWaiZCKDc4cxg,4448
20
+ daq2lh5/fc/fc_event_decoder.py,sha256=c2CQSiNxlOEGOZNSgqM3eM-26EUW6MIfK48Am9CHfro,7887
21
+ daq2lh5/fc/fc_eventheader_decoder.py,sha256=jAUxgWqgQmzNhAzMLubgFLMiGpxjqVIut6uhVS6JfyA,12313
22
+ daq2lh5/fc/fc_fsp_decoder.py,sha256=-qQjDkXF7xjF3lYIp2085TY2hRrLwxzyXwQYAn1OAJw,34972
23
+ daq2lh5/fc/fc_status_decoder.py,sha256=ChMxALx36caY7zfCOKozNgXYhLGX9HzBnkyOvQfiABk,8809
24
+ daq2lh5/fc/fc_streamer.py,sha256=U1EPKr-xSlxTCqcgQL6SFlO11WDFT9kcna7gocDKLXo,9162
25
+ daq2lh5/llama/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ daq2lh5/llama/llama_base.py,sha256=B-NCBjE_FQE1WxijWi4Z1XBy4rqLHm2XhkC40s7Sdms,290
27
+ daq2lh5/llama/llama_event_decoder.py,sha256=DVULTX7JzlRe23HZYXn79VkoU2_z03o7nxWc33bGK8U,14981
28
+ daq2lh5/llama/llama_header_decoder.py,sha256=cTsFsKmrm7tuWZjk3Vi22fUDywVRHSre_TnlBOwFtus,7716
29
+ daq2lh5/llama/llama_streamer.py,sha256=lrK73JIXjpogPrkP_tpFQQGSyWxFhivSpU1YEfRMHhQ,5329
30
+ daq2lh5/orca/__init__.py,sha256=Xf6uOIOzk_QkKH_7VizGlCo3iuiAgLtUE3A07x_HXC0,175
31
+ daq2lh5/orca/orca_base.py,sha256=-XIolXsHj-1EdewaGxyvJTZvRGZsDyZe-5PzVOd-LFY,1333
32
+ daq2lh5/orca/orca_digitizers.py,sha256=Vu05xQO3XYqybjLhzk-XJG41wyeVFSIoXOjvdltDoUw,20865
33
+ daq2lh5/orca/orca_fcio.py,sha256=v2kZWUmutd1HcWJW0h50zsVdAZorP8TG39PP9tf_GCg,15107
34
+ daq2lh5/orca/orca_flashcam.py,sha256=klGWxME2QS3eOBgb5mD3IrPHXXzb1Zz4B7YDvZvaGD8,33291
35
+ daq2lh5/orca/orca_header.py,sha256=2WlB8rFXwzD89lX51JXYiOlop0-C4pWEEsIWKq2ouDM,4403
36
+ daq2lh5/orca/orca_header_decoder.py,sha256=ORIIyfx22ybyKc-uyWy5ER49-dl3BGpHdfV8OCDmjIw,1632
37
+ daq2lh5/orca/orca_packet.py,sha256=LtKEAcH2VGzY8AQEqAokZTHonShACsKisGdQR0AMDAM,2835
38
+ daq2lh5/orca/orca_run_decoder.py,sha256=61gghgjqD1ovH3KoHFJuKJp0GLJn4X0MIuoYrsIzMfQ,2059
39
+ daq2lh5/orca/orca_streamer.py,sha256=sLM5PPLOxJ_aJckJOl9UCjyOaPmNxUKDnrLw22fSNbE,16622
40
+ daq2lh5/orca/skim_orca_file.py,sha256=ESWfbv9yDRGaPf3Ptlw6Dxnc4uwhJoagb_aYlWNyrq0,1954
41
+ legend_daq2lh5-1.6.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
42
+ legend_daq2lh5-1.6.1.dist-info/METADATA,sha256=UbfgLNJWCAl6CquW11JoohphH6-rre7kC4UjGcH-5Hs,4005
43
+ legend_daq2lh5-1.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
+ legend_daq2lh5-1.6.1.dist-info/entry_points.txt,sha256=RPm2GPw2YADil9tWgvZsIysmJz9KuktBWH_1P38PWoc,119
45
+ legend_daq2lh5-1.6.1.dist-info/top_level.txt,sha256=MJQVLyLqMgMKBdVfNXFaCKCjHKakAs19VLbC9ctXZ7A,8
46
+ legend_daq2lh5-1.6.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ legend-daq2lh5 = daq2lh5.cli:daq2lh5_cli
3
+ skim-orca-file = daq2lh5.orca.skim_orca_file:skim_orca_file
@@ -1,42 +0,0 @@
1
- daq2lh5/__init__.py,sha256=VPmwKuZSA0icpce05ojhnsKWhR4_QUgD0oVXUoN9wks,975
2
- daq2lh5/_version.py,sha256=qEW4HoWHYDkBguijNs9nZzHd38qlKSeRTDG2QQbYrGY,511
3
- daq2lh5/build_raw.py,sha256=SDpdOU8qpfzMtx8gtFu-RZYqxutQo1smJSkv-LrH9YE,10672
4
- daq2lh5/cli.py,sha256=7bPfH1XbyAS48wZn_0unj4Y5MD5kF7V34Q5srn4jKVM,2913
5
- daq2lh5/data_decoder.py,sha256=Cn40fodfKs7pKa2odzG1j806iw9IyQVfbbWObNGmof8,10677
6
- daq2lh5/data_streamer.py,sha256=WuyqneVg8Kf7V072aUWYT5q3vmPZoobjAZ7oSw0sC9k,14187
7
- daq2lh5/logging.py,sha256=rYNeToaZBTCaIiC42a4CUroAo1PCOreTXbpEZyMO8Fo,987
8
- daq2lh5/raw_buffer.py,sha256=LfkVAOZa4cWz227Ef22rKi57Shk7GbENoxUEkxC6IgU,17403
9
- daq2lh5/utils.py,sha256=Pc8Oh0ZVBqwwVehyhSJttHnX5tWbOyEZPk-rVg8mb0c,839
10
- daq2lh5/buffer_processor/__init__.py,sha256=7k6v_KPximtv7805QnX4-xp_S3vqvqwDfdV3q95oZJo,84
11
- daq2lh5/buffer_processor/buffer_processor.py,sha256=GUxpNDbqGLuUEZmXjeratipbzmki12RFNYZkxgMtesg,14483
12
- daq2lh5/buffer_processor/lh5_buffer_processor.py,sha256=BEWC0fFg7YU-COcp6Z0W51DLBq5NeGNwSI_97H4TrnQ,8310
13
- daq2lh5/compass/__init__.py,sha256=mOXHWp7kRDgNTPQty3E8k2KPSy_vAzjneKfAcCVaPyE,132
14
- daq2lh5/compass/compass_config_parser.py,sha256=zeAsOo1dOJPGLL8-zkAcdYRkqt8BodtOPi96n7fWsl4,12300
15
- daq2lh5/compass/compass_event_decoder.py,sha256=kiPOaEu8SgLD2wbSPbBahcbTBBRAIw35wtVLBcwPcXY,7386
16
- daq2lh5/compass/compass_header_decoder.py,sha256=AA-Md2FIT3nD4mXX9CrWvbbfmKiA436-BTmzcU3_XOY,2823
17
- daq2lh5/compass/compass_streamer.py,sha256=zSl7IqO0ID0wcixkLE9QVEG3bF9hfGVITVPomCeOFTM,8841
18
- daq2lh5/fc/__init__.py,sha256=bB1j6r-bDmylNi0iutQeAJGjsDSjLSoXMqFfXWwfb8I,141
19
- daq2lh5/fc/fc_config_decoder.py,sha256=RLRfUOZN0vYbAprqTymP7TGg641IiP9rgCGIOwWVKzU,1996
20
- daq2lh5/fc/fc_event_decoder.py,sha256=J1kKkd3Qz7SP3y0MGMxbsmWlL9SdVATdYX26bivS_Ho,8130
21
- daq2lh5/fc/fc_status_decoder.py,sha256=o_3vTAgYXelZxIsreCYioVYid2mY-wqloYKlxoCqX5Q,3390
22
- daq2lh5/fc/fc_streamer.py,sha256=S0imXdVsiyolPvxI1uiBngpC58DporSNZPqx1HeVi5o,5737
23
- daq2lh5/llama/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- daq2lh5/llama/llama_base.py,sha256=B-NCBjE_FQE1WxijWi4Z1XBy4rqLHm2XhkC40s7Sdms,290
25
- daq2lh5/llama/llama_event_decoder.py,sha256=DVULTX7JzlRe23HZYXn79VkoU2_z03o7nxWc33bGK8U,14981
26
- daq2lh5/llama/llama_header_decoder.py,sha256=r57sn_3eh21xpKfsAOPDmhPW4ULzt_0b7M8HZgmwU_4,7712
27
- daq2lh5/llama/llama_streamer.py,sha256=lrK73JIXjpogPrkP_tpFQQGSyWxFhivSpU1YEfRMHhQ,5329
28
- daq2lh5/orca/__init__.py,sha256=Xf6uOIOzk_QkKH_7VizGlCo3iuiAgLtUE3A07x_HXC0,175
29
- daq2lh5/orca/orca_base.py,sha256=-XIolXsHj-1EdewaGxyvJTZvRGZsDyZe-5PzVOd-LFY,1333
30
- daq2lh5/orca/orca_digitizers.py,sha256=BsAA3OgQ13YIirDM8pd_xDY3F5FqEY4YjSHviflmov8,20867
31
- daq2lh5/orca/orca_flashcam.py,sha256=IntAxrPZEL64LnulnoKkMO7URLOB78DpzjD1_u6PlaE,33096
32
- daq2lh5/orca/orca_header.py,sha256=1tDRG8l9Gqu4c0K4BjXBSC5eiLTzY_HaCsgNBiv5EgI,4283
33
- daq2lh5/orca/orca_header_decoder.py,sha256=ORIIyfx22ybyKc-uyWy5ER49-dl3BGpHdfV8OCDmjIw,1632
34
- daq2lh5/orca/orca_packet.py,sha256=nOHuBXsTI1SzTjHZtff0txSQYvkwo4XGx3fpk7XfYj8,2489
35
- daq2lh5/orca/orca_run_decoder.py,sha256=3atKXC6mDi8_PK6ICUBBJ-LyaTM8OU31kKWIpmttRr4,2065
36
- daq2lh5/orca/orca_streamer.py,sha256=-NxH0oR9ZSd9ljbR-z_GiPx0Bv7aiLdef6nX2vBYJ3k,15820
37
- legend_daq2lh5-1.5.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
38
- legend_daq2lh5-1.5.0.dist-info/METADATA,sha256=sf5hY5retNd3CuhkpUmMpxEo4OkOJ1XVDsCi-9qyRG4,3901
39
- legend_daq2lh5-1.5.0.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
40
- legend_daq2lh5-1.5.0.dist-info/entry_points.txt,sha256=R08R4NrHi0ab5MJN_qKqzePVzrLSsw5WpmbiwwduYjw,59
41
- legend_daq2lh5-1.5.0.dist-info/top_level.txt,sha256=MJQVLyLqMgMKBdVfNXFaCKCjHKakAs19VLbC9ctXZ7A,8
42
- legend_daq2lh5-1.5.0.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- legend-daq2lh5 = daq2lh5.cli:daq2lh5_cli