Skip to content

[ESSDIFFRACTION] Add BeamlineParameters to BEER - #824

Merged
jokasimr merged 7 commits into
mainfrom
744
Oct 27, 2026
Merged

jokasimr merged 7 commits into
mainfrom
744

Conversation

@jokasimr

Copy link
Copy Markdown
Contributor

Fixes #744

@github-actions github-actions Bot added the essdiffraction Issues for essdiffraction. label Oct 23, 2026
@github-actions github-actions Bot changed the title Add BeamlineParameters to BEER [ESSDIFFRACTION] Add BeamlineParameters to BEER Oct 23, 2026
@jokasimr

Copy link
Copy Markdown
Contributor Author

The original issue asks for having the parameters on RawDetector etc, but I think adding them to every single result type seems complicated and messy, and it also prevents you from loading them separately from the events, which might be good if the event data is large.

So instead I added a separate domain type that lists the important beamline parameters.

@jokasimr
jokasimr requested review from jl-wynen and nvaytet and removed request for nvaytet October 23, 2026 12:15
Comment on lines +72 to +74
mean_L2=l2.nanmean(),
mean_Ltotal=ltotal.nanmean(),
mean_two_theta=two_theta.nanmean(),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do you need these here? You could compute these values when writing the file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Having the "typical" geometry values directly in the parameter is mainly for convenience.

effective_chopper_position(choppers), source_position
)
l2 = detector_ltotal - source_to_sample
ltotal = detector_ltotal - source_to_chopper

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remind me, don't you need these quantities for coordinate transforms? If so, you shouldn't compute them in two places.

[
chopper.axle_position
for name, chopper in choppers.items()
if not name.startswith('FC')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems more brittle than looking for specific names. If the names change in the file, you silently average the wrong positions with the current implementation. If you look for specific names to include (instead of exclude) the workflow will fail visibly when something gets renamed.

@jokasimr
jokasimr requested a review from jl-wynen October 27, 2026 10:17
@jokasimr
jokasimr added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 51fd08d Oct 27, 2026
6 checks passed
@jokasimr
jokasimr deleted the 744 branch October 27, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essdiffraction Issues for essdiffraction.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ESSDIFFRACTION, BEER] Add coordinates to dataarrays in Sciline pulse shaping workflow

2 participants