Skip to content

Commit 74afb55

Browse files
daniloefltakluyver
andauthored
Use split_by_steps to group data by trainIds.
Co-authored-by: Thomas Kluyver <thomas.kluyver@xfel.eu>
1 parent bc46d4f commit 74afb55

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/extra/applications/cookiebox_deconvolve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,9 @@ def setup(self,
469469
data += [this_tof_data.sel(trainId=scan.positions_train_ids[k]).mean("trainId").mean("pulseIndex").to_numpy()]
470470
else:
471471
# count photo-electrons by histogramming peak positions
472-
for k, e in enumerate(scan.positions):
472+
for tof_part in scan.split_by_steps(tof):
473473
logging.info("Calling pulse_edges for selected trains ...")
474-
tof_data = tof.select_trains(by_id[scan.positions_train_ids[k]]).pulse_edges(pulse_dim='pulseIndex', threshold=self.count_threshold, parallel=parallel).reset_index()
474+
tof_data = tof_part.pulse_edges(pulse_dim='pulseIndex', threshold=self.count_threshold, parallel=parallel).reset_index()
475475
good_trains = np.unique(tof_data.loc[:,'trainId'].to_numpy())
476476
idx = tof_data.loc[:, ['trainId', 'pulseIndex']].set_index(['trainId', 'pulseIndex']).index
477477
logging.info("Summing good trains ...")

0 commit comments

Comments
 (0)