Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Nov 12, 2025

Choppers in ECDC NeXus files store TDC as a normal NXlog with a "value".
Scippneutron had assumed that it would be a log without a value, just a "time" entry.

Screenshot_20251112_135305

We now deal with both cases, with and without value.

@nvaytet nvaytet requested a review from jl-wynen November 12, 2025 12:59
Comment on lines +45 to +52
if "value" in x:
# A NXlog
return x["value"].squeeze()
elif "time" in x:
# A NXlog without 'value' field
return x["time"].squeeze()
else:
return x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand, I thought ScippNexus gives use a DataArray or a Variable in the two respective cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried loading chopper data just with scippnexus and the groups with "value" are just loaded as a DataGroup.
Were you saying they should be loaded as a DataArray?

Note that the "value" entry in the data groups are DataArrays, but the diskchopper wants the value to be extracted out of the data group, into a flat structure.

Screenshot_20251113_105453

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that is because ECDC NeXus file contain THREE NXlog subentries (value, alarm, connection_status). But my question was about the nested value vs time - isn't time a sc.Variable? Is it ok to return that directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to return that directly?

I think so. We want a flat structure that contains Variables or DataArrays. Then, with the changes in https://github.com/scipp/scippneutron/pull/649/files#diff-74c09268bce58a60a5fdcc25750870436b6748f2a8922b25379117108454c7baR651 we can construct a chopper using from_nexus.

@nvaytet nvaytet merged commit 3c49525 into main Nov 13, 2025
5 checks passed
@nvaytet nvaytet deleted the chopper-tdc-parsing branch November 13, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants