How to handle offset and temperature
#8
henrikjacobsenfys
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to figure out how to handle
offsetandtemperature.offsetis aParameterthat will be fitted in every single fit. It's because of slight unavoidable inaccuracies with instrument and sample alignment, which means the peaks are never centered exactly at 0 energy transfer.temperatureis usually fixed, but I've had to fit it a couple of times, and I can't be the only one.A
SampleModelis used to describe both the resolution function and the scattering from the sample. Since temperature is meaningless for the resolution, I don't want it to live there. I also don't think I want to have separate classes forSampleModelandResolutionModelsince they're essentially the same. Although writing it out now, this may be a potential solution to part of the problem - thoughts are welcome!Writing this, I realise that I need to rewrite the convolutions a bit regardless of what we figure out, but here's what I have envisioned from the Analysis class writen in semi-pseudocode.
If I remove offset from convolution (which I have just done, but I'm no longer sure I like), it will be called like this instead:
The issue with this is: For numerical convolution I will need to create a dense and up-sampled grid of energy values to improve accuracy. I don't think this is super time consuming, but it still seems wasteful to recreate this grid for every call to calculate_theory.
Looking at this again, it seems I can get quite far by simply passing
self.offset.valueandself.temperature.value, andself.temperature.unit(with appropriate behaviour of self.temperature is None:It may also make sense to rename
offsettoenergy_offsetto make it more clear what it is.So I've solved most of the difficulties by writing this down, so I guess I'm now just asking for a sanity check: is the solution I reached the most reasonable way to work with this? Offset and Temperature will then live in Analysis (or perhaps elsewhere, but not in SampleModel or Convolution), and only their values (and perhaps units...?) will be passed to Convolution for calculations.
Beta Was this translation helpful? Give feedback.
All reactions