Index: DataLoader/test/cansas1d_slit.xml
===================================================================
--- DataLoader/test/cansas1d_slit.xml	(revision d00f8ff74790ad97d3fddff0a584009680fdda7d)
+++ DataLoader/test/cansas1d_slit.xml	(revision d00f8ff74790ad97d3fddff0a584009680fdda7d)
@@ -0,0 +1,141 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="example.xsl" ?>
+<SASroot version="1.0"
+    xmlns="cansas1d/1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="cansas1d/1.0 http://svn.smallangles.net/svn/canSAS/1dwg/trunk/cansas1d.xsd"
+    >
+	<SASentry>
+		<Title>Test title</Title>
+		<Run name='run name'>1234</Run>
+		<SASdata>
+			<Idata>
+				<Q unit="1/A">0.02</Q>
+				<I unit="1/cm">1000</I>
+				<Idev unit="1/cm">3</Idev>
+				<dQl unit="1/A">0.005</dQl>
+				<dQw unit="1/A">0.001</dQw>
+				<Shadowfactor><!-- Shadowfactor is optional --></Shadowfactor>
+			</Idata>
+			<Idata>
+				<Q unit="1/A">0.03</Q>
+				<I unit="1/cm">1001</I>
+				<Idev unit="1/cm">4</Idev>
+				<dQl unit="1/A">0.005</dQl>
+				<dQw unit="1/A">0.001</dQw>
+				<Shadowfactor><!-- Shadowfactor is optional --></Shadowfactor>
+			</Idata>
+		</SASdata>
+		<SASsample name='my sample'>
+			<ID>SI600-new-long</ID>
+			<thickness unit="mm">1.03</thickness>
+			<transmission>0.327</transmission>
+			<temperature unit="C">0.0000</temperature>
+			<position>
+				<x unit="mm">10.00</x>
+				<y unit="mm">0.00</y>
+			</position>
+			<orientation>
+				<roll unit="degree">22.5<!-- was: sample_orientation --></roll>
+				<pitch unit="degree">0.020<!-- was: sample_offset_angle --></pitch>
+			</orientation>
+			<details>
+				<!-- was: sample_prep -->
+				http://chemtools.chem.soton.ac.uk/projects/blog/blogs.php/bit_id/2720
+			</details>
+			<details>
+				Some text here
+			</details>
+			
+		</SASsample>
+		<SASinstrument name="TEST instrument">
+			<name>canSAS instrument</name>
+			<SASsource name="source name">
+				<radiation>neutron</radiation>
+				<beam_size name='bm'>
+					<x unit="mm">12.00</x>
+					<y unit="mm">13.00</y>
+				</beam_size>
+				<beam_shape>disc</beam_shape>
+				<wavelength unit="A">6.00</wavelength>
+				<wavelength_min unit="nm">0.22</wavelength_min>
+				<wavelength_max unit="nm">1.00</wavelength_max>
+				<wavelength_spread unit="percent">
+					14.3
+				</wavelength_spread>
+			</SASsource>
+			<SAScollimation name="test coll name">
+				<length unit='mm'> 123.0</length>
+				<aperture name="source" type="radius">
+					<size>
+						<x unit="mm">50</x>
+					</size>
+					<distance unit="m">11.000<!-- was: distance_coll --></distance>
+				</aperture>
+				<aperture name="sample" type="radius">
+					<size name='size name'>
+						<x unit="mm">1</x>
+					</size>
+				</aperture>
+			</SAScollimation>
+			<SASdetector>
+				<name>fictional hybrid</name>
+				<SDD unit="m">
+					<!-- sample-to-detector distance -->
+					4.150
+				</SDD>
+				<orientation>
+					<roll unit="degree">1.00</roll>
+					<pitch unit="degree">0.00</pitch>
+					<yaw unit="degree">0.00</yaw>
+				</orientation>
+				<offset>
+					<x unit="mm">1</x>
+					<y unit="mm">2</y>
+				</offset>
+				<beam_center>
+					<x unit="mm">322.64</x>
+					<y unit="mm">327.68</y>
+				</beam_center>
+				<pixel_size>
+					<x unit="mm">5.00</x>
+					<y unit="mm">5.00</y>
+				</pixel_size>
+			</SASdetector>
+		</SASinstrument>
+		<SASprocess>
+			<name>spol</name>
+			<date>04-Sep-2007 18:35:02</date>
+			<term name="radialstep" unit="mm">10.000</term>
+			<term name="sector_width" unit="degree">180.0</term>
+			<term name="sector_orient" unit="degree">0.0</term>
+			<term name="MASK_file">USER:MASK.COM</term>
+			<SASprocessnote>
+				AvA1 0.0000E+00 AsA2 1.0000E+00 XvA3 1.0526E+03 XsA4
+				5.2200E-02 XfA5 0.0000E+00
+			</SASprocessnote>
+			<SASprocessnote>
+				S... 13597 0 2.26E+02 2A 5mM 0%D2O Sbak 13594 0 1.13E+02
+				H2O Buffer
+			</SASprocessnote>
+			<SASprocessnote>V... 13552 3 1.00E+00 H2O5m</SASprocessnote>
+		</SASprocess>
+		<SASprocess>
+			<name>NCNR-IGOR</name>
+			<date>03-SEP-2006 11:42:47</date>
+			<description />
+			<term name="average_type">Circular</term>
+			<term name="SAM_file">SEP06064.SA3_AJJ_L205</term>
+			<term name="BKD_file">SEP06064.SA3_AJJ_L205</term>
+			<term name="EMP_file">SEP06064.SA3_AJJ_L205</term>
+			<term name="DIV_file">SEP06064.SA3_AJJ_L205</term>
+			<term name="MASK_file">SEP06064.SA3_AJJ_L205</term>
+			<term name="ABS:TSTAND">1</term>
+			<term name="ABS:DSTAND" unit="mm">1</term>
+			<term name="ABS:IZERO">230.09</term>
+			<term name="ABS:XSECT" unit="mm">1</term>
+			<SASprocessnote/>
+		</SASprocess>
+		<SASnote />
+	</SASentry>
+</SASroot>
Index: DataLoader/test/utest_abs_reader.py
===================================================================
--- DataLoader/test/utest_abs_reader.py	(revision 76e23691e12caa20c95e83c3161ff5e9ba24edb5)
+++ DataLoader/test/utest_abs_reader.py	(revision d00f8ff74790ad97d3fddff0a584009680fdda7d)
@@ -326,5 +326,31 @@
         
         
-        
+    def test_slits(self):
+        """
+            Check slit data
+        """
+        filename = "cansas1d_slit.xml"
+        self.data = Loader().load(filename)
+        self.assertEqual(self.data.filename, filename)
+        self.assertEqual(self.data.run[0], "1234")
+        
+        # Data
+        self.assertEqual(len(self.data.x), 2)
+        self.assertEqual(self.data.x_unit, '1/A')
+        self.assertEqual(self.data.y_unit, '1/cm')
+        self.assertEqual(self.data.x[0], 0.02)
+        self.assertEqual(self.data.y[0], 1000)
+        self.assertEqual(self.data.dxl[0], 0.005)
+        self.assertEqual(self.data.dxw[0], 0.001)
+        self.assertEqual(self.data.dy[0], 3)
+        self.assertEqual(self.data.x[1], 0.03)
+        self.assertAlmostEquals(self.data.y[1], 1001.0)
+        self.assertEqual(self.data.dx[1], 0.0)
+        self.assertEqual(self.data.dxl[1], 0.005)
+        self.assertEqual(self.data.dxw[1], 0.001)
+        self.assertEqual(self.data.dy[1], 4)
+        self.assertEqual(self.data.run_name['1234'], 'run name')
+        self.assertEqual(self.data.title, "Test title")
+
             
 
Index: DataLoader/test/utest_smearing.py
===================================================================
--- DataLoader/test/utest_smearing.py	(revision d00f8ff74790ad97d3fddff0a584009680fdda7d)
+++ DataLoader/test/utest_smearing.py	(revision d00f8ff74790ad97d3fddff0a584009680fdda7d)
@@ -0,0 +1,92 @@
+"""
+    Unit tests for data manipulations
+"""
+
+
+import unittest
+import numpy, math
+from DataLoader.loader import  Loader
+from DataLoader.data_info import Data1D, Data2D
+from DataLoader.qsmearing import SlitSmearer, QSmearer
+ 
+import os.path
+
+class smear_tests(unittest.TestCase):
+    
+    def setUp(self):
+        self.data = Loader().load("cansas1d_slit.xml")
+        
+        x = 0.001*numpy.arange(1,11)
+        y = 12.0-numpy.arange(1,11)
+        dxl = 0.00*numpy.ones(10)
+        dxw = 0.00*numpy.ones(10)
+        
+        self.data.x = x
+        self.data.y = y
+        self.data.dxl = dxl
+        self.data.dxw = dxw
+        
+    def test_slit(self):
+        """
+            Test identity smearing
+        """
+        # Create smearer for our data
+        s = SlitSmearer(self.data)
+        
+        input = 12.0-numpy.arange(1,11)
+        output = s(input)
+        for i in range(len(input)):
+            self.assertEquals(input[i], output[i])
+
+    def test_slit2(self):
+        """
+            Test basic smearing
+        """
+        dxl = 0.005*numpy.ones(10)
+        dxw = 0.0*numpy.ones(10)
+        self.data.dxl = dxl
+        self.data.dxw = dxw
+        # Create smearer for our data
+        s = SlitSmearer(self.data)
+        
+        input = 12.0-numpy.arange(1,11)
+        output = s(input)
+        answer = [ 9.666,  9.056,  8.329,  7.494,  6.642,  5.721,  4.774,  3.824,  2.871, 2.   ]
+        for i in range(len(input)):
+            self.assertAlmostEqual(answer[i], output[i], 5)
+        
+    def test_q(self):
+        """
+            Test identity resolution smearing
+        """
+        # Create smearer for our data
+        s = QSmearer(self.data)
+        
+        input = 12.0-numpy.arange(1,11)
+        output = s(input)
+        for i in range(len(input)):
+            self.assertEquals(input[i], output[i])
+
+    def test_q2(self):
+        """
+            Test basic smearing
+        """
+        dx = 0.001*numpy.ones(10)
+        self.data.dx = dx
+
+        # Create smearer for our data
+        s = QSmearer(self.data)
+        
+        input = 12.0-numpy.arange(1,11)
+        output = s(input)
+        
+        answer = [ 10.44785079,   9.84991299,   8.98101708,   
+                  7.99906585,   6.99998311,   6.00001689,
+                  5.00093415,   4.01898292,   3.15008701,   2.55214921]
+        for i in range(len(input)):
+            self.assertAlmostEqual(answer[i], output[i], 5)
+      
+
+if __name__ == '__main__':
+    unittest.main()
+   
