-
Notifications
You must be signed in to change notification settings - Fork 1
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
docs: add description of data reduction procedure #65
base: main
Are you sure you want to change the base?
Conversation
|
||
The purpose of this text is not to describe how the event coordinates $Q$ and $\theta$ are derived from the raw event data and the geometry information, so for now just take those relations for given. | ||
|
||
To avoid overcomplicating the description it is assumed that the sample- and reference measurements were made over the same length of time, and it is assumed the neutron intensity from the source did not vary between the two measurements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain that this only applies to the equations given here. The actual workflow has no such restriction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the actual workflow does currently have that restriction. Or am I mistaken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it does, then it needs to change! But I guess that relates to #78.
Shouldn't this be easy to include in the maths? Isn't it just an extra factor in the normalisation? Something like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it does, then it needs to change!
Sure, that's what the issue is for. I've put it in the selected column on the dev board now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be easy to include in the maths? Isn't it just an extra factor in the normalisation? Something like
Yeah probably, but I don't plan to include that in this PR. This is something we will have to iterate on as new features are added to the workflow.
docs/user-guide/data-reduction.md
Outdated
The sample reflectivity is related to the intensity of neutron counts in the detector by the model | ||
|
||
$$ | ||
I_{sam}(\lambda, j) = F(\theta(\lambda, j, \mu_{sam}), w_{sam}) \cdot R(Q(\lambda, \theta(\lambda, j, \mu_{sam}))) \cdot I_{ideal}(\lambda, j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I_{sam}(\lambda, j) = F(\theta(\lambda, j, \mu_{sam}), w_{sam}) \cdot R(Q(\lambda, \theta(\lambda, j, \mu_{sam}))) \cdot I_{ideal}(\lambda, j) | |
I_{\text{sam}}(\lambda, j) = F(\theta(\lambda, j, \mu_{\text{sam}}), w_{\text{sam}}) \cdot R(Q(\lambda, \theta(\lambda, j, \mu_{\text{sam}}))) \cdot I_{\text{ideal}}(\lambda, j) |
And everywhere else.
Or use \mathsf
instead of \text
if you prefer that.
docs/user-guide/data-reduction.md
Outdated
$$ | ||
I_{sam}(\lambda, j) = F(\theta(\lambda, j, \mu_{sam}), w_{sam}) \cdot R(Q(\lambda, \theta(\lambda, j, \mu_{sam}))) \cdot I_{ideal}(\lambda, j) | ||
$$ (model) | ||
where $I_{sam}(\lambda, j)$ represents the number of neutrons detected in the $j$ pixel of the detector having a wavelength in the interval $[\lambda, \lambda + d\lambda]$. $I_{ideal}$ represents the number of neutrons that would have been detected if the sample was a perfect reflector and large enough so that the footprint of the focused beam on the sample was small compared to the sample. $F(\theta, w)$ is the fraction of the focused beam that hits the sample. It depends on the incidence angle $\theta$ and on the size of the sample represented by $w$. $\mu_{sam}$ is the sample rotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
docs/user-guide/data-reduction.md
Outdated
$$ | ||
I_{sam}(\lambda, j) = F(\theta(\lambda, j, \mu_{sam}), w_{sam}) \cdot R(Q(\lambda, \theta(\lambda, j, \mu_{sam}))) \cdot I_{ideal}(\lambda, j) | ||
$$ (model) | ||
where $I_{sam}(\lambda, j)$ represents the number of neutrons detected in the $j$ pixel of the detector having a wavelength in the interval $[\lambda, \lambda + d\lambda]$. $I_{ideal}$ represents the number of neutrons that would have been detected if the sample was a perfect reflector and large enough so that the footprint of the focused beam on the sample was small compared to the sample. $F(\theta, w)$ is the fraction of the focused beam that hits the sample. It depends on the incidence angle $\theta$ and on the size of the sample represented by $w$. $\mu_{sam}$ is the sample rotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Missing definition of
$R$ - Missing definition of
$Q$ - Is
$\mu_\text{sam}$ really the sample rotation? What about$\omega$ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you ask about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The definition for R, and Q are in the first paragraph of the page.
docs/user-guide/data-reduction.md
Outdated
$$ | ||
I_{sam}(\lambda, j) = F(\theta(\lambda, j, \mu_{sam}), w_{sam}) \cdot R(Q(\lambda, \theta(\lambda, j, \mu_{sam}))) \cdot I_{ideal}(\lambda, j) | ||
$$ (model) | ||
where $I_{sam}(\lambda, j)$ represents the number of neutrons detected in the $j$ pixel of the detector having a wavelength in the interval $[\lambda, \lambda + d\lambda]$. $I_{ideal}$ represents the number of neutrons that would have been detected if the sample was a perfect reflector and large enough so that the footprint of the focused beam on the sample was small compared to the sample. $F(\theta, w)$ is the fraction of the focused beam that hits the sample. It depends on the incidence angle $\theta$ and on the size of the sample represented by $w$. $\mu_{sam}$ is the sample rotation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A drawing of the sample with all angles would help a lot. Older versions of the docs used figure 5 of https://doi.org/10.1016/j.nima.2016.03.007
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll save this for the PR with documentation about the coordinate transformations.
$$ | ||
|
||
## Estimating intensities from detector counts | ||
The neutron counts are Poisson distributed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true for counts in a 'spatial' binning. E.g., in pixel-tof-space. But is this also true after transforming to Q? It seems odd to me that we would get a Poisson distribution in Q bins. If this was true, we would not need to do any error propagation at all before we compute a Q histogram.
The reason is that binning in Q combines events from multiple pixel-tof bins in a non-trivial way.
Concerning your equations,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems odd to me that we would get a Poisson distribution in Q bins. If this was true, we would not need to do any error propagation at all before we compute a Q histogram.
Yes my understanding is that the event count is Poisson distributed also in Q bins. The only assumptions that makes the count Poisson distributed are:
- Constant (in time) expected event rate.
- Events arrive independently from each other.
Those assumptions are independent of if we bin in a spatial binning or wavelength or
If this was true, we would not need to do any error propagation at all before we compute a Q histogram.
Yes and we typically don't right?
But I see what you mean. There's something a bit wrong here. The events are weighted. So one event is actually not a single events, but a "package" of events. Individual packages of events arrive independently, but inside a package the events don't arrive independently.
I think we should talk about this in person to get the formulation right here. 👍
Concerning your equations, is the expectation value. So you don't need an extra . Unless I misunderstand something?
The event count (the sum) is a random variable. We are interested in the expected value of that random variable because that's what's associated with the properties of the sample.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event count (the sum) is a random variable. We are interested in the expected value of that random variable because that's what's associated with the properties of the sample.
Yes, the count is the random variable. And the events are samples. So the sum is the sample mean, up to a normalisation factor. And thus, it is an estimator of the expectation value of the count. Basically,
where
|
||
Therefore there's one more approximation that is used to further reduce the cost of computing the reference intensity. | ||
|
||
The Amor detector has three logical dimensions, `blade`, `wire` and `stripe`. It happens to be the case that $\theta(\lambda, j)$ is almost the same for all $j$ belonging to the same `stripe` of the detector. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything has been generic up to here. Please clearly delineate generic reflectometry and instrument-specific explanations.
The detector pixel positions are known and so is the position of the sample and the orientation of the sample. | ||
From that information we can compute the reflection angle (assumed equal to the incidence angle) $\theta$, and the momentum transfer $Q$ caused by the interaction with the sample. | ||
|
||
The purpose of this text is not to describe how the event coordinates $Q$ and $\theta$ are derived from the raw event data and the geometry information, so for now just take those relations for given. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you say 'for now', I would expect a follow up that explains
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was planning to add that in a separate PR, together with the other coordinate transformations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document only describes the basic procedure. It does not take instrument / facility specific details into account. (E.g., choppers or monitors) Please make it clear that the procedure outline here is not a complete reduction workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choppers and monitors are only relevant to compute
To avoid making this PR too large. I'll add separate issues for documenting:
|
In general, splitting PRs into small units is good. But that only works when those units are self-contained. Here, I cannot judge whether the documentation is good without seeing all of it. In the last PR of this series, I would have to read everything again anyway. So can you please combine them into one PR? |
The risk I see not splitting this effort into manageable pieces is that
I don't agree that the pieces are not self contained. The same goes for the parts about footprint correction and the resolution function. |
7ded7c9
to
c2cfd2b
Compare
We should |
Fixes #7
This is still a bit coarse, but I think it contains the important bits.
I'm marking this as a draft for now