ISISNeutronMuon / ISISNeutronMuon/MDMC
Have control refinement only apply resolution once
- Dominant language
- Python
- Stars
- 4
- Forks
- 0
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 5
Description
Currently, after a Resolution is defined, the `_calculate_observables()` part of the `Control.refine()` method is built such that _every single refinement step_, the resolution and ideal SQw are passed to the SQw object and resolution is applied. The ideal SQw and resolution is not changing (as it is from fixed data), so this wastes a lot of time doing a Fourier transform for every single refinement step when in reality it only needs to do the transform once at the start. It also means that it's almost impossible to access SQw after resolution has been applied, since it is not saved as an object in the way the original SQw is.
We should refactor the refinement process so that resolution is applied once, and then MD done on the measured SQw, rather than reapplying it every refinement step.
**Implementation ideas:**
- Simply cache SQw after resolution is applied; have the refinement check if there is already an SQw in the cache and if so, use that instead of re-applying resolution. This is probably the quickest method but is a little bit of a bodge solution.
- Restructure `control.py` and `sqw.py` so that resolution is applied in `control.py` when the Control object is created. This takes more work, but will make the code a lot cleaner and more readable afterwards, as well as giving users greater access to SQw with resolution applied to it.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.