Skip to content

Commit

Permalink
Use correct shapes in accumulators and writers
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaponte committed Feb 10, 2025
1 parent e399b5d commit 49e5d79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions invisible_cities/cities/phyllis.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from .. core .configure import OneOrManyFiles
from .. types.symbols import WfType
from .. types.symbols import PMTCalibMode
from .. database.load_db import DataPMT

from .. dataflow import dataflow as fl

Expand Down Expand Up @@ -93,9 +94,9 @@ def phyllis( files_in : OneOrManyFiles
bin_edges = np.arange(min_bin, max_bin, bin_width)
bin_centres = shift_to_bin_centers(bin_edges)
sd = sensor_data(files_in[0], WfType.rwf)
npmt = np.count_nonzero(load_db.DataPMT(detector_db, run_number).Active.values)
wf_length = sd.PMTWL
shape = npmt, len(bin_centres)
nactive = DataPMT(detector_db, run_number).Active.sum()
shape = nactive, len(bin_centres)
sampling = fee.t_sample

(light_limits,
Expand Down Expand Up @@ -125,7 +126,7 @@ def phyllis( files_in : OneOrManyFiles
write_hist = partial(hist_writer,
h5out,
group_name = 'HIST',
n_sensors = npmt,
n_sensors = nactive,
bin_centres = bin_centres)

out = fl.push(
Expand Down
7 changes: 4 additions & 3 deletions invisible_cities/cities/trude.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from .. reco import calib_sensors_functions as csf
from .. types.symbols import WfType
from .. types.symbols import SiPMCalibMode
from .. database.load_db import DataSiPM

from .. dataflow import dataflow as fl

Expand Down Expand Up @@ -80,9 +81,9 @@ def trude( files_in : OneOrManyFiles
bin_edges = np.arange(min_bin, max_bin, bin_width)
bin_centres = shift_to_bin_centers(bin_edges)
sd = sensor_data(files_in[0], WfType.rwf)
nsipm = sd.NSIPM
wf_length = sd.SIPMWL
shape = nsipm, len(bin_centres)
nactive = DataSiPM(detector_db, run_number).Active.sum()
shape = nactive, len(bin_centres)
sampling = 1 * units.mus

(light_limits,
Expand Down Expand Up @@ -112,7 +113,7 @@ def trude( files_in : OneOrManyFiles
write_hist = partial(hist_writer,
h5out,
group_name = "HIST",
n_sensors = nsipm,
n_sensors = nactive,
bin_centres = bin_centres)

out = fl.push(
Expand Down

0 comments on commit 49e5d79

Please sign in to comment.