From c57c1d37d1fa06f51a9e5b765ca0567849eef11d Mon Sep 17 00:00:00 2001
From: Anders Markvardsen <anders.markvardsen@stfc.ac.uk>
Date: Mon, 2 Apr 2012 15:27:51 +0100
Subject: [PATCH] Fixed display masking in isis sans gui. re #5044

Here fixed a problem where display masking is out
by 4 spectra, which had various side effect like
missing horizontal lines
---
 Code/Mantid/instrument/SANS2D_Definition.xml  | 21 ++++++++++++++++---
 .../scripts/SANS/ISISCommandInterface.py      |  1 +
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/Code/Mantid/instrument/SANS2D_Definition.xml b/Code/Mantid/instrument/SANS2D_Definition.xml
index aa7379421a7..58521f86b7d 100644
--- a/Code/Mantid/instrument/SANS2D_Definition.xml
+++ b/Code/Mantid/instrument/SANS2D_Definition.xml
@@ -3,7 +3,7 @@
      see http://www.mantidproject.org/IDF -->
 <instrument name="SANS2D" valid-from   ="1900-01-31 23:59:59"
                           valid-to     ="2100-01-31 23:59:59"
-		          last-modified="2010-11-04 00:00:00">
+		          last-modified="2012-03-04 00:00:00">
 
   <defaults>
     <length unit="meter"/>
@@ -31,6 +31,8 @@
 	  as expected.
 	  01/02/10 very small chang eto pixel size 191*5.1=974.2=2*487.05 (was 487.4)
 	  - note have to swap x= and y= in Anders output list !
+      02/04/12 Put in 'no shape monitors' for possible in the future monitors
+      with ID 5-8
   -->
   
   
@@ -69,6 +71,18 @@
       <!-- better positions and shapes will be defined later -->
       <location z="30.0" name="monitor4"/>
     </component>    
+    
+    <!-- Putting in monitors, which are defined in raw/neuxs
+         files, and have detector IDs, but currently not physically present 
+         on the instrument. Defined with no geometric shape, as they do not 
+         physically exist, and with a dummy position -->
+    <component type="no shape monitor" mark-as="monitor">
+      <location z="0" name="placeholder monitor"/>
+      <location z="0" name="placeholder monitor"/>
+      <location z="0" name="placeholder monitor"/>
+      <location z="0" name="placeholder monitor"/>      
+    </component>  
+    
   </type>
   
   <type name="monitor-tbd" is="detector">
@@ -90,7 +104,8 @@
     </cuboid>
     <algebra val="shape" />
   </type>  
-  
+
+  <type name="no shape monitor" is="detector" />   
 
   <component type="detector-bank" idstart="2000000" idfillbyfirst="y" idstep="1000" idstepbyrow="1">
     <location x="1.1" z="23.281" name="front-detector"/>
@@ -119,7 +134,7 @@
   <!-- DETECTOR and MONITOR ID LISTS -->
 
   <idlist idname="monitors">
-    <id start="1" end="4" />  
+    <id start="1" end="8" />  
   </idlist>   
   
 </instrument>
diff --git a/Code/Mantid/scripts/SANS/ISISCommandInterface.py b/Code/Mantid/scripts/SANS/ISISCommandInterface.py
index 1814098d51a..7c3848ef422 100644
--- a/Code/Mantid/scripts/SANS/ISISCommandInterface.py
+++ b/Code/Mantid/scripts/SANS/ISISCommandInterface.py
@@ -621,6 +621,7 @@ def DisplayMask(mask_worksp=None):
             CloneWorkspace(samp, mask_worksp)
         else:
             instrument.load_empty(mask_worksp)
+            instrument.set_up_for_run('emptyInstrument')
         
     ReductionSingleton().mask.display(mask_worksp, ReductionSingleton(), counts_data)
     if counts_data:
-- 
GitLab