Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Filename | Input | string | Mandatory | XML file name for one scan including 2D detectors counts from SPICE. Allowed extensions: [‘.xml’] |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | Name of output matrix workspace. Output workspace will be an X by Y Workspace2D if instrument is not loaded. |
DetectorLogName | Input | string | Detector | Log name (i.e., XML node name) for detector counts in XML file.By default, the name is ‘Detector’ |
DetectorGeometry | Input | unsigned int list | A size-2 unsigned integer array [X, Y] for detector geometry. Such that the detector contains X x Y pixels. | |
LoadInstrument | Input | boolean | True | Flag to load instrument to output workspace. HFIR’s HB3A will be loaded if InstrumentFileName is not specified. |
InstrumentFilename | Input | string | The filename (including its full or relative path) of an instrument definition file. The file extension must either be .xml or .XML when specifying an instrument definition file. Note Filename or InstrumentName must be specified but not both. Allowed extensions: [‘.xml’] | |
SpiceTableWorkspace | Input | TableWorkspace | Name of TableWorkspace loaded from SPICE scan file by LoadSpiceAscii. | |
PtNumber | Input | number | 0 | Pt. value for the row to get sample log from. |
UserSpecifiedWaveLength | Input | number | Optional | User can specify the wave length of the instrument if it is drifted from the designed value.It happens often. |
ShiftedDetectorDistance | Input | number | 0 | Amount of shift of the distance between source and detector centre.It is used to apply instrument calibration. |
DetectorCenterXShift | Input | number | 0 | The amount of shift of detector center along X direction in the unit meter. |
DetectorCenterYShift | Input | number | 0 | The amount of shift of detector center along Y direction in the unit meter. |
This algorithm is to import SPICE-generated XML file that records data of one measurement by a (two-dimensional) Anger camera and create a MatrixWorkspace to contain the detectors’ counts, monitor counts and other sample log data.
The SPICE XML data file contains four sections under parent node SPICErack. Each section contains child nodes for detailed information.
- Header: instrument name, reactor power, experiment title and number, scan number and etc.
- Motor_Position: positions of motor m1, marc, 2theta, chi, phi, omega and etc.
- Parameter_Positions: reading of sample environment devices, such as temperature at sample.
- Counters: counting time, monitor counts, and N x N detectors’ counts,
Counts of an 2D detectors are recorded in XML file as below:
X(1,1) X(1,2) X(1,3) ... X(1,m)
.
.
.
X(n,1) X(n,2) X(n,3) ... X(n,m)
And the (1,1) position is the bottom left corner of the Anger camera as seen from the sample position.
HB3A has 1 detector with pixels.
- Pixel: width = m, height = m, depth = 0.0001 m.
- Detector:
The output from this algorithm is a MatrixWorskpaces.
For a 2D detector with pixels, the output MatrixWorkspace will have spectrum. Each spectrum has 1 data point corresponding to 1 detector’s count.
All experiment information, sample environment devices’ readings and monitor counts, which are recorded in XML files, are converted to the properties in output MatrixWorkspace’s sample log.
For a 2D detector with pixels, the output MatrixWorkspace will have spectrum, each of which has a vector of length equal to . It can be mapped to the raw data as .
All experiment information, sample environment devices’ readings and monitor counts, which are recorded in XML files, are converted to the properties in output MatrixWorkspace’s sample log.
Example - load a HB3A SPICE .xml file without loading instrument:
# Load data by LoadSpiceXML2DDet()
LoadSpiceXML2DDet(Filename='HB3A_exp355_scan0001_0522.xml',
OutputWorkspace='s0001_0522', DetectorGeometry='256,256',
LoadInstrument=False)
# Access output workspace and print out some result
ws = mtd["s0001_0522"]
print "Number of spectrum = %d." % (ws.getNumberHistograms())
for i, j in [(0, 0), (255, 255), (136, 140), (143, 140)]:
print "Y[%-3d, %-3d] = %.5f" % (i, j, ws.readY(i)[j])
Output:
Number of spectrum = 256.
Y[0 , 0 ] = 0.00000
Y[255, 255] = 0.00000
Y[136, 140] = 0.00000
Y[143, 140] = 1.00000
Categories: Algorithms | DataHandling\XML