1
1
import argparse
2
- from copy import deepcopy
3
2
from pathlib import Path
4
3
5
- import numpy as np
6
4
from daq2lh5 import build_raw
7
5
from dbetto import TextDB
8
6
from dbetto .catalog import Props
@@ -36,24 +34,11 @@ def build_tier_raw_fcio() -> None:
36
34
channel_dict = channel_dict .out_spec
37
35
all_config = Props .read_from (channel_dict .gen_config )
38
36
39
- chmap = (
40
- TextDB (args .chan_maps , lazy = True ).channelmaps .on (args .timestamp ).group ("system" )
41
- )
42
-
43
37
if "geds_config" in channel_dict :
44
38
raise NotImplementedError ()
45
39
46
40
if "spms_config" in channel_dict :
47
41
spm_config = Props .read_from (channel_dict .spms_config )
48
- spm_channels = chmap .spms .map ("daq.rawid" )
49
-
50
- for rawid , chinfo in spm_channels .items ():
51
- cfg_block = deepcopy (spm_config ["FCEventDecoder" ]["__output_table_name__" ])
52
- cfg_block ["key_list" ] = [chinfo .daq .fc_channel ]
53
- spm_config ["FCEventDecoder" ][f"ch{ rawid :07d} /raw" ] = cfg_block
54
-
55
- spm_config ["FCEventDecoder" ].pop ("__output_table_name__" )
56
-
57
42
Props .add_to (all_config , spm_config )
58
43
59
44
if "auxs_config" in channel_dict :
@@ -62,17 +47,10 @@ def build_tier_raw_fcio() -> None:
62
47
if "muon_config" in channel_dict :
63
48
raise NotImplementedError ()
64
49
65
- rng = np .random .default_rng ()
66
- rand_num = f"{ rng .integers (0 ,99999 ):05d} "
67
- temp_output = f"{ args .output } .{ rand_num } "
68
-
69
50
build_raw (
70
51
args .input ,
71
- instream_type = "FlashCam" ,
72
52
out_spec = all_config ,
73
- filekey = temp_output ,
53
+ instream_type = "FlashCam" ,
54
+ filekey = args .output ,
74
55
** settings ,
75
56
)
76
-
77
- # rename the temp file
78
- Path (temp_output ).rename (args .output )
0 commit comments