Skip to content

Commit

Permalink
Re #9357. Remove ManagedRawFileWorkspace2D.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Apr 23, 2014
1 parent 59f2b71 commit 02a18b4
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 859 deletions.
3 changes: 0 additions & 3 deletions Code/Mantid/Framework/DataHandling/CMakeLists.txt
Expand Up @@ -84,7 +84,6 @@ set ( SRC_FILES
src/LoadSpec.cpp
src/LoadSpice2D.cpp
src/LoadTOFRawNexus.cpp
src/ManagedRawFileWorkspace2D.cpp
src/MaskDetectors.cpp
src/MaskDetectorsInShape.cpp
src/MergeLogs.cpp
Expand Down Expand Up @@ -212,7 +211,6 @@ set ( INC_FILES
inc/MantidDataHandling/LoadSpec.h
inc/MantidDataHandling/LoadSpice2D.h
inc/MantidDataHandling/LoadTOFRawNexus.h
inc/MantidDataHandling/ManagedRawFileWorkspace2D.h
inc/MantidDataHandling/MaskDetectors.h
inc/MantidDataHandling/MaskDetectorsInShape.h
inc/MantidDataHandling/MergeLogs.h
Expand Down Expand Up @@ -336,7 +334,6 @@ set ( TEST_FILES
LoadSpice2dTest.h
LoadTOFRawNexusTest.h
LoadTest.h
ManagedRawFileWorkspace2DTest.h
MaskDetectorsInShapeTest.h
MaskDetectorsTest.h
MergeLogsTest.h
Expand Down
Expand Up @@ -80,11 +80,6 @@ namespace Mantid
void validateWorkspaceSizes( bool bexcludeMonitors ,bool bseparateMonitors,
const int64_t normalwsSpecs,const int64_t monitorwsSpecs);

/// this method will be executed if not enough memory.
void goManagedRaw(bool bincludeMonitors,bool bexcludeMonitors,
bool bseparateMonitors,const std::string& fileName);


/// This method is useful for separating or excluding monitors from the output workspace
void separateOrexcludeMonitors(DataObjects::Workspace2D_sptr localWorkspace,
bool binclude,bool bexclude,bool bseparate,
Expand Down

This file was deleted.

64 changes: 0 additions & 64 deletions Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp
Expand Up @@ -24,7 +24,6 @@ LoadRaw version 1 and 2 are no longer available in Mantid. Version 3 has been v
// Includes
//----------------------------------------------------------------------
#include "MantidDataHandling/LoadRaw3.h"
#include "MantidDataHandling/ManagedRawFileWorkspace2D.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidGeometry/Instrument/XMLlogfile.h"
#include "MantidAPI/MemoryManager.h"
Expand Down Expand Up @@ -140,16 +139,6 @@ namespace Mantid
// Calculate the size of a workspace, given its number of periods & spectra to read
m_total_specs = calculateWorkspaceSize();

// If there is not enough memory use ManagedRawFileWorkspace2D.
if ( ConfigService::Instance().getString("ManagedRawFileWorkspace.DoNotUse") != "1" &&
m_numberOfPeriods == 1 && m_total_specs == m_numberOfSpectra &&
MemoryManager::Instance().goForManagedWorkspace(m_total_specs,m_lengthIn, m_lengthIn-1) )
{
fclose(file);
goManagedRaw(bincludeMonitors, bexcludeMonitors, bseparateMonitors,m_filename);
return;
}

// Get the time channel array(s) and store in a vector inside a shared pointer
m_timeChannelsVec =getTimeChannels(m_noTimeRegimes,m_lengthIn);

Expand Down Expand Up @@ -584,59 +573,6 @@ namespace Mantid
return bMonitor;
}

/// Creates a ManagedRawFileWorkspace2D
/// @param bincludeMonitors :: Include monitors or not
/// @param bexcludeMonitors :: Exclude monitors or not
/// @param bseparateMonitors :: Separate monitors or not
/// @param fileName :: the filename
void LoadRaw3::goManagedRaw(bool bincludeMonitors, bool bexcludeMonitors, bool bseparateMonitors,
const std::string& fileName)
{
const std::string cache_option = getPropertyValue("Cache");
bool bLoadlogFiles = getProperty("LoadLogFiles");
size_t option = find(m_cache_options.begin(), m_cache_options.end(), cache_option)
- m_cache_options.begin();
progress(m_prog, "Reading raw file data...");
DataObjects::Workspace2D_sptr localWorkspace = DataObjects::Workspace2D_sptr(
new ManagedRawFileWorkspace2D(fileName, static_cast<int>(option)));
setProg( 0.2 );
progress(m_prog);
loadRunParameters(localWorkspace);
setProg( 0.4 );
progress(m_prog);
runLoadInstrument(fileName,localWorkspace, 0.2, 0.4 );
setProg( 0.5 );
progress(m_prog);
// Since all spectra are being loaded if we get to here,
// we can just set the spectrum numbers to start at 1 and increase monotonically
for (int i = 0; i < m_numberOfSpectra; ++i)
{
localWorkspace->getSpectrum(i)->setSpectrumNo(i+1);
}
setProg( 0.6 );
progress(m_prog);
runLoadMappingTable(fileName,localWorkspace);
setProg( 0.7 );
progress(m_prog);
if (bLoadlogFiles)
{
runLoadLog(fileName,localWorkspace, 0.5, 0.7);
const int current_period = 1;
createPeriodLogs(current_period,localWorkspace);
}
setProtonCharge(localWorkspace->mutableRun());

setProg( 0.8 );
progress(m_prog);
localWorkspace->populateInstrumentParameters();
setProg( 0.9 );
separateOrexcludeMonitors(localWorkspace, bincludeMonitors, bexcludeMonitors,
bseparateMonitors,m_numberOfSpectra,fileName);
setProg( 1.0 );
progress(m_prog);
setProperty("OutputWorkspace", boost::dynamic_pointer_cast<Workspace>(localWorkspace));
}

/** This method separates/excludes monitors from output workspace and creates a separate workspace for monitors
* THIS METHOD IS ONLY CALLED BY THE goManagedRaw METHOD ABOVE AND NOT IN THE GENERAL CASE
* @param localWorkspace :: shared pointer to workspace
Expand Down

0 comments on commit 02a18b4

Please sign in to comment.