\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Workspace | InOut | MatrixWorkspace | Mandatory | Workspace to edit the detector information |
PrimaryFlightPath | Input | number | Optional | Primary flight path L1 of the powder diffractometer. |
SpectrumIDs | Input | int list | Spectrum Numbers (note that it is not detector ID or workspace indices). The list must be either empty or have a size equal to input workspace’s histogram number. | |
L2 | Input | dbl list | Mandatory | Secondary flight (L2) paths for each detector. Number of L2 given must be same as number of histogram. |
Polar | Input | dbl list | Mandatory | Polar angles (two thetas) for detectors. Number of 2theta given must be same as number of histogram. |
Azimuthal | Input | dbl list | Azimuthal angles (out-of-plane) for detectors. Number of azimuthal angles given must be same as number of histogram. | |
DetectorIDs | Input | int list | User specified detector IDs of the spectra. Number of specified detector IDs must be either zero or number of histogram | |
InstrumentName | Input | string | Name of the newly built instrument. If left empty, the original instrument will be used. |
This algorithm can:
#. Add an Instrument to a Workspace without any real instrument associated with, or #. Replace a Workspace’s Instrument with a new Instrument, or #. Edit all detectors’ parameters of the instrument associated with a Workspace (partial instrument editing is not supported).
There are some limitations of this algorithm.
Example - Adding a new instrument to a workspace
import numpy
ws = CreateWorkspace(
DataX=[0., 1.],
DataY=[1., 2., 3.],
NSpec=3)
EditInstrumentGeometry(
ws,
PrimaryFlightPath=5.,
SpectrumIDs=[1, 2, 3],
L2=[2.0, 2.3, 2.6],
Polar=[10.0, 15.0, 23.0],
Azimuthal=[0.0, 0.0, 0.0],
DetectorIDs=[100, 101, 102],
InstrumentName='Bizarrio')
spectrumInfo = ws.spectrumInfo()
for i in range(ws.getNumberHistograms()):
print('Histogram {} scattering angle: {:.3} degrees'.format(i + 1, numpy.rad2deg(spectrumInfo.twoTheta(i))))
Output:
Histogram 1 scattering angle: 10.0 degrees
Histogram 2 scattering angle: 15.0 degrees
Histogram 3 scattering angle: 23.0 degrees
Categories: AlgorithmIndex | Diffraction\DataHandling | DataHandling\Instrument
C++ header: EditInstrumentGeometry.h (last modified: 2020-03-20)
C++ source: EditInstrumentGeometry.cpp (last modified: 2021-03-31)