Skip to content

Commit

Permalink
Merge pull request #95 from scipp/fix-dummy-row
Browse files Browse the repository at this point in the history
fix: remove dummy row if present
  • Loading branch information
jokasimr authored Jan 14, 2025
2 parents 878e380 + 7e3b5b3 commit 7b427ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ess/nmx/mcstas/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def load_raw_event_data(
root = f["entry1/data"]
(bank_name,) = (name for name in root.keys() if bank_name in name)
data = root[bank_name]["events"][()].rename_dims({'dim_0': 'event'})
if (data.values[0] == 0).all():
# McStas can add an extra event line containing 0,0,0,0,0,0
# This line should not be included so we skip it.
data = data["event", 1:]
return sc.DataArray(
coords={
'id': sc.array(
Expand Down

0 comments on commit 7b427ec

Please sign in to comment.