Skip to content

Commit

Permalink
Merge pull request #181 from scipp/no-overwrite-tof
Browse files Browse the repository at this point in the history
fix: don't overwrite input
  • Loading branch information
jokasimr authored Oct 31, 2024
2 parents a0fcb33 + fe8a9a4 commit 943bcd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ess/loki/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def default_parameters() -> dict:


def _convert_to_tof(da: sc.DataArray) -> sc.DataArray:
da.bins.coords['tof'] = da.bins.coords.pop('event_time_offset')
event_time_offset = da.bins.coords['event_time_offset']
da = da.bins.drop_coords('event_time_offset')
da.bins.coords['tof'] = event_time_offset
if 'event_time_zero' in da.dims:
da = da.bins.concat('event_time_zero')
return da
Expand Down

0 comments on commit 943bcd4

Please sign in to comment.