Ticket #6070: 6070.patch

File 6070.patch, 2.6 KB (added by Gesner Passos, 7 years ago)
  • Code/Mantid/Framework/Algorithms/src/Q1D2.cpp

    diff --git a/Code/Mantid/Framework/Algorithms/src/Q1D2.cpp b/Code/Mantid/Framework/Algorithms/src/Q1D2.cpp
    index 1635516..e698686 100644
    a b The error was calculation did not include the errors due the normalization or an 
    136136#include "MantidAlgorithms/Qhelper.h" 
    137137#include "MantidKernel/BoundedValidator.h" 
    138138#include "MantidAPI/ISpectrum.h" 
     139#include <boost/algorithm/string/split.hpp> 
    139140 
    140141namespace Mantid 
    141142{ 
    void Q1D2::exec() 
    240241  const int numSpec = static_cast<int>(m_dataWS->getNumberHistograms()); 
    241242  Progress progress(this, 0.05, 1.0, numSpec+1); 
    242243 
     244  std::set<int> ignore_numbers; 
     245  std::string pname = "ignore-spectra";  
     246  if( m_dataWS->getInstrument()->hasParameter(pname)) 
     247    { 
     248      struct GetNum { int operator()(const std::string& inp) const { return atoi(inp.c_str()); } }; 
     249      std::string str_values = m_dataWS->getInstrument()->getStringParameter(pname)[0]; 
     250      std::vector<std::string> data; 
     251      boost::split(data, str_values, boost::is_any_of(","));  
     252      auto it1 = std::inserter(ignore_numbers, ignore_numbers.begin());  
     253      std::transform(data.begin(), data.end(), it1, GetNum());  
     254    } 
     255 
     256 
    243257  PARALLEL_FOR3(m_dataWS, outputWS, pixelAdj) 
    244258  for (int i = 0; i < numSpec; ++i) 
    245259  { 
    void Q1D2::exec() 
    249263    try { 
    250264      det = m_dataWS->getDetector(i); 
    251265    } catch (Exception::NotFoundError&) { 
    252       g_log.warning() << "Workspace index " << i << " (SpectrumIndex = " << m_dataWS->getSpectrum(i)->getSpectrumNo() << ") has no detector assigned to it - discarding" << std::endl; 
     266      if ( ignore_numbers.find(m_dataWS->getSpectrum(i)->getSpectrumNo()) == ignore_numbers.end()) 
     267        g_log.warning() << "Workspace index " << i << " (SpectrumIndex = " << m_dataWS->getSpectrum(i)->getSpectrumNo() << ") has no detector assigned to it - discarding" << std::endl; 
    253268      // Catch if no detector. Next line tests whether this happened - test placed 
    254269      // outside here because Mac Intel compiler doesn't like 'continue' in a catch 
    255270      // in an openmp block. 
  • Code/Mantid/instrument/LOQ_Parameters.xml

    diff --git a/Code/Mantid/instrument/LOQ_Parameters.xml b/Code/Mantid/instrument/LOQ_Parameters.xml
    index 493b819..628ad38 100644
    a b  
    5555  <value val="3"/> 
    5656</parameter> 
    5757 
     58<parameter name="ignore-spectra" type="string"> 
     59  <value val="16735, 17085, 17086, 16736, 17785, 17786, 17787, 17788, 17789, 17790, 17791, 17792, 17435, 17436"/> 
     60</parameter> 
     61 
    5862</component-link> 
    5963 
    6064</parameter-file>