scipp / scipp/ess

Apply Lorentz correction after binning into `(d, theta)`?

Open
#526 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

essdiffraction
Dominant language
Python
Stars
1
Forks
3
Avg merge
2d 11h
Merged PRs (30d)
17

Description

In scipp/essdiffraction#29 the Lorentz correction is computed in event mode and applied to the data. I think a cheaper approach would be something like:

data = data.bin(dspacing, theta)  # no more pixels, or data.groupby(theta).bins.concat('pixel')
lorentz_factor = sc.midpoints(dspacing)**4 * sc.sin(sc.midpoints(theta))
scale = lorentz_factor / vanadium  # vandium depends only on dspacing
data *= scale

This would result only in a single event-data op (which we would have to do anyway for the vanadium normalization). Binning in theta would have some extra cost, but we may need it anyway for other purposes. Computation of the Lorentz correction itself would essentially be free, and independent of the event count.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with scipp/essdiffraction#29 and compare its event-mode Lorentz correction with the proposed binning into dspacing and theta. Investigate whether the binned approach remains valid alongside vanadium normalization and measure its cost. Done means the project has a decided approach and an implementation or documented rejection backed by relevant comparisons.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.