Ticket #8852 (assigned)
Signed Theta Test
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | major | Milestone: | Backlog |
Component: | Reflectometry | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
The following is a useful check that signed-theta values are being calculated correctly for the instrument, and should be converted into system or unit tests.
import os import math import numpy as np def echo_signed_theta(idf_name, detector_vertical_position, detector_name = 'point-detector'): idf_dir=config['instrumentDefinition.directory'] I=LoadEmptyInstrument(os.path.join(idf_dir, idf_name)) ref_frame = I.getInstrument().getReferenceFrame() print I.getInstrument().getStringParameter('show-signed-theta') movements = dict() movements[ref_frame.pointingUpAxis()] = detector_vertical_position movements[ref_frame.pointingAlongBeamAxis()] = 0 movements[ref_frame.pointingHorizontalAxis()] = 0 MoveInstrumentComponent(Workspace=I,ComponentName=detector_name,**movements) theta_spectrum_axis=ConvertSpectrumAxis(InputWorkspace=I,OutputWorkspace='SignedTheta_vs_Wavelength',Target='signed_theta') detector = theta_spectrum_axis.getInstrument().getComponentByName(detector_name) print theta_spectrum_axis.detectorTwoTheta(detector), theta_spectrum_axis.detectorSignedTwoTheta(detector) echo_signed_theta('INTER_Definition.xml', 1) echo_signed_theta('INTER_Definition.xml', -1) echo_signed_theta('CRISP_Definition.xml', 1) echo_signed_theta('CRISP_Definition.xml', -1) echo_signed_theta('POLREF_Definition.xml', 1) echo_signed_theta('POLREF_Definition.xml', -1) echo_signed_theta('SURF_Definition.xml', 1) echo_signed_theta('SURF_Definition.xml', -1)
Change History
Note: See
TracTickets for help on using
tickets.
bulk move to assigned at the into of the triage step