Skip to content
Snippets Groups Projects
Commit d456ed7d authored by Doucet, Mathieu's avatar Doucet, Mathieu
Browse files

Re #5023 Add new geometry for BioSANS

parent d19b2e8d
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@
#include <Poco/DOM/NodeList.h>
#include <Poco/DOM/Node.h>
#include <Poco/DOM/Text.h>
#include "Poco/RegularExpression.h"
#include "Poco/NumberParser.h"
#include <boost/shared_array.hpp>
#include <iostream>
//-----------------------------------------------------------------------
......@@ -176,13 +178,6 @@ namespace Mantid
double sample_thickness = 0;
from_element<double>(sample_thickness, sasEntryElem, "Sample_Thickness", fileName);
// Read in the detector dimensions
int numberXPixels = 0;
from_element<int>(numberXPixels, sasEntryElem, "Number_of_X_Pixels", fileName);
int numberYPixels = 0;
from_element<int>(numberYPixels, sasEntryElem, "Number_of_Y_Pixels", fileName);
double source_apert = 0.0;
from_element<double>(source_apert, sasEntryElem, "source_aperture_size", fileName);
......@@ -264,6 +259,27 @@ namespace Mantid
throwException(element, "Detector", fileName);
std::string data_str = element->innerText();
// Read in the detector dimensions from the Detector tag
int numberXPixels = 0;
int numberYPixels = 0;
std::string data_type = element->getAttribute("type");
Poco::RegularExpression re_sig("([0-9]+),([0-9]+)");
Poco::RegularExpression::MatchVec match;
re_sig.match(data_type, 0, match);
if (match.size()==3)
{
std::string num_str = data_type.substr(match[1].offset, match[1].length);
Poco::NumberParser::tryParse(num_str, numberXPixels);
num_str = data_type.substr(match[2].offset, match[2].length);
Poco::NumberParser::tryParse(num_str, numberYPixels);
}
if (numberXPixels==0 || numberYPixels==0)
g_log.notice() << "Could not read in the number of pixels!" << std::endl;
// We no longer read from the meta data because that data is wrong
//from_element<int>(numberXPixels, sasEntryElem, "Number_of_X_Pixels", fileName);
//from_element<int>(numberYPixels, sasEntryElem, "Number_of_Y_Pixels", fileName);
// Store sample-detector distance
declareProperty("SampleDetectorDistance", distance, Kernel::Direction::Output);
......@@ -350,6 +366,7 @@ namespace Mantid
ws->mutableRun().addProperty("timer", countingTime, "sec", true);
ws->mutableRun().addProperty("monitor", monitorCounts, "", true);
ws->mutableRun().addProperty("start_time", start_time, "", true);
ws->mutableRun().addProperty("run_start", start_time, "", true);
// Move the detector to the right position
API::IAlgorithm_sptr mover = createSubAlgorithm("MoveInstrumentComponent");
......
......@@ -2,8 +2,8 @@
<!-- For help on the notation used to specify an Instrument Definition File
see http://www.mantidproject.org/IDF -->
<instrument name="BioSANS" valid-from ="1900-01-31 23:59:59"
valid-to ="2100-01-31 23:59:59"
last-modified="2011-03-03 08:35:37">
valid-to ="2012-01-31 23:59:59"
last-modified="2012-03-23 15:02:05">
<!-- TEST DEFINITION: NOT READY FOR SHOW TIME -->
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment