Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove dummy row if present #95

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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