Ticket #4969 (closed: fixed)
ConvertUnits using SignedTwoTheta
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | critical | Milestone: | Release 2.1 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Peter Peterson |
Description
ConvertUnits will extract an unsigned twotheta value from the input workspace, but there is no way to specify that a signed two theta value should be used instead.
We should rely on the instrument parameters to decide which type of signed theta value to apply.
Cannot do the unit conversion properly without this feature.
Attachments
Change History
comment:3 Changed 9 years ago by Owen Arnold
refs #4969. ConvertUnits enhancement
Changeset: 884e1b35849c6f57c3a08acdb4931184c4fc1888
comment:4 Changed 9 years ago by Owen Arnold
- Status changed from accepted to verify
- Resolution set to fixed
Tester: Using the attached python script as an example, you should see that both the theta and q axis go into the negative range. Contact me if datafile is required.
Delete/move out the instrument parameter file for POLREF and restart mantid. Rerun the script. This would then revert to the incorrect older behaviour.
comment:5 Changed 8 years ago by Peter Peterson
- Status changed from verify to verifying
- Tester set to Peter Peterson
I was initially going to hide away some of the details so that calling detectorSignedTwoTheta on a MatrixWorkspace would delegate to detectorTwoTheta according to the instrument parameters. However I didn't do this for performance reasons because it would involve every call to the method to look through the instrument parameter tree looking to look for the property.
I also considered caching the result, so that the check would be performed in a lazy fashion on the first detector and then for subsequent detectors the parameter check would no longer be needed. However, this doesn't seem quite right and it introduces a maintenance overhead in terms of a cached/temporary field that must have single threaded access, and must be properly maintained.
Instead I assume that if you call either detectorTwoTheta or detectorSignedTwoTheta, you know what you are doing. It's therefore the responsibility of the client to pick the right one for a given scenario.