diff --git a/.gitignore b/.gitignore index 4f341d6fe70a7f6dda74361470200b534ad0ea38..0e91105b4591b63caadb997674f309822f2ced1a 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,5 @@ Thumbs.db # Folder config file Desktop.ini + +/Code/Mantid/Build/CMake/OutputBinaryTo.cmake \ No newline at end of file diff --git a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp index 1989f9cae9ece24e57a797762b6c4e7b5dae97cb..a15ec5b06c7c340fabcffe403b1d3f5d3289d214 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadNexusProcessed.cpp @@ -349,6 +349,7 @@ API::Workspace_sptr LoadNexusProcessed::loadTableEntry(NXEntry & entry) NXInfo info = nx_tw.getDataSetInfo(str.c_str()); if (info.stat == NX_ERROR) { + // Assume we done last column of table break; } @@ -369,6 +370,24 @@ API::Workspace_sptr LoadNexusProcessed::loadTableEntry(NXEntry & entry) for (int i = 0; i < length; i++) workspace->cell<double>(i,columnNumber-1) = *(nxDouble() + i); } + } + else if ( info.type == NX_INT32 ) + { + NXInt nxInt = nx_tw.openNXInt(str.c_str()); + std::string columnTitle = nxInt.attributes("name"); + if (!columnTitle.empty()) + { + workspace->addColumn("int", columnTitle); + nxInt.load(); + int length = nxInt.dim0(); + if ( !hasNumberOfRowBeenSet ) + { + workspace->setRowCount(length); + hasNumberOfRowBeenSet = true; + } + for (int i = 0; i < length; i++) + workspace->cell<int>(i,columnNumber-1) = *(nxInt() + i); + } } else if ( info.type == NX_CHAR ) { diff --git a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp index d451048e7a090b3c05d7abbe6df9c5bd67898c75..267365b95bb1022e7588497fee013ed3b8006c21 100644 --- a/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp +++ b/Code/Mantid/Framework/Nexus/src/NexusFileIO.cpp @@ -440,8 +440,8 @@ using namespace DataObjects; std::string str = "column_" + boost::lexical_cast<std::string>(i+1); - if ( col->isType<double>() ) - { + if ( col->isType<double>() ) + { double * toNexus = new double[nRows]; for (int ii = 0; ii < nRows; ii++) toNexus[ii] = col->cell<double>(ii); @@ -457,6 +457,23 @@ using namespace DataObjects; static_cast<int>(interpret_as.size()), NX_CHAR); status=NXclosedata(fileID); } + else if ( col->isType<int>() ) + { + int * toNexus = new int[nRows]; + for (int ii = 0; ii < nRows; ii++) + toNexus[ii] = col->cell<int>(ii); + NXwritedata(str.c_str(), NX_INT32, 1, dims_array, (void *)(toNexus), false); + delete[] toNexus; + + // attributes + status=NXopendata(fileID, str.c_str()); + std::string units = "Not known"; + std::string interpret_as = "An integer"; + status=NXputattr(fileID, "units", (void*)units.c_str(), static_cast<int>(units.size()), NX_CHAR); + status=NXputattr(fileID, "interpret_as", (void*)interpret_as.c_str(), + static_cast<int>(interpret_as.size()), NX_CHAR); + status=NXclosedata(fileID); + } else if ( col->isType<std::string>() ) { // determine max string size diff --git a/Code/Mantid/scripts/Inelastic/DirectEnergyConversion.py b/Code/Mantid/scripts/Inelastic/DirectEnergyConversion.py index dfda5de0acb0dcb2eb2804fa2c1dd1595d271149..815f0ffd1ec591d659a2252e4f0570d22eebdd2f 100755 --- a/Code/Mantid/scripts/Inelastic/DirectEnergyConversion.py +++ b/Code/Mantid/scripts/Inelastic/DirectEnergyConversion.py @@ -601,7 +601,7 @@ class DirectEnergyConversion(object): elif ext == '.nxs': SaveNexus(workspace, filename) elif ext == '.nxspe': - SaveNXSPE(workspace, filename, KiOverKfScaling=self.apply_kikf_correction,psi=self.psi) + SaveNXSPE(workspace, filename, KiOverKfScaling=self.apply_kikf_correction,Psi=self.psi) else: self.log('Unknown file format "%s" encountered while saving results.') @@ -755,4 +755,4 @@ class DirectEnergyConversion(object): if self._log_to_mantid: mtd.sendLogMessage(msg) -#----------------------------------------------------------------- +#----------------------------------------------------------------- \ No newline at end of file