Skip to content

[essimaging] Orca normalization by proton charge per frame#663

Open
nvaytet wants to merge 5 commits into
mainfrom
orca-normalization-fix
Open

[essimaging] Orca normalization by proton charge per frame#663
nvaytet wants to merge 5 commits into
mainfrom
orca-normalization-fix

Conversation

@nvaytet

@nvaytet nvaytet commented Jul 1, 2026

Copy link
Copy Markdown
Member

We change the way we use the proton charge to normalize the Orca data.

  • We normalize each frame in the Dark, OpenBeam, and Sample runs by the corresponding proton charge.
  • After that we take the mean of the Dark along the time dimension.
  • We then remove the MeanDark from the OpenBeam and Sample data.
  • Finally, we divide the (Sample - MeanDark) / (OpenBeam - MeanDark).mean('time')

Fixes #636

@github-actions github-actions Bot added the essimaging Issues for essimaging. label Jul 1, 2026
"ymir_lego_dark_run.hdf": "md5:c0ed089dd7663986042e29fb47514130",
"ymir_lego_openbeam_run.hdf": "md5:00375becd54d2ed3be096413dc30883c",
"ymir_lego_sample_run.hdf": "md5:ae56a335cf3d4e87ef090ec4e51da69c",
"ymir_lego_dark_run.hdf": "md5:2d9ae7d6f1d0502c17b0030bcb3dad1d",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I had to update the data because the proton charge in the old files started exactly at the start of the time axis for the camera data. However, when doing sc.lookup in 'previous' mode, the first data point was not found (probably because of numerical precision errors) and a NaN was returned.

So the first data slice in the dark lookup was NaN. We then took the mean which gave NaN, and then all data was NaN.
I now updated the proton charge logs to start a bit before the data starts.

@nvaytet nvaytet requested a review from YooSunYoung July 1, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

essimaging Issues for essimaging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[essimaging] Orca image normalization was minsunderstood

1 participant