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

Support NXlog with "sublogs" such as connection_status and alarm #138

Merged
merged 6 commits into from
May 1, 2023

Conversation

SimonHeybrock
Copy link
Member

This is the way ESS tries to store additional values at distinct time-stamps. It is apparently being proposed for standardization in NeXus.

It is kind off a mess and not possible to handle nicely (see comments/docstrings), but apparently this cannot be changed, so we have to deal with it somehow.

time-indexing, since the time coord of each time-series is different. We can
support label-based indexing for this in the future. If additional time-series
are contained within the NXlog then loading will return a DataGroup of the
individual time-series (DataArrays).
Copy link
Member

Choose a reason for hiding this comment

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

If we had some form of flexible structured dtypes, could this data be merged into a single data array by binning? (e.g. with the main log's time coord)

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 don't think so. What do you have in mind?

Copy link
Member

Choose a reason for hiding this comment

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

da['time', i] contains the value of the main log in this bin as well as all values of sublogs that fall into this bin.

Copy link
Member Author

Choose a reason for hiding this comment

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

Typically the main log has many more values than the sublogs (often by orders of magnitude), so I don't see how that would be useful/feasible?

for name in self._sublogs:
for k in list(children):
if k.startswith(name):
field = children.pop(k)
Copy link
Member

Choose a reason for hiding this comment

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

This modifies the argument children. Please make a copy first.

for name in self._sublogs:
# Somewhat arbitrary definition of which fields is the "value"
value_name = 'severity' if name == 'alarm' else None
sublogs[name] = self._assemble_sublog(dg, name, value_name=value_name)
Copy link
Member

Choose a reason for hiding this comment

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

_assemble_sublog also modifies an argument (dg)

@SimonHeybrock SimonHeybrock merged commit 5c6b54f into main May 1, 2023
@SimonHeybrock SimonHeybrock deleted the nxmultilog branch May 1, 2023 13:49
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.

2 participants