From 6c9b01c0c916fac8489b1b221e5536e6e4b1608c Mon Sep 17 00:00:00 2001
From: Mathieu Doucet <doucetm@ornl.gov>
Date: Mon, 21 Feb 2011 14:19:54 +0000
Subject: [PATCH] Fixes #2495

---
 .../PythonAlgorithms/EQSANSTransmission.py          | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/EQSANSTransmission.py b/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/EQSANSTransmission.py
index 004e37bb880..d065fa87c8f 100644
--- a/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/EQSANSTransmission.py
+++ b/Code/Mantid/Framework/PythonAPI/PythonAlgorithms/EQSANSTransmission.py
@@ -27,6 +27,7 @@ class EQSANSTransmission(PythonAlgorithm):
     NY_TRANS_PIX = 10
     
     # Number of Y pixels
+    NX_PIX = 192
     NY_PIX = 256
     
     # To define transmission peak
@@ -66,6 +67,18 @@ class EQSANSTransmission(PythonAlgorithm):
         ny_min = ycenter - self.NY_TRANS_PIX
         ny_max = ycenter + self.NY_TRANS_PIX
 
+        # Check that pixels are on the detector
+        if nx_min<0: nx_min = 0
+        if nx_min>self.NX_PIX: nx_min = self.NX_PIX
+        if nx_max<0: nx_max = 0
+        if nx_max>self.NX_PIX: nx_max = self.NX_PIX
+        
+        if ny_min<0: ny_min = 0
+        if ny_min>self.NY_PIX: ny_min = self.NY_PIX
+        if ny_max<0: ny_max = 0
+        if ny_max>self.NY_PIX: ny_max = self.NY_PIX
+        
+
         # Sum up all TOF bins
         Integration(input_ws, input_ws.getName()+'_int')
         integrated_ws = mantid.getMatrixWorkspace(input_ws.getName()+'_int')
-- 
GitLab