Skip to content

Commit

Permalink
Refs #4024: going back to old Nexus (again!)
Browse files Browse the repository at this point in the history
This reverts commit 34d300f.
  • Loading branch information
Janik Zikovsky committed Nov 22, 2011
1 parent 34d300f commit 5f2e4cc
Show file tree
Hide file tree
Showing 69 changed files with 3,343 additions and 398 deletions.
1 change: 1 addition & 0 deletions Code/Mantid/Build/CMake/CommonVatesSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Framework/DataHandling
Framework/MDEvents
Framework/MDAlgorithms
Framework/Nexus
Framework/NexusCPP
)

set ( COMMONVATES_SETUP_DONE TRUE )
3 changes: 2 additions & 1 deletion Code/Mantid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ add_subdirectory ( Framework )
include_directories ( Framework/Kernel/inc )
include_directories ( Framework/Geometry/inc )
include_directories ( Framework/API/inc )
set ( CORE_MANTIDLIBS Kernel Geometry API ${NEXUS_LIBRARIES})
include_directories ( Framework/NexusCPP/inc )
set ( CORE_MANTIDLIBS Kernel Geometry API )

add_subdirectory ( MantidQt )

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/BoxController.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "MantidKernel/MultiThreaded.h"
#include "MantidKernel/System.h"
#include "MantidKernel/ThreadPool.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include <boost/shared_ptr.hpp>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/MatrixWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <set>
#include "MantidAPI/ISpectrum.h"
#include "MantidKernel/DateAndTime.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"

namespace Mantid
{
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/PropertyNexus.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "MantidKernel/System.h"
#include "MantidKernel/Property.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"


namespace Mantid
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/inc/MantidAPI/Run.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "MantidKernel/TimeSplitter.h"
#include <vector>
#include "MantidKernel/Matrix.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"


namespace Mantid
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/src/MatrixWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <numeric>
#include "MantidAPI/NumericAxis.h"
#include "MantidKernel/DateAndTime.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"

using Mantid::Kernel::DateAndTime;
using Mantid::Kernel::TimeSeriesProperty;
Expand Down
29 changes: 6 additions & 23 deletions Code/Mantid/Framework/API/src/PropertyNexus.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "MantidAPI/PropertyNexus.h"
#include "MantidKernel/System.h"
#include "nexus/NeXusException.hpp"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/PropertyWithValue.h"
Expand Down Expand Up @@ -164,11 +164,7 @@ namespace PropertyNexus
template <typename NumT>
void savePropertyWithValue(::NeXus::File * file, PropertyWithValue<NumT> * prop)
{
// Spaces are unacceptable in names - remove them
std::string name(prop->name());
for (size_t i=0; i<name.size(); i++)
if (name[i] == ' ') name[i] = '_';
file->makeGroup(name, "NXlog", 1);
file->makeGroup(prop->name(), "NXlog", 1);
file->writeData("value", (*prop)() );
file->closeGroup();
}
Expand All @@ -177,11 +173,7 @@ namespace PropertyNexus
/** Helper function to save a PropertyWithValue<> */
void savePropertyWithValueString(::NeXus::File * file, PropertyWithValue<std::string> * prop)
{
// Spaces are unacceptable in names - remove them
std::string name(prop->name());
for (size_t i=0; i<name.size(); i++)
if (name[i] == ' ') name[i] = '_';
file->makeGroup(name, "NXlog", 1);
file->makeGroup(prop->name(), "NXlog", 1);
file->writeData("value", prop->value() );
file->closeGroup();
}
Expand Down Expand Up @@ -210,11 +202,7 @@ namespace PropertyNexus
{
std::vector<NumT> value = prop->valuesAsVector();
if( value.empty() ) return;
// Spaces are unacceptable in names - remove them
std::string name(prop->name());
for (size_t i=0; i<name.size(); i++)
if (name[i] == ' ') name[i] = '_';
file->makeGroup(name, "NXlog", 1);
file->makeGroup(prop->name(), "NXlog", 1);
file->writeData("value", value );
saveTimeVector(file, prop);
file->closeGroup();
Expand All @@ -226,12 +214,7 @@ namespace PropertyNexus
{
std::vector<std::string> values = prop->valuesAsVector();
if( values.empty() ) return;

// Spaces are unacceptable in names - remove them
std::string name(prop->name());
for (size_t i=0; i<name.size(); i++)
if (name[i] == ' ') name[i] = '_';
file->makeGroup(name, "NXlog", 1);
file->makeGroup(prop->name(), "NXlog", 1);

// Find the max length of any string
size_t maxlen=0;
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/src/Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "MantidGeometry/IComponent.h"
#include "MantidGeometry/Crystal/OrientedLattice.h"
#include "MantidGeometry/Objects/ShapeFactory.h"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

using namespace Mantid::Kernel;
using Mantid::Geometry::ShapeFactory;
Expand Down
9 changes: 5 additions & 4 deletions Code/Mantid/Framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ set ( MANTIDLIBS ${Boost_LIBRARIES} ${POCO_LIBRARIES} ${TCMALLOC_LIBRARY} ${MPI
add_custom_target ( FrameworkTests ) # target for all framework tests
add_dependencies ( check FrameworkTests )

set ( MANTIDLIBS ${MANTIDLIBS} ${NEXUS_LIBRARIES} )
include_directories (NexusCPP/inc)
add_subdirectory (NexusCPP)
set ( MANTIDLIBS ${MANTIDLIBS} NexusCPP )

include_directories (Kernel/inc)
add_subdirectory (Kernel)
Expand Down Expand Up @@ -151,9 +153,8 @@ add_subdirectory (MDEvents)
###########################################################################

set ( FRAMEWORK_LIBS Kernel Geometry API PythonAPI PythonKernelModule PythonAPIModule DataObjects
DataHandling Nexus Algorithms CurveFitting ICat
Crystal MDAlgorithms MDEvents WorkflowAlgorithms
Crystal MDAlgorithms MDEvents WorkflowAlgorithms
DataHandling Nexus NexusCPP Algorithms CurveFitting ICat
Crystal MDAlgorithms MDEvents WorkflowAlgorithms
)

add_custom_target( Framework DEPENDS ${FRAMEWORK_LIBS} )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
#include "MantidAPI/IDataFileChecker.h"
#include "MantidDataObjects/EventWorkspace.h"

#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
//Copy of the NexusCpp API was placed in MantidNexus
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"
#include "MantidDataObjects/Events.h"


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/Sample.h"
#include "MantidDataObjects/Workspace2D.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"

//Copy of the NexusCpp API was placed in MantidNexus
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

#include "MantidAPI/DeprecatedAlgorithm.h"

namespace Mantid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"

namespace Mantid
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/MatrixWorkspace.h"
#include <boost/scoped_array.hpp>
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
//Copy of the NexusCpp API was placed in MantidNexus
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

namespace Mantid
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "MantidAPI/IDataFileChecker.h"

#include "MantidNexus/NexusClasses.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"

namespace Mantid
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define MANTID_DATAHANDLING_PRECOMPILEDHEADER_H_

#include "MantidAPI/Algorithm.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

#endif // MANTID_DATAHANDLING_PRECOMPILEDHEADER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
#include "MantidAPI/Sample.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"

//Copy of the NexusCpp API was placed in MantidNexus
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

namespace Mantid
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Mantid
/// Algorithm's category for identification overriding a virtual method
virtual const std::string category() const { return "DataHandling";}

protected:
private:
/// Sets documentation strings for this algorithm
virtual void initDocs();
/// Overwrites Algorithm method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
#include "MantidDataObjects/Workspace2D.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidGeometry/Instrument/RectangularDetector.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"

//Copy of the NexusCpp API was placed in MantidNexus
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

using namespace ::NeXus;

Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadISISNexus2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "MantidGeometry/Instrument/XMLlogfile.h"
#include "MantidGeometry/Instrument/Detector.h"

#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

#include "MantidAPI/LoadAlgorithmFactory.h"
#include <Poco/Path.h>
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadMuonNexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ The subalgorithms used by LoadMuonNexus are:
#include <boost/shared_ptr.hpp>
#include "MantidNexus/MuonNexusReader.h"
#include "MantidNexus/NexusClasses.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"

namespace Mantid
{
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadMuonNexus2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "MantidAPI/Progress.h"
#include "MantidAPI/SpectraDetectorMap.h"
#include "MantidNexus/NexusClasses.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"


#include "MantidAPI/LoadAlgorithmFactory.h"
Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadNXSPE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ Algorithm to load an NXSPE file into a workspace2D. It will create a new instrum
#include "MantidKernel/UnitFactory.h"
#include "MantidAPI/FileProperty.h"
#include "MantidAPI/LoadAlgorithmFactory.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"

//Copy of the NexusCpp API was placed in MantidNexus
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"
#include "MantidNexus/NexusClasses.h"
#include <vector>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataHandling/src/LoadNexusLogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you use [[LoadSNSEventNexus]] or [[LoadISISNexus]], calling this algorithm is
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/LoadNexusLogs.h"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusException.hpp"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/LogParser.h"
#include "MantidAPI/FileProperty.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The subalgorithms used by LoadMuonNexus are:
#include "MantidKernel/UnitFactory.h"
#include "MantidNexus/NexusClasses.h"
#include "MantidNexus/NexusFileIO.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include <boost/shared_ptr.hpp>
#include <cmath>
#include <Poco/DateTimeParser.h>
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/Framework/DataHandling/src/LoadTOFRawNexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/BoundedValidator.h"
#include "MantidKernel/cow_ptr.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include <boost/algorithm/string/detail/classification.hpp>
#include <boost/algorithm/string/split.hpp>

Expand Down Expand Up @@ -235,7 +235,7 @@ void LoadTOFRawNexus::countPixels(const std::string &nexusfilename, const std::s

// Count how many pixels in the bank
file->openData("pixel_id");
std::vector<int64_t> dims = file->getInfo().dims;
std::vector<int> dims = file->getInfo().dims;
file->closeData();

size_t newPixels = 1;
Expand All @@ -251,7 +251,7 @@ void LoadTOFRawNexus::countPixels(const std::string &nexusfilename, const std::s
{
// Get the size of the X vector
file->openData(m_axisField);
std::vector<int64_t> dims = file->getInfo().dims;
std::vector<int> dims = file->getInfo().dims;
// Find the units, if available
if (file->hasAttr("units"))
file->getAttr("units", m_xUnits);
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/SaveNXSPE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ namespace Mantid
nxFile.makeData("data", ::NeXus::FLOAT64, array_dims, false);
nxFile.makeData("error", ::NeXus::FLOAT64, array_dims, false);

std::vector<int64_t> slab_start;
std::vector<int64_t> slab_size;
std::vector<int> slab_start;
std::vector<int> slab_size;

// What size slabs are we going to write...
slab_size.push_back(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ None
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/ConfigService.h"
#include "MantidNexus/NexusFileIO.h"
#include "nexus/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include <boost/shared_ptr.hpp>
#include <cmath>
#include <Poco/File.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ It is assumed that the positions specified in the raw file are all with respect
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/SpectraDetectorMap.h"
#include "LoadRaw/isisraw2.h"
#include "nexus/NeXusFile.hpp"
#include "nexus/NeXusException.hpp"
#include "MantidNexusCPP/NeXusFile.hpp"
#include "MantidNexusCPP/NeXusException.hpp"
#include <boost/scoped_ptr.hpp>

namespace Mantid
Expand Down

0 comments on commit 5f2e4cc

Please sign in to comment.