Commit f6210da5 authored by Mathieu Tillet's avatar Mathieu Tillet
Browse files

Remove pixel size for ILL SANS

When loading SANS instruments, storing the pixel size in the log data is
now redundant with the parameter file and so is removed.
parent 616a5f8c
......@@ -93,7 +93,6 @@ private:
bool m_isD16Omega; ///< Data come from a D16 omega scan flag
void setFinalProperties(const std::string &filename);
void setPixelSize();
std::vector<double> getVariableTimeBinning(const NeXus::NXEntry &,
const std::string &,
const NeXus::NXInt &,
......
......@@ -169,7 +169,6 @@ void LoadILLSANS::exec() {
progress.report("Setting sample logs");
setFinalProperties(filename);
setPixelSize();
setProperty("OutputWorkspace", m_localWorkspace);
} // namespace DataHandling
......@@ -825,27 +824,6 @@ void LoadILLSANS::moveSource() {
mover->executeAsChildAlg();
}
/**
* Sets the width (x) and height (y) of the pixel
*/
void LoadILLSANS::setPixelSize() {
const auto instrument = m_localWorkspace->getInstrument();
const std::string component =
(m_instrumentName == "D33") ? "back_detector" : "detector";
auto detector = instrument->getComponentByName(component);
auto rectangle =
std::dynamic_pointer_cast<const Geometry::RectangularDetector>(detector);
if (rectangle) {
const double dx = rectangle->xstep();
const double dy = rectangle->ystep();
API::Run &runDetails = m_localWorkspace->mutableRun();
runDetails.addProperty<double>("pixel_width", dx);
runDetails.addProperty<double>("pixel_height", dy);
} else {
g_log.debug("No pixel size available");
}
}
/**
* Returns the wavelength axis computed in VTOF mode
* @param entry : opened root nexus entry
......
......@@ -294,8 +294,12 @@ class SANSILLIntegration(PythonAlgorithm):
wavelength = run.getLogData('wavelength').value
l1 = run.getLogData('collimation.actual_position').value
l2 = run.getLogData('L2').value
x3 = run.getLogData('pixel_width').value
y3 = run.getLogData('pixel_height').value
instrument = mtd[self._input_ws].getInstrument()
if instrument.hasParameter("x-pixel-size") and instrument.hasParameter("y-pixel-size"):
x3 = instrument.getNumberParameter('x-pixel-size')[0] / 1000
y3 = instrument.getNumberParameter('y-pixel-size')[0] / 1000
else:
raise RuntimeError('Unable to calculate resolution, missing pixel size.')
delta_wavelength = run.getLogData('selector.wavelength_res').value * 0.01
if run.hasProperty('collimation.sourceAperture'):
source_aperture = run.getLogData('collimation.sourceAperture').value
......@@ -373,8 +377,10 @@ class SANSILLIntegration(PythonAlgorithm):
q_min = run.getLogData(q_min_name).value
q_max = run.getLogData(q_max_name).value
self.log().information('Using qmin={0:.2f}, qmax={1:.2f}'.format(q_min, q_max))
pixel_height = run.getLogData('pixel_height').value
pixel_width = run.getLogData('pixel_width').value
instrument = mtd[self._input_ws].getInstrument()
pixel_width = instrument.getNumberParameter('x-pixel-size')[0] / 1000
pixel_height = instrument.getNumberParameter('y-pixel-size')[0] / 1000
pixel_size = pixel_height if pixel_height >= pixel_width else pixel_width
binning_factor = self.getProperty('BinningFactor').value
wavelength = 0. # for TOF mode there is no wavelength
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment