Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Filename | Input | string | Mandatory | Name of DNS experimental data file. Allowed extensions: [‘.d_dat’] |
CoilCurrentsTable | Input | string | Name of file containing table of coil currents and polarisations. Allowed extensions: [‘.txt’] | |
OutputWorkspace | Output | Workspace | Mandatory | Name of the workspace to store the experimental data. |
Normalization | Input | string | duration | Kind of data normalization. Allowed values: [‘duration’, ‘monitor’, ‘no’] |
Warning
This algorithm is being developed for a specific instrument. It might get changed or even removed without a notification, should instrument scientists decide to do so.
This algorithm loads a DNS legacy data file into a Workspace2D. The loader rotates the detector bank in the position given in the data file.
Output
Normalization
The Normalization option offers the following choices:
Polarisation
Since polarisation is not specified in the DNS legacy files, coil currents table is required to lookup for the polarisation and set the polarisation sample log. The default coil currents are given as x_currents, y_currents and z_currents parameters in the parameter file for x, y, and z polarisations, respectively.
Alternatively, the text file with the coil currents table may be provided (optionally). The coil currents table is a text file containing the following table.
polarisation | comment | C_a | C_b | C_c | C_z |
---|---|---|---|---|---|
x | 7 | 0 | -2 | -0.77 | 2.21 |
y | 7 | 0 | 1.6 | -2.77 | 2.21 |
z | 7 | 0 | 0.11 | -0.50 | 0 |
x | 7 | 0 | -2.1 | -0.97 | 2.21 |
First row must contain the listed column headers, other rows contain coil currents for each polarisation. Rows with different currents for one polarisation are alowed. Columns are separated by tab symbols.
This algorithm only supports DNS instrument in its configuration with one detector bank (polarisation analysis).
Example - Load a DNS legacy .d_dat file:
# data file.
datafile = 'dn134011vana.d_dat'
# Load dataset
ws = LoadDNSLegacy(datafile, Normalization='monitor')
print("This workspace has {} dimensions and has {} histograms.".format(ws.getNumDims(), ws.getNumberHistograms()))
Output:
This workspace has 2 dimensions and has 24 histograms.
Categories: Algorithms | Workflow\MLZ\DNS | DataHandling\Text
Python: LoadDNSLegacy.py (last modified: 2017-11-16)