diff --git a/Framework/MDAlgorithms/src/LoadDNSSCD.cpp b/Framework/MDAlgorithms/src/LoadDNSSCD.cpp index 9065ec8b9dc8b3e675ff463f1efed40f42ef7e70..f872d42be75bbb11828fa12b1bb323fd0ae1b43a 100644 --- a/Framework/MDAlgorithms/src/LoadDNSSCD.cpp +++ b/Framework/MDAlgorithms/src/LoadDNSSCD.cpp @@ -553,7 +553,6 @@ void LoadDNSSCD::fillOutputWorkspace(double wavelength) { double signal = ds.signal[i][channel]; signal_t error = std::sqrt(signal); double tof2 = static_cast<double>(channel)*ds.chwidth + 0.5*ds.chwidth; // bin centers - g_log.debug() << "TOF2 = " << tof2 << std::endl; double dE = 0.0; if (nchannels > 1) { double v2 = 1e+06*l2/tof2; @@ -561,7 +560,6 @@ void LoadDNSSCD::fillOutputWorkspace(double wavelength) { } if (dE > dEmin) { double kf = std::sqrt(ki*ki - 2.0e-20*PhysicalConstants::NeutronMass*dE*PhysicalConstants::meV/(PhysicalConstants::h_bar*PhysicalConstants::h_bar)); - g_log.debug() << "dE = " << dE << std::endl; double tlab = std::atan2(ki - kf*cos(2.0*theta), kf*sin(2.0*theta)); double omega = (ds.huber - ds.deterota) * deg2rad - tlab; V3D uphi(-cos(omega), 0, -sin(omega)); @@ -691,8 +689,6 @@ void LoadDNSSCD::read_data(const std::string fname, boost::trim(line); const int cols = splitIntoColumns(columns, line); if (cols > 0){ - g_log.debug() << "Number of columns = " << cols << std::endl; - g_log.debug() << std::endl; ds.detID.push_back(std::stoi(columns.front())); columns.pop_front(); std::vector<double> signal; diff --git a/docs/source/algorithms/LoadDNSSCD-v1.rst b/docs/source/algorithms/LoadDNSSCD-v1.rst index d3b24caaf87f879236a4aa96b3150f23a7673dff..9a31751194ada704bb191f62dee8c60962f9f1ad 100644 --- a/docs/source/algorithms/LoadDNSSCD-v1.rst +++ b/docs/source/algorithms/LoadDNSSCD-v1.rst @@ -25,7 +25,7 @@ As a result, two workspaces are created: - `NormalizationWorkspace` contains the choosen normalization data (either monitor counts or experiment duration time). -Both workspaces have :math:`(H,K,L)` dimensions. The metadata are loaded into time series sample logs. +Both workspaces have :math:`(H,K,L,dE)` dimensions. The metadata are loaded into time series sample logs. .. note:: @@ -36,7 +36,7 @@ Restrictions - This algorithm only supports the *DNS* instrument in its configuration with one detector bank (polarisation analysis). -- This algorithm does not support DNS TOF mode data. It is meant only for single crystal diffraction experiments with 1 TOF channel. +- This algorithm does not allow to merge datasets with different number of TOF channels. Data replication @@ -91,7 +91,7 @@ Usage dimension.getUnits())) # print information about the table workspace - print ("TableWorkspace '{0}' has {1} row in the column '{2}'.".format(huber_ws.getName(), + print ("TableWorkspace '{0}' has {1} row in the column '{2}'.".format(huber_ws.name(), huber_ws.rowCount(), huber_ws.getColumnNames()[0])) print("It contains sample rotation angle {} degrees".format(huber_ws.cell(0, 0))) @@ -100,11 +100,12 @@ Usage .. testoutput:: LoadDNSSCDEx1 - Output Workspace Type is: MDEventWorkspace<MDEvent,3> - It has 24 events and 3 dimensions: + Output Workspace Type is: MDEventWorkspace<MDEvent,4> + It has 24 events and 4 dimensions: Dimension 0 has name: H, id: H, Range: -15.22 to 15.22 r.l.u Dimension 1 has name: K, id: K, Range: -15.22 to 15.22 r.l.u Dimension 2 has name: L, id: L, Range: -41.95 to 41.95 r.l.u + Dimension 3 has name: DeltaE, id: DeltaE, Range: -10.00 to 4.64 r.l.u TableWorkspace 'huber_ws' has 1 row in the column 'Huber(degrees)'. It contains sample rotation angle 79.0 degrees @@ -147,10 +148,10 @@ Usage .. testoutput:: LoadDNSSCDEx2 - Output Workspace Type is: MDEventWorkspace<MDEvent,3> - It has 10 events and 3 dimensions. - Normalization Workspace Type is: MDEventWorkspace<MDEvent,3> - It has 10 events and 3 dimensions. + Output Workspace Type is: MDEventWorkspace<MDEvent,4> + It has 10 events and 4 dimensions. + Normalization Workspace Type is: MDEventWorkspace<MDEvent,4> + It has 10 events and 4 dimensions. **Example 3 - Load sample rotation angles from the table** @@ -186,17 +187,18 @@ Usage print("It has {0} events and {1} dimensions.".format(ws.getNEvents(), ws.getNumDims())) # setting for the BinMD algorithm - bvec0 = '[100],unit,1,0,0' - bvec1 = '[001],unit,0,0,1' - bvec2 = '[010],unit,0,1,0' - extents = '-2,1.5,-0.2,6.1,-10,10' - bins = '10,10,1' + bvec0 = '[100],unit,1,0,0,0' + bvec1 = '[001],unit,0,0,1,0' + bvec2 = '[010],unit,0,1,0,0' + bvec3 = 'dE,meV,0,0,0,1' + extents = '-2,1.5,-0.2,6.1,-10,10,-10,4.6' + bins = '10,10,1,1' # bin the data - data_raw = BinMD(ws, AxisAligned='0', BasisVector0=bvec0, BasisVector1=bvec1, - BasisVector2=bvec2, OutputExtents=extents, OutputBins=bins, NormalizeBasisVectors='0') + data_raw = BinMD(ws, AxisAligned='0', BasisVector0=bvec0, BasisVector1=bvec1, BasisVector2=bvec2, + BasisVector3=bvec3, OutputExtents=extents, OutputBins=bins, NormalizeBasisVectors='0') # bin normalization - data_norm = BinMD(ws_norm, AxisAligned='0', BasisVector0=bvec0, BasisVector1=bvec1, - BasisVector2=bvec2, OutputExtents=extents, OutputBins=bins, NormalizeBasisVectors='0') + data_norm = BinMD(ws_norm, AxisAligned='0', BasisVector0=bvec0, BasisVector1=bvec1, BasisVector2=bvec2, + BasisVector3=bvec3, OutputExtents=extents, OutputBins=bins, NormalizeBasisVectors='0') # normalize data data = data_raw/data_norm @@ -204,16 +206,17 @@ Usage print("Reduced Workspace Type is: {}".format(data.id())) print("It has {} dimensions.".format(data.getNumDims())) s = data.getSignalArray() - print("Signal at some points: {0:.4f}, {1:.4f}, {2:.4f}".format(s[7,1][0], s[7,2][0], s[7,3][0])) + print("Signal at some points: {0:.4f}, {1:.4f}, {2:.4f}".format( + float(s[7,1][0]), float(s[7,2][0]), float(s[7,3][0]))) **Output:** .. testoutput:: LoadDNSSCDEx3 - Output Workspace Type is: MDEventWorkspace<MDEvent,3> - It has 240 events and 3 dimensions. + Output Workspace Type is: MDEventWorkspace<MDEvent,4> + It has 240 events and 4 dimensions. Reduced Workspace Type is: MDHistoWorkspace - It has 3 dimensions. + It has 4 dimensions. Signal at some points: 0.0035, 0.0033, 0.0035 .. categories::