Skip to content

Commit 4ff70f4

Browse files
daniloeflDanilo Ferreira de Lima
andauthored
Bug fix: number of photo-electron counts. (#498)
* Fixed bug in Cookiebox created by variable renaming in last PR. * Updated the changelog. --------- Co-authored-by: Danilo Ferreira de Lima <danilo.enoque.ferreira.de.lima@xfel.de>
1 parent 399b2c0 commit 4ff70f4

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Fixed:
7474
`uncertainty_method` parameter.
7575
- Fixed support for plotting images with zeros/negative numbers with
7676
[imshow2()][extra.utils.imshow2] and `lognorm=True` (!491).
77+
- Fixed counting threshold for `CookieboxCalibration` (!498).
7778

7879
Changed:
7980

src/extra/applications/cookiebox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def calc_mean(itr: Tuple[int, int], scan: Scan, xgm_data: xr.DataArray, tof: Dic
187187
tof_data = tof[tof_id].select_trains(by_id[train_ids])
188188
tof_data = tof_data.pulse_edges(pulse_dim='pulseIndex', threshold=count_threshold).reset_index()
189189

190-
bins = np.arange(0, n_samples+1)
190+
bins = np.arange(0, count_samples+1)
191191
out_data, _ = np.histogram(tof_data.edge, bins=bins, weights=-tof_data.amplitude)
192192

193193
out_data = xr.DataArray(out_data, dims=('sample'), coords={'sample': bins[:-1]})

0 commit comments

Comments
 (0)