Skip to content

Fix geometry script to resolve depends_on chains through NXlog nodes#696

Draft
SimonHeybrock wants to merge 1 commit intomainfrom
fix-geometry-depends-on-chain
Draft

Fix geometry script to resolve depends_on chains through NXlog nodes#696
SimonHeybrock wants to merge 1 commit intomainfrom
fix-geometry-depends-on-chain

Conversation

@SimonHeybrock
Copy link
Member

Summary

  • Fix make_geometry_nexus to follow depends_on chains that pass through NXlog groups inside NXpositioner (streaming motor positions acting as transformation nodes)
  • NXlog transformation nodes are converted to static datasets using their average_value

Motivation

When generating a LOKI geometry file from a recent data file, loki_detector_0's depends_on chain passes through detector_carriage/value, an NXlog group with transformation_type=translation. The script stripped this streaming data, leaving a broken chain that caused scippnexus to raise a UserWarning when loading detector geometry.

Test plan

  • New unit tests covering basic geometry copy and NXlog chain resolution

🤖 Generated with Claude Code

The geometry stripping script copies depends_on datasets from detectors
and monitors but did not follow the full transformation chain. When a
depends_on target is an NXlog group inside an NXpositioner (a streaming
motor position that also acts as a transformation node), the script
stripped the NXlog data, breaking the chain.

This was discovered when generating a LOKI geometry file from a recent
data file where loki_detector_0's depends_on points to
detector_carriage/value (an NXlog with transformation_type=translation).

The fix adds a post-processing pass that follows all depends_on chains
in the output file and resolves missing nodes from the source. NXlog
transformation nodes are converted to static datasets using their
average_value.

Prompt: Can you fix the script so we can generate a correct file?

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant