Index: sasview/test/sesans_data/sphere2micron.ses
===================================================================
--- sasview/test/sesans_data/sphere2micron.ses	(revision 2a2b43a784d2e1dc3f9304934bcb138df3aad058)
+++ sasview/test/sesans_data/sphere2micron.ses	(revision d3bce8cdfcb310b0a22dc27004c973b23447f354)
@@ -1,51 +1,60 @@
-DataFileTitle 	"Polystyrene of Markus Strobl,  Full Sine, ++ only "						
-Sample 	"Polystyrene 2 um in 53% H2O, 47% D2O "						
-Settings 	"D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast "						
-Operator 	CPD 						
-Date 	do 10 jul 2014 16:37:30 						
-ScanType 	sine one element scan 						
-Thickness [cm] 	2.00E-01						
-Q_zmax [\A^-1] 	0.05						
-Q_ymax [\A^-1] 	0.05						
-  							
-spin echo length [A] 	 Depolarisation [A-2 cm-1] 	 error depol [A-2 cm-1] 	 error SEL [A] 	 wavelength [A] 	 error wavelength [A] 	 polarisation 	 error pol 
-391.56	0.0041929	0.0036894	19.578	2.11	0.1055	1.0037	0.0032974
-1564	-0.0046571	0.0038185	78.2	2.11	0.1055	0.99586	0.003386
-2735.6	-0.017007	0.0038132	136.78	2.11	0.1055	0.98497	0.0033444
-3907.9	-0.033462	0.0035068	195.39	2.11	0.1055	0.97064	0.0030309
-5080.2	-0.047483	0.0038208	254.01	2.11	0.1055	0.9586	0.0032613
-6251.8	-0.070375	0.00376	312.59	2.11	0.1055	0.93926	0.0031446
-7423.2	-0.092217	0.0037927	371.16	2.11	0.1055	0.92117	0.0031108
-8595.5	-0.10238	0.004006	429.77	2.11	0.1055	0.91287	0.0032562
-9767.7	-0.12672	0.0038534	488.39	2.11	0.1055	0.8933	0.0030651
-10940	-0.1374	0.004243	546.98	2.11	0.1055	0.88484	0.003343
-12112	-0.16072	0.0045837	605.58	2.11	0.1055	0.86666	0.0035372
-13284	-0.16623	0.0045613	664.2	2.11	0.1055	0.86242	0.0035027
-14456	-0.18468	0.0044918	722.79	2.11	0.1055	0.84837	0.0033931
-15628	-0.19143	0.0048967	781.38	2.11	0.1055	0.84328	0.0036768
-16800	-0.20029	0.0045421	840.02	2.11	0.1055	0.83666	0.0033837
-17971	-0.19798	0.0046642	898.56	2.11	0.1055	0.83838	0.0034819
-19143	-0.21442	0.0047052	957.17	2.11	0.1055	0.82619	0.0034614
-20316	-0.20885	0.0044931	1015.8	2.11	0.1055	0.8303	0.0033218
-21488	-0.21393	0.0049186	1074.4	2.11	0.1055	0.82655	0.00362
-22660	-0.20685	0.004423	1133	2.11	0.1055	0.83179	0.0032758
-23832	-0.20802	0.0046979	1191.6	2.11	0.1055	0.83092	0.0034758
-25003	-0.19848	0.0045953	1250.2	2.11	0.1055	0.838	0.0034289
-26175	-0.21117	0.0044567	1308.8	2.11	0.1055	0.82859	0.0032881
-27347	-0.21283	0.004137	1367.4	2.11	0.1055	0.82736	0.0030477
-28520	-0.2042	0.0044587	1426	2.11	0.1055	0.83375	0.0033101
-29692	-0.2112	0.0042852	1484.6	2.11	0.1055	0.82857	0.0031615
-30864	-0.20319	0.0043483	1543.2	2.11	0.1055	0.8345	0.003231
-32036	-0.20752	0.0044297	1601.8	2.11	0.1055	0.83129	0.0032788
-33207	-0.20654	0.0043188	1660.4	2.11	0.1055	0.83201	0.0031995
-34380	-0.20126	0.0046375	1719	2.11	0.1055	0.83593	0.0034518
-35551	-0.20924	0.0042871	1777.6	2.11	0.1055	0.83001	0.0031684
-36724	-0.21323	0.0045471	1836.2	2.11	0.1055	0.82707	0.0033487
-37895	-0.21324	0.0045354	1894.7	2.11	0.1055	0.82706	0.00334
-39067	-0.19905	0.0044141	1953.4	2.11	0.1055	0.83758	0.003292
-40239	-0.1991	0.0047441	2012	2.11	0.1055	0.83754	0.003538
-41411	-0.20359	0.0050136	2070.5	2.11	0.1055	0.8342	0.003724
-42583	-0.21032	0.0049474	2129.1	2.11	0.1055	0.82922	0.0036529
-43755	-0.20689	0.0048203	2187.8	2.11	0.1055	0.83176	0.00357
-44927	-0.21075	0.0052337	2246.4	2.11	0.1055	0.8289	0.0038628
-46099	-0.19956	0.0047827	2304.9	2.11	0.1055	0.8372	0.0035653
+FileFormatVersion       1.0
+DataFileTitle           Polystyrene of Markus Strobl,  Full Sine, ++ only
+Sample                  Polystyrene 2 um in 53% H2O, 47% D2O
+Settings                D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast
+Operator                CPD
+Date                    do 10 jul 2014 16:37:30
+ScanType                sine one element scan
+Thickness               2.00E-01
+Thickness_unit          cm
+Theta_zmax              0.0168
+Theta_zmax_unit         radians
+Theta_ymax              0.0168
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error SpinEchoLength_error Wavelength Wavelength_error Polarisation  Polarisation_error
+391.56 0.0041929 0.0036894 19.578 2.11 0.1055 1.0037 0.0032974
+1564 -0.0046571 0.0038185 78.2 2.11 0.1055 0.99586 0.003386
+2735.6 -0.017007 0.0038132 136.78 2.11 0.1055 0.98497 0.0033444
+3907.9 -0.033462 0.0035068 195.39 2.11 0.1055 0.97064 0.0030309
+5080.2 -0.047483 0.0038208 254.01 2.11 0.1055 0.9586 0.0032613
+6251.8 -0.070375 0.00376 312.59 2.11 0.1055 0.93926 0.0031446
+7423.2 -0.092217 0.0037927 371.16 2.11 0.1055 0.92117 0.0031108
+8595.5 -0.10238 0.004006 429.77 2.11 0.1055 0.91287 0.0032562
+9767.7 -0.12672 0.0038534 488.39 2.11 0.1055 0.8933 0.0030651
+10940 -0.1374 0.004243 546.98 2.11 0.1055 0.88484 0.003343
+12112 -0.16072 0.0045837 605.58 2.11 0.1055 0.86666 0.0035372
+13284 -0.16623 0.0045613 664.2 2.11 0.1055 0.86242 0.0035027
+14456 -0.18468 0.0044918 722.79 2.11 0.1055 0.84837 0.0033931
+15628 -0.19143 0.0048967 781.38 2.11 0.1055 0.84328 0.0036768
+16800 -0.20029 0.0045421 840.02 2.11 0.1055 0.83666 0.0033837
+17971 -0.19798 0.0046642 898.56 2.11 0.1055 0.83838 0.0034819
+19143 -0.21442 0.0047052 957.17 2.11 0.1055 0.82619 0.0034614
+20316 -0.20885 0.0044931 1015.8 2.11 0.1055 0.8303 0.0033218
+21488 -0.21393 0.0049186 1074.4 2.11 0.1055 0.82655 0.00362
+22660 -0.20685 0.004423 1133 2.11 0.1055 0.83179 0.0032758
+23832 -0.20802 0.0046979 1191.6 2.11 0.1055 0.83092 0.0034758
+25003 -0.19848 0.0045953 1250.2 2.11 0.1055 0.838 0.0034289
+26175 -0.21117 0.0044567 1308.8 2.11 0.1055 0.82859 0.0032881
+27347 -0.21283 0.004137 1367.4 2.11 0.1055 0.82736 0.0030477
+28520 -0.2042 0.0044587 1426 2.11 0.1055 0.83375 0.0033101
+29692 -0.2112 0.0042852 1484.6 2.11 0.1055 0.82857 0.0031615
+30864 -0.20319 0.0043483 1543.2 2.11 0.1055 0.8345 0.003231
+32036 -0.20752 0.0044297 1601.8 2.11 0.1055 0.83129 0.0032788
+33207 -0.20654 0.0043188 1660.4 2.11 0.1055 0.83201 0.0031995
+34380 -0.20126 0.0046375 1719 2.11 0.1055 0.83593 0.0034518
+35551 -0.20924 0.0042871 1777.6 2.11 0.1055 0.83001 0.0031684
+36724 -0.21323 0.0045471 1836.2 2.11 0.1055 0.82707 0.0033487
+37895 -0.21324 0.0045354 1894.7 2.11 0.1055 0.82706 0.00334
+39067 -0.19905 0.0044141 1953.4 2.11 0.1055 0.83758 0.003292
+40239 -0.1991 0.0047441 2012 2.11 0.1055 0.83754 0.003538
+41411 -0.20359 0.0050136 2070.5 2.11 0.1055 0.8342 0.003724
+42583 -0.21032 0.0049474 2129.1 2.11 0.1055 0.82922 0.0036529
+43755 -0.20689 0.0048203 2187.8 2.11 0.1055 0.83176 0.00357
+44927 -0.21075 0.0052337 2246.4 2.11 0.1055 0.8289 0.0038628
+46099 -0.19956 0.0047827 2304.9 2.11 0.1055 0.8372 0.0035653
Index: sasview/test/sesans_data/sphere_isis.ses
===================================================================
--- sasview/test/sesans_data/sphere_isis.ses	(revision 4c7aa9c5dc597695eb68eabef30cf2d2f720a6af)
+++ sasview/test/sesans_data/sphere_isis.ses	(revision 4c7aa9c5dc597695eb68eabef30cf2d2f720a6af)
@@ -0,0 +1,73 @@
+FileFormatVersion       1.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error Wavelength
+260.0 -1.42E-3 2.04E-3 1.612452
+280.8 -1.45E-3 1.87E-3 1.675709
+303.264 -1.64E-3 1.23E-3 1.741448
+327.525 -1.69E-3 1.17E-3 1.809765
+353.727 -2.23E-3 9.09E-4 1.880763
+382.025 -2.26E-3 8.58E-4 1.954546
+412.587 -2.41E-3 7.29E-4 2.031224
+445.594 -2.58E-3 6.75E-4 2.11091
+481.242 -2.88E-3 6.04E-4 2.193723
+519.741 -3.35E-3 5.56E-4 2.279783
+561.32 -3.60E-3 5.22E-4 2.369219
+606.226 -3.92E-3 4.91E-4 2.462166
+654.724 -4.36E-3 4.73E-4 2.558758
+707.102 -4.67E-3 4.54E-4 2.659139
+763.67 -4.91E-3 4.22E-4 2.763458
+824.764 -5.32E-3 3.88E-4 2.87187
+890.745 -5.43E-3 3.53E-4 2.984535
+962.005 -5.61E-3 3.28E-4 3.101621
+1038.97 -5.83E-3 3.07E-4 3.223306
+1122.08 -5.88E-3 2.91E-4 3.349746
+1211.85 -5.91E-3 2.73E-4 3.481164
+1308.8 -5.71E-3 2.61E-4 3.617734
+1413.5 -5.40E-3 2.49E-4 3.759654
+1526.58 -5.10E-3 2.41E-4 3.907147
+1648.71 -4.77E-3 2.34E-4 4.060431
+1780.6 -4.34E-3 2.26E-4 4.219716
+1923.05 -4.18E-3 2.20E-4 4.385259
+2076.9 -4.08E-3 2.16E-4 4.557302
+2243.05 -4.37E-3 2.13E-4 4.736085
+2422.49 -4.66E-3 2.10E-4 4.92188
+2616.29 -4.96E-3 2.06E-4 5.114968
+2825.59 -5.04E-3 2.03E-4 5.315628
+3051.64 -4.96E-3 1.99E-4 5.524165
+3295.77 -4.72E-3 1.97E-4 5.74088
+3559.43 -4.52E-3 1.92E-4 5.966096
+3844.19 -4.65E-3 1.93E-4 6.200153
+4151.72 -4.74E-3 1.96E-4 6.443384
+4483.86 -4.87E-3 1.99E-4 6.696163
+4842.57 -4.81E-3 2.05E-4 6.958858
+5229.98 -4.57E-3 2.09E-4 7.23186
+5648.38 -4.72E-3 2.17E-4 7.515571
+6100.25 -4.79E-3 2.23E-4 7.81041
+6588.27 -4.68E-3 2.28E-4 8.116816
+7115.33 -4.61E-3 2.32E-4 8.435242
+7684.55 -4.78E-3 2.46E-4 8.766157
+8299.32 -4.74E-3 2.46E-4 9.11006
+8963.26 -4.56E-3 2.50E-4 9.467449
+9680.32 -4.70E-3 2.58E-4 9.838862
+10454.7 -4.81E-3 2.64E-4 10.224823
+11291.1 -4.65E-3 2.69E-4 10.625959
+12194.4 -4.43E-3 2.79E-4 11.042826
+13170.0 -4.55E-3 3.01E-4 11.476062
+14223.6 -4.35E-3 3.20E-4 11.926274
+15361.5 -4.24E-3 3.51E-4 12.394152
+16590.4 -4.68E-3 4.12E-4 12.880373
+17917.6 -4.96E-3 4.98E-4 13.385664
+19303.4 -4.56E-3 5.98E-4 13.893668
Index: src/sas/sascalc/data_util/nxsunit.py
===================================================================
--- src/sas/sascalc/data_util/nxsunit.py	(revision b699768550de9d4b35b087234ec1d2a461922bab)
+++ src/sas/sascalc/data_util/nxsunit.py	(revision 8e9536f96bb3931f62eeba158ab01e1a3a25ded7)
@@ -136,5 +136,5 @@
     sld = { '10^-6 Angstrom^-2': 1e-6, 'Angstrom^-2': 1 }
     Q = { 'invA': 1, 'invAng': 1, 'invAngstroms': 1, '1/A': 1, 
-          '10^-3 Angstrom^-1': 1e-3, '1/cm': 1e-8,
+          '10^-3 Angstrom^-1': 1e-3, '1/cm': 1e-8, '1/m': 1e-10,
           'nm^-1': 0.1, '1/nm': 0.1, 'n_m^-1': 0.1 }
 
@@ -195,4 +195,5 @@
     _check(1,Converter('n_m^-1')(10,'invA')) # 10 nm^-1 = 1 inv Angstroms
     _check(2,Converter('mm')(2000,'m')) # 2000 mm -> 2 m
+    _check(2.011e10,Converter('1/A')(2.011,"1/m")) # 2.011 1/A -> 2.011 * 10^10 1/m
     _check(0.003,Converter('microseconds')(3,units='ms')) # 3 us -> 0.003 ms
     _check(45,Converter('nanokelvin')(45))  # 45 nK -> 45 nK
Index: src/sas/sascalc/data_util/qsmearing.py
===================================================================
--- src/sas/sascalc/data_util/qsmearing.py	(revision 235f514ba93b57fa63e44309f182acef0b98bb55)
+++ src/sas/sascalc/data_util/qsmearing.py	(revision 235f514ba93b57fa63e44309f182acef0b98bb55)
@@ -65,11 +65,16 @@
             raise ValueError('one or more of your dx values are negative, please check the data file!')
 
-    if _found_sesans == True:
-        #Pre-compute the Hankel matrix (H)
-        qmax, qunits = data.sample.zacceptance
+    if _found_sesans:
+        # Pre-compute the Hankel matrix (H)
         SElength = Converter(data._xunit)(data.x, "A")
-        zaccept = Converter(qunits)(qmax, "1/A"),
+
+        theta_max = Converter("radians")(data.sample.zacceptance)[0]
+        q_max = 2 * np.pi / np.max(data.source.wavelength) * np.sin(theta_max)
+        zaccept = Converter("1/A")(q_max, "1/" + data.source.wavelength_unit),
+
         Rmax = 10000000
-        hankel = SesansTransform(data.x, SElength, zaccept, Rmax)
+        hankel = SesansTransform(data.x, SElength,
+                                 data.source.wavelength,
+                                 zaccept, Rmax)
         # Then return the actual transform, as if it were a smearing function
         return PySmear(hankel, model, offset=0)
Index: src/sas/sascalc/dataloader/readers/sesans_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/sesans_reader.py	(revision 9a5097cd1c76689d1f997b85ba43d12a95d8f243)
+++ src/sas/sascalc/dataloader/readers/sesans_reader.py	(revision 149b8f6ae6f5b93d9c049a412d9e910393b92ed4)
@@ -1,8 +1,8 @@
 """
     SESANS reader (based on ASCII reader)
-    
+
     Reader for .ses or .sesans file format
-    
-    Jurrian Bakker 
+
+    Jurrian Bakker
 """
 import numpy as np
@@ -18,31 +18,29 @@
 _ZERO = 1e-16
 
+
 class Reader:
     """
     Class to load sesans files (6 columns).
     """
-    ## File type
+    # File type
     type_name = "SESANS"
-    
-    ## Wildcards
+
+    # Wildcards
     type = ["SESANS files (*.ses)|*.ses",
             "SESANS files (*..sesans)|*.sesans"]
-    ## List of allowed extensions
+    # List of allowed extensions
     ext = ['.ses', '.SES', '.sesans', '.SESANS']
-    
-    ## Flag to bypass extension check
+
+    # Flag to bypass extension check
     allow_all = True
-    
+
     def read(self, path):
-        
-#        print "reader triggered"
-        
         """
         Load data file
-        
+
         :param path: file path
-        
+
         :return: SESANSData1D object, or None
-        
+
         :raise RuntimeError: when the file can't be opened
         :raise ValueError: when the length of the data vectors are inconsistent
@@ -51,124 +49,131 @@
             basename = os.path.basename(path)
             _, extension = os.path.splitext(basename)
-            if self.allow_all or extension.lower() in self.ext:
-                try:
-                    # Read in binary mode since GRASP frequently has no-ascii
-                    # characters that brakes the open operation
-                    input_f = open(path,'rb')
-                except:
-                    raise  RuntimeError, "sesans_reader: cannot open %s" % path
-                buff = input_f.read()
-                lines = buff.splitlines()
-                x  = np.zeros(0)
-                y  = np.zeros(0)
-                dy = np.zeros(0)
-                lam  = np.zeros(0)
-                dlam = np.zeros(0)
-                dx = np.zeros(0)
-                
-               #temp. space to sort data
-                tx  = np.zeros(0)
-                ty  = np.zeros(0)
-                tdy = np.zeros(0)
-                tlam  = np.zeros(0)
-                tdlam = np.zeros(0)
-                tdx = np.zeros(0)
-                output = Data1D(x=x, y=y, lam=lam, dy=dy, dx=dx, dlam=dlam, isSesans=True)
-                self.filename = output.filename = basename
+            if not (self.allow_all or extension.lower() in self.ext):
+                raise RuntimeError(
+                    "{} has an unrecognized file extension".format(path))
+        else:
+            raise RuntimeError("{} is not a file".format(path))
+        with open(path, 'r') as input_f:
+            line = input_f.readline()
+            params = {}
+            while not line.startswith("BEGIN_DATA"):
+                terms = line.split()
+                if len(terms) >= 2:
+                    params[terms[0]] = " ".join(terms[1:])
+                line = input_f.readline()
+            self.params = params
 
-                paramnames=[]
-                paramvals=[]
-                zvals=[]
-                dzvals=[]
-                lamvals=[]
-                dlamvals=[]
-                Pvals=[]
-                dPvals=[]
+            if "FileFormatVersion" not in self.params:
+                raise RuntimeError("SES file missing FileFormatVersion")
+            if float(self.params["FileFormatVersion"]) >= 2.0:
+                raise RuntimeError("SASView only supports SES version 1")
 
-                for line in lines:
-                    # Initial try for CSV (split on ,)
-                    line=line.strip()
-                    toks = line.split('\t')
-                    if len(toks)==2:
-                        paramnames.append(toks[0])
-                        paramvals.append(toks[1])
-                    if len(toks)>5:
-                        zvals.append(toks[0])
-                        dzvals.append(toks[3])
-                        lamvals.append(toks[4])
-                        dlamvals.append(toks[5])
-                        Pvals.append(toks[1])
-                        dPvals.append(toks[2])
-                    else:
-                        continue
+            if "SpinEchoLength_unit" not in self.params:
+                raise RuntimeError("SpinEchoLength has no units")
+            if "Wavelength_unit" not in self.params:
+                raise RuntimeError("Wavelength has no units")
+            if params["SpinEchoLength_unit"] != params["Wavelength_unit"]:
+                raise RuntimeError("The spin echo data has rudely used "
+                                   "different units for the spin echo length "
+                                   "and the wavelength.  While sasview could "
+                                   "handle this instance, it is a violation "
+                                   "of the file format and will not be "
+                                   "handled by other software.")
 
-                x=[]
-                y=[]
-                lam=[]
-                dx=[]
-                dy=[]
-                dlam=[]
-                lam_header = lamvals[0].split()
-                data_conv_z = None
-                default_z_unit = "A"
-                data_conv_P = None
-                default_p_unit = " " # Adjust unit for axis (L^-3)
-                lam_unit = lam_header[1].replace("[","").replace("]","")
-                if lam_unit == 'AA':
-                    lam_unit = 'A'
-                varheader=[zvals[0],dzvals[0],lamvals[0],dlamvals[0],Pvals[0],dPvals[0]]
-                valrange=range(1, len(zvals))
-                for i in valrange:
-                    x.append(float(zvals[i]))
-                    y.append(float(Pvals[i]))
-                    lam.append(float(lamvals[i]))
-                    dy.append(float(dPvals[i]))
-                    dx.append(float(dzvals[i]))
-                    dlam.append(float(dlamvals[i]))
+            headers = input_f.readline().split()
 
-                x,y,lam,dy,dx,dlam = [
-                    np.asarray(v, 'double')
-                   for v in (x,y,lam,dy,dx,dlam)
-                ]
+            self._insist_header(headers, "SpinEchoLength")
+            self._insist_header(headers, "Depolarisation")
+            self._insist_header(headers, "Depolarisation_error")
+            self._insist_header(headers, "Wavelength")
 
-                input_f.close()
+            data = np.loadtxt(input_f)
 
-                output.x, output.x_unit = self._unit_conversion(x, lam_unit, default_z_unit)
-                output.y = y
-                output.y_unit = r'\AA^{-2} cm^{-1}'  # output y_unit added
-                output.dx, output.dx_unit = self._unit_conversion(dx, lam_unit, default_z_unit)
-                output.dy = dy
-                output.lam, output.lam_unit = self._unit_conversion(lam, lam_unit, default_z_unit)
-                output.dlam, output.dlam_unit = self._unit_conversion(dlam, lam_unit, default_z_unit)
-                
-                output.xaxis(r"\rm{z}", output.x_unit)
-                output.yaxis(r"\rm{ln(P)/(t \lambda^2)}", output.y_unit)  # Adjust label to ln P/(lam^2 t), remove lam column refs
+            if data.shape[1] != len(headers):
+                raise RuntimeError(
+                    "File has {} headers, but {} columns".format(
+                        len(headers),
+                        data.shape[1]))
 
-                # Store loading process information
-                output.meta_data['loader'] = self.type_name
-                #output.sample.thickness = float(paramvals[6])
-                output.sample.name = paramvals[1]
-                output.sample.ID = paramvals[0]
-                zaccept_unit_split = paramnames[7].split("[")
-                zaccept_unit = zaccept_unit_split[1].replace("]","")
-                if zaccept_unit.strip() == r'\AA^-1' or zaccept_unit.strip() == r'\A^-1':
-                    zaccept_unit = "1/A"
-                output.sample.zacceptance=(float(paramvals[7]),zaccept_unit)
-                output.vars = varheader
+            if not data.size:
+                raise RuntimeError("{} is empty".format(path))
+            x = data[:, headers.index("SpinEchoLength")]
+            if "SpinEchoLength_error" in headers:
+                dx = data[:, headers.index("SpinEchoLength_error")]
+            else:
+                dx = x * 0.05
+            lam = data[:, headers.index("Wavelength")]
+            if "Wavelength_error" in headers:
+                dlam = data[:, headers.index("Wavelength_error")]
+            else:
+                dlam = lam * 0.05
+            y = data[:, headers.index("Depolarisation")]
+            dy = data[:, headers.index("Depolarisation_error")]
 
-                if len(output.x) < 1:
-                    raise RuntimeError, "%s is empty" % path
-                return output
+            lam_unit = self._unit_fetch("Wavelength")
+            x, x_unit = self._unit_conversion(x, "A",
+                                              self._unit_fetch(
+                                                  "SpinEchoLength"))
+            dx, dx_unit = self._unit_conversion(
+                dx, lam_unit,
+                self._unit_fetch("SpinEchoLength"))
+            dlam, dlam_unit = self._unit_conversion(
+                dlam, lam_unit,
+                self._unit_fetch("Wavelength"))
+            y_unit = self._unit_fetch("Depolarisation")
 
-        else:
-            raise RuntimeError, "%s is not a file" % path
-        return None
+            output = Data1D(x=x, y=y, lam=lam, dy=dy, dx=dx, dlam=dlam,
+                            isSesans=True)
 
-    def _unit_conversion(self, value, value_unit, default_unit):
-        if has_converter == True and value_unit != default_unit:
-            data_conv_q = Converter(value_unit)
-            value = data_conv_q(value, units=default_unit)
+            output.y_unit = y_unit
+            output.x_unit = x_unit
+            output.source.wavelength_unit = lam_unit
+            output.source.wavelength = lam
+            self.filename = output.filename = basename
+            output.xaxis(r"\rm{z}", x_unit)
+            # Adjust label to ln P/(lam^2 t), remove lam column refs
+            output.yaxis(r"\rm{ln(P)/(t \lambda^2)}", y_unit)
+            # Store loading process information
+            output.meta_data['loader'] = self.type_name
+            output.sample.name = params["Sample"]
+            output.sample.ID = params["DataFileTitle"]
+            output.sample.thickness = self._unit_conversion(
+                float(params["Thickness"]), "cm",
+                self._unit_fetch("Thickness"))[0]
+
+            output.sample.zacceptance = (
+                float(params["Theta_zmax"]),
+                self._unit_fetch("Theta_zmax"))
+
+            output.sample.yacceptance = (
+                float(params["Theta_ymax"]),
+                self._unit_fetch("Theta_ymax"))
+            return output
+
+    @staticmethod
+    def _insist_header(headers, name):
+        if name not in headers:
+            raise RuntimeError(
+                "Missing {} column in spin echo data".format(name))
+
+    @staticmethod
+    def _unit_conversion(value, value_unit, default_unit):
+        """
+        Performs unit conversion on a measurement.
+
+        :param value: The magnitude of the measurement
+        :param value_unit: a string containing the final desired unit
+        :param default_unit: string with the units of the original measurement
+        :return: The magnitude of the measurement in the new units
+        """
+        # (float, string, string) -> float
+        if has_converter and value_unit != default_unit:
+            data_conv_q = Converter(default_unit)
+            value = data_conv_q(value, units=value_unit)
             new_unit = default_unit
         else:
             new_unit = value_unit
         return value, new_unit
+
+    def _unit_fetch(self, unit):
+        return self.params[unit+"_unit"]
Index: src/sas/sasgui/perspectives/fitting/models.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/models.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sasgui/perspectives/fitting/models.py	(revision 56a282cafe4912b6aaa6e88b2b92225eb5a897fa)
@@ -163,25 +163,25 @@
 
 
-def _findModels(dir):
+def _find_models():
     """
     Find custom models
     """
     # List of plugin objects
-    dir = find_plugins_dir()
+    directory = find_plugins_dir()
     # Go through files in plug-in directory
-    if not os.path.isdir(dir):
-        msg = "SasView couldn't locate Model plugin folder %r." % dir
+    if not os.path.isdir(directory):
+        msg = "SasView couldn't locate Model plugin folder %r." % directory
         logger.warning(msg)
         return {}
 
-    plugin_log("looking for models in: %s" % str(dir))
-    #compile_file(dir)  #always recompile the folder plugin
-    logger.info("plugin model dir: %s" % str(dir))
+    plugin_log("looking for models in: %s" % str(directory))
+    # compile_file(directory)  #always recompile the folder plugin
+    logger.info("plugin model dir: %s" % str(directory))
 
     plugins = {}
-    for filename in os.listdir(dir):
+    for filename in os.listdir(directory):
         name, ext = os.path.splitext(filename)
         if ext == '.py' and not name == '__init__':
-            path = os.path.abspath(os.path.join(dir, filename))
+            path = os.path.abspath(os.path.join(directory, filename))
             try:
                 model = load_custom_model(path)
@@ -193,6 +193,6 @@
                 plugin_log(msg)
                 logger.warning("Failed to load plugin %r. See %s for details"
-                                % (path, PLUGIN_LOG))
-            
+                               % (path, PLUGIN_LOG))
+
     return plugins
 
@@ -264,5 +264,5 @@
         temp = {}
         if self.is_changed():
-            return  _findModels(dir)
+            return  _find_models()
         logger.info("plugin model : %s" % str(temp))
         return temp
@@ -339,5 +339,5 @@
         """
         self.plugins = []
-        new_plugins = _findModels(dir)
+        new_plugins = _find_models()
         for name, plug in  new_plugins.iteritems():
             for stored_name, stored_plug in self.stored_plugins.iteritems():
Index: test/sasdataloader/test/sesans_examples/next_gen.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/next_gen.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
+++ test/sasdataloader/test/sesans_examples/next_gen.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
@@ -0,0 +1,73 @@
+FileFormatVersion       2.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error Wavelength
+260.0 -1.42E-3 2.04E-3 1.612452
+280.8 -1.45E-3 1.87E-3 1.675709
+303.264 -1.64E-3 1.23E-3 1.741448
+327.525 -1.69E-3 1.17E-3 1.809765
+353.727 -2.23E-3 9.09E-4 1.880763
+382.025 -2.26E-3 8.58E-4 1.954546
+412.587 -2.41E-3 7.29E-4 2.031224
+445.594 -2.58E-3 6.75E-4 2.11091
+481.242 -2.88E-3 6.04E-4 2.193723
+519.741 -3.35E-3 5.56E-4 2.279783
+561.32 -3.60E-3 5.22E-4 2.369219
+606.226 -3.92E-3 4.91E-4 2.462166
+654.724 -4.36E-3 4.73E-4 2.558758
+707.102 -4.67E-3 4.54E-4 2.659139
+763.67 -4.91E-3 4.22E-4 2.763458
+824.764 -5.32E-3 3.88E-4 2.87187
+890.745 -5.43E-3 3.53E-4 2.984535
+962.005 -5.61E-3 3.28E-4 3.101621
+1038.97 -5.83E-3 3.07E-4 3.223306
+1122.08 -5.88E-3 2.91E-4 3.349746
+1211.85 -5.91E-3 2.73E-4 3.481164
+1308.8 -5.71E-3 2.61E-4 3.617734
+1413.5 -5.40E-3 2.49E-4 3.759654
+1526.58 -5.10E-3 2.41E-4 3.907147
+1648.71 -4.77E-3 2.34E-4 4.060431
+1780.6 -4.34E-3 2.26E-4 4.219716
+1923.05 -4.18E-3 2.20E-4 4.385259
+2076.9 -4.08E-3 2.16E-4 4.557302
+2243.05 -4.37E-3 2.13E-4 4.736085
+2422.49 -4.66E-3 2.10E-4 4.92188
+2616.29 -4.96E-3 2.06E-4 5.114968
+2825.59 -5.04E-3 2.03E-4 5.315628
+3051.64 -4.96E-3 1.99E-4 5.524165
+3295.77 -4.72E-3 1.97E-4 5.74088
+3559.43 -4.52E-3 1.92E-4 5.966096
+3844.19 -4.65E-3 1.93E-4 6.200153
+4151.72 -4.74E-3 1.96E-4 6.443384
+4483.86 -4.87E-3 1.99E-4 6.696163
+4842.57 -4.81E-3 2.05E-4 6.958858
+5229.98 -4.57E-3 2.09E-4 7.23186
+5648.38 -4.72E-3 2.17E-4 7.515571
+6100.25 -4.79E-3 2.23E-4 7.81041
+6588.27 -4.68E-3 2.28E-4 8.116816
+7115.33 -4.61E-3 2.32E-4 8.435242
+7684.55 -4.78E-3 2.46E-4 8.766157
+8299.32 -4.74E-3 2.46E-4 9.11006
+8963.26 -4.56E-3 2.50E-4 9.467449
+9680.32 -4.70E-3 2.58E-4 9.838862
+10454.7 -4.81E-3 2.64E-4 10.224823
+11291.1 -4.65E-3 2.69E-4 10.625959
+12194.4 -4.43E-3 2.79E-4 11.042826
+13170.0 -4.55E-3 3.01E-4 11.476062
+14223.6 -4.35E-3 3.20E-4 11.926274
+15361.5 -4.24E-3 3.51E-4 12.394152
+16590.4 -4.68E-3 4.12E-4 12.880373
+17917.6 -4.96E-3 4.98E-4 13.385664
+19303.4 -4.56E-3 5.98E-4 13.893668
Index: test/sasdataloader/test/sesans_examples/no_spin_echo_unit.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/no_spin_echo_unit.ses	(revision 4b5f2657b41cc1e27f305d7bfdbd0adea9eb8ef3)
+++ test/sasdataloader/test/sesans_examples/no_spin_echo_unit.ses	(revision 4b5f2657b41cc1e27f305d7bfdbd0adea9eb8ef3)
@@ -0,0 +1,72 @@
+FileFormatVersion       1.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error Wavelength
+260.0 -1.42E-3 2.04E-3 1.612452
+280.8 -1.45E-3 1.87E-3 1.675709
+303.264 -1.64E-3 1.23E-3 1.741448
+327.525 -1.69E-3 1.17E-3 1.809765
+353.727 -2.23E-3 9.09E-4 1.880763
+382.025 -2.26E-3 8.58E-4 1.954546
+412.587 -2.41E-3 7.29E-4 2.031224
+445.594 -2.58E-3 6.75E-4 2.11091
+481.242 -2.88E-3 6.04E-4 2.193723
+519.741 -3.35E-3 5.56E-4 2.279783
+561.32 -3.60E-3 5.22E-4 2.369219
+606.226 -3.92E-3 4.91E-4 2.462166
+654.724 -4.36E-3 4.73E-4 2.558758
+707.102 -4.67E-3 4.54E-4 2.659139
+763.67 -4.91E-3 4.22E-4 2.763458
+824.764 -5.32E-3 3.88E-4 2.87187
+890.745 -5.43E-3 3.53E-4 2.984535
+962.005 -5.61E-3 3.28E-4 3.101621
+1038.97 -5.83E-3 3.07E-4 3.223306
+1122.08 -5.88E-3 2.91E-4 3.349746
+1211.85 -5.91E-3 2.73E-4 3.481164
+1308.8 -5.71E-3 2.61E-4 3.617734
+1413.5 -5.40E-3 2.49E-4 3.759654
+1526.58 -5.10E-3 2.41E-4 3.907147
+1648.71 -4.77E-3 2.34E-4 4.060431
+1780.6 -4.34E-3 2.26E-4 4.219716
+1923.05 -4.18E-3 2.20E-4 4.385259
+2076.9 -4.08E-3 2.16E-4 4.557302
+2243.05 -4.37E-3 2.13E-4 4.736085
+2422.49 -4.66E-3 2.10E-4 4.92188
+2616.29 -4.96E-3 2.06E-4 5.114968
+2825.59 -5.04E-3 2.03E-4 5.315628
+3051.64 -4.96E-3 1.99E-4 5.524165
+3295.77 -4.72E-3 1.97E-4 5.74088
+3559.43 -4.52E-3 1.92E-4 5.966096
+3844.19 -4.65E-3 1.93E-4 6.200153
+4151.72 -4.74E-3 1.96E-4 6.443384
+4483.86 -4.87E-3 1.99E-4 6.696163
+4842.57 -4.81E-3 2.05E-4 6.958858
+5229.98 -4.57E-3 2.09E-4 7.23186
+5648.38 -4.72E-3 2.17E-4 7.515571
+6100.25 -4.79E-3 2.23E-4 7.81041
+6588.27 -4.68E-3 2.28E-4 8.116816
+7115.33 -4.61E-3 2.32E-4 8.435242
+7684.55 -4.78E-3 2.46E-4 8.766157
+8299.32 -4.74E-3 2.46E-4 9.11006
+8963.26 -4.56E-3 2.50E-4 9.467449
+9680.32 -4.70E-3 2.58E-4 9.838862
+10454.7 -4.81E-3 2.64E-4 10.224823
+11291.1 -4.65E-3 2.69E-4 10.625959
+12194.4 -4.43E-3 2.79E-4 11.042826
+13170.0 -4.55E-3 3.01E-4 11.476062
+14223.6 -4.35E-3 3.20E-4 11.926274
+15361.5 -4.24E-3 3.51E-4 12.394152
+16590.4 -4.68E-3 4.12E-4 12.880373
+17917.6 -4.96E-3 4.98E-4 13.385664
+19303.4 -4.56E-3 5.98E-4 13.893668
Index: test/sasdataloader/test/sesans_examples/no_wavelength.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/no_wavelength.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
+++ test/sasdataloader/test/sesans_examples/no_wavelength.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
@@ -0,0 +1,73 @@
+FileFormatVersion       1.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error 
+260.0 -1.42E-3 2.04E-3 1.612452
+280.8 -1.45E-3 1.87E-3 1.675709
+303.264 -1.64E-3 1.23E-3 1.741448
+327.525 -1.69E-3 1.17E-3 1.809765
+353.727 -2.23E-3 9.09E-4 1.880763
+382.025 -2.26E-3 8.58E-4 1.954546
+412.587 -2.41E-3 7.29E-4 2.031224
+445.594 -2.58E-3 6.75E-4 2.11091
+481.242 -2.88E-3 6.04E-4 2.193723
+519.741 -3.35E-3 5.56E-4 2.279783
+561.32 -3.60E-3 5.22E-4 2.369219
+606.226 -3.92E-3 4.91E-4 2.462166
+654.724 -4.36E-3 4.73E-4 2.558758
+707.102 -4.67E-3 4.54E-4 2.659139
+763.67 -4.91E-3 4.22E-4 2.763458
+824.764 -5.32E-3 3.88E-4 2.87187
+890.745 -5.43E-3 3.53E-4 2.984535
+962.005 -5.61E-3 3.28E-4 3.101621
+1038.97 -5.83E-3 3.07E-4 3.223306
+1122.08 -5.88E-3 2.91E-4 3.349746
+1211.85 -5.91E-3 2.73E-4 3.481164
+1308.8 -5.71E-3 2.61E-4 3.617734
+1413.5 -5.40E-3 2.49E-4 3.759654
+1526.58 -5.10E-3 2.41E-4 3.907147
+1648.71 -4.77E-3 2.34E-4 4.060431
+1780.6 -4.34E-3 2.26E-4 4.219716
+1923.05 -4.18E-3 2.20E-4 4.385259
+2076.9 -4.08E-3 2.16E-4 4.557302
+2243.05 -4.37E-3 2.13E-4 4.736085
+2422.49 -4.66E-3 2.10E-4 4.92188
+2616.29 -4.96E-3 2.06E-4 5.114968
+2825.59 -5.04E-3 2.03E-4 5.315628
+3051.64 -4.96E-3 1.99E-4 5.524165
+3295.77 -4.72E-3 1.97E-4 5.74088
+3559.43 -4.52E-3 1.92E-4 5.966096
+3844.19 -4.65E-3 1.93E-4 6.200153
+4151.72 -4.74E-3 1.96E-4 6.443384
+4483.86 -4.87E-3 1.99E-4 6.696163
+4842.57 -4.81E-3 2.05E-4 6.958858
+5229.98 -4.57E-3 2.09E-4 7.23186
+5648.38 -4.72E-3 2.17E-4 7.515571
+6100.25 -4.79E-3 2.23E-4 7.81041
+6588.27 -4.68E-3 2.28E-4 8.116816
+7115.33 -4.61E-3 2.32E-4 8.435242
+7684.55 -4.78E-3 2.46E-4 8.766157
+8299.32 -4.74E-3 2.46E-4 9.11006
+8963.26 -4.56E-3 2.50E-4 9.467449
+9680.32 -4.70E-3 2.58E-4 9.838862
+10454.7 -4.81E-3 2.64E-4 10.224823
+11291.1 -4.65E-3 2.69E-4 10.625959
+12194.4 -4.43E-3 2.79E-4 11.042826
+13170.0 -4.55E-3 3.01E-4 11.476062
+14223.6 -4.35E-3 3.20E-4 11.926274
+15361.5 -4.24E-3 3.51E-4 12.394152
+16590.4 -4.68E-3 4.12E-4 12.880373
+17917.6 -4.96E-3 4.98E-4 13.385664
+19303.4 -4.56E-3 5.98E-4 13.893668
Index: test/sasdataloader/test/sesans_examples/sesans_no_data.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/sesans_no_data.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
+++ test/sasdataloader/test/sesans_examples/sesans_no_data.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
@@ -0,0 +1,15 @@
+FileFormatVersion       1.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
Index: test/sasdataloader/test/sesans_examples/sphere2micron.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/sphere2micron.ses	(revision aa45dcd4d087761023bf24929e86bcaca8507d23)
+++ test/sasdataloader/test/sesans_examples/sphere2micron.ses	(revision aa45dcd4d087761023bf24929e86bcaca8507d23)
@@ -0,0 +1,60 @@
+FileFormatVersion       1.0
+DataFileTitle           Polystyrene of Markus Strobl,  Full Sine, ++ only
+Sample                  Polystyrene 2 um in 53% H2O, 47% D2O
+Settings                D1=D2=20x8 mm,Ds = 16x10 mm (WxH), GF1 =scanning, GF2 = 2.5 A. 2 um polystyrene in 53% H2O, 47% D2O; 8.55% contrast
+Operator                CPD
+Date                    do 10 jul 2014 16:37:30
+ScanType                sine one element scan
+Thickness               2.00E-01
+Thickness_unit          cm
+Theta_zmax              0.0168
+Theta_zmax_unit         radians
+Theta_ymax              0.0168
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error SpinEchoLength_error Wavelength Wavelength_error Polarisation  Polarisation_error
+391.56 0.0041929 0.0036894 19.578 2.11 0.1055 1.0037 0.0032974
+1564 -0.0046571 0.0038185 78.2 2.11 0.1055 0.99586 0.003386
+2735.6 -0.017007 0.0038132 136.78 2.11 0.1055 0.98497 0.0033444
+3907.9 -0.033462 0.0035068 195.39 2.11 0.1055 0.97064 0.0030309
+5080.2 -0.047483 0.0038208 254.01 2.11 0.1055 0.9586 0.0032613
+6251.8 -0.070375 0.00376 312.59 2.11 0.1055 0.93926 0.0031446
+7423.2 -0.092217 0.0037927 371.16 2.11 0.1055 0.92117 0.0031108
+8595.5 -0.10238 0.004006 429.77 2.11 0.1055 0.91287 0.0032562
+9767.7 -0.12672 0.0038534 488.39 2.11 0.1055 0.8933 0.0030651
+10940 -0.1374 0.004243 546.98 2.11 0.1055 0.88484 0.003343
+12112 -0.16072 0.0045837 605.58 2.11 0.1055 0.86666 0.0035372
+13284 -0.16623 0.0045613 664.2 2.11 0.1055 0.86242 0.0035027
+14456 -0.18468 0.0044918 722.79 2.11 0.1055 0.84837 0.0033931
+15628 -0.19143 0.0048967 781.38 2.11 0.1055 0.84328 0.0036768
+16800 -0.20029 0.0045421 840.02 2.11 0.1055 0.83666 0.0033837
+17971 -0.19798 0.0046642 898.56 2.11 0.1055 0.83838 0.0034819
+19143 -0.21442 0.0047052 957.17 2.11 0.1055 0.82619 0.0034614
+20316 -0.20885 0.0044931 1015.8 2.11 0.1055 0.8303 0.0033218
+21488 -0.21393 0.0049186 1074.4 2.11 0.1055 0.82655 0.00362
+22660 -0.20685 0.004423 1133 2.11 0.1055 0.83179 0.0032758
+23832 -0.20802 0.0046979 1191.6 2.11 0.1055 0.83092 0.0034758
+25003 -0.19848 0.0045953 1250.2 2.11 0.1055 0.838 0.0034289
+26175 -0.21117 0.0044567 1308.8 2.11 0.1055 0.82859 0.0032881
+27347 -0.21283 0.004137 1367.4 2.11 0.1055 0.82736 0.0030477
+28520 -0.2042 0.0044587 1426 2.11 0.1055 0.83375 0.0033101
+29692 -0.2112 0.0042852 1484.6 2.11 0.1055 0.82857 0.0031615
+30864 -0.20319 0.0043483 1543.2 2.11 0.1055 0.8345 0.003231
+32036 -0.20752 0.0044297 1601.8 2.11 0.1055 0.83129 0.0032788
+33207 -0.20654 0.0043188 1660.4 2.11 0.1055 0.83201 0.0031995
+34380 -0.20126 0.0046375 1719 2.11 0.1055 0.83593 0.0034518
+35551 -0.20924 0.0042871 1777.6 2.11 0.1055 0.83001 0.0031684
+36724 -0.21323 0.0045471 1836.2 2.11 0.1055 0.82707 0.0033487
+37895 -0.21324 0.0045354 1894.7 2.11 0.1055 0.82706 0.00334
+39067 -0.19905 0.0044141 1953.4 2.11 0.1055 0.83758 0.003292
+40239 -0.1991 0.0047441 2012 2.11 0.1055 0.83754 0.003538
+41411 -0.20359 0.0050136 2070.5 2.11 0.1055 0.8342 0.003724
+42583 -0.21032 0.0049474 2129.1 2.11 0.1055 0.82922 0.0036529
+43755 -0.20689 0.0048203 2187.8 2.11 0.1055 0.83176 0.00357
+44927 -0.21075 0.0052337 2246.4 2.11 0.1055 0.8289 0.0038628
+46099 -0.19956 0.0047827 2304.9 2.11 0.1055 0.8372 0.0035653
Index: test/sasdataloader/test/sesans_examples/sphere_isis.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/sphere_isis.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
+++ test/sasdataloader/test/sesans_examples/sphere_isis.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
@@ -0,0 +1,73 @@
+FileFormatVersion       1.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error Wavelength
+260.0 -1.42E-3 2.04E-3 1.612452
+280.8 -1.45E-3 1.87E-3 1.675709
+303.264 -1.64E-3 1.23E-3 1.741448
+327.525 -1.69E-3 1.17E-3 1.809765
+353.727 -2.23E-3 9.09E-4 1.880763
+382.025 -2.26E-3 8.58E-4 1.954546
+412.587 -2.41E-3 7.29E-4 2.031224
+445.594 -2.58E-3 6.75E-4 2.11091
+481.242 -2.88E-3 6.04E-4 2.193723
+519.741 -3.35E-3 5.56E-4 2.279783
+561.32 -3.60E-3 5.22E-4 2.369219
+606.226 -3.92E-3 4.91E-4 2.462166
+654.724 -4.36E-3 4.73E-4 2.558758
+707.102 -4.67E-3 4.54E-4 2.659139
+763.67 -4.91E-3 4.22E-4 2.763458
+824.764 -5.32E-3 3.88E-4 2.87187
+890.745 -5.43E-3 3.53E-4 2.984535
+962.005 -5.61E-3 3.28E-4 3.101621
+1038.97 -5.83E-3 3.07E-4 3.223306
+1122.08 -5.88E-3 2.91E-4 3.349746
+1211.85 -5.91E-3 2.73E-4 3.481164
+1308.8 -5.71E-3 2.61E-4 3.617734
+1413.5 -5.40E-3 2.49E-4 3.759654
+1526.58 -5.10E-3 2.41E-4 3.907147
+1648.71 -4.77E-3 2.34E-4 4.060431
+1780.6 -4.34E-3 2.26E-4 4.219716
+1923.05 -4.18E-3 2.20E-4 4.385259
+2076.9 -4.08E-3 2.16E-4 4.557302
+2243.05 -4.37E-3 2.13E-4 4.736085
+2422.49 -4.66E-3 2.10E-4 4.92188
+2616.29 -4.96E-3 2.06E-4 5.114968
+2825.59 -5.04E-3 2.03E-4 5.315628
+3051.64 -4.96E-3 1.99E-4 5.524165
+3295.77 -4.72E-3 1.97E-4 5.74088
+3559.43 -4.52E-3 1.92E-4 5.966096
+3844.19 -4.65E-3 1.93E-4 6.200153
+4151.72 -4.74E-3 1.96E-4 6.443384
+4483.86 -4.87E-3 1.99E-4 6.696163
+4842.57 -4.81E-3 2.05E-4 6.958858
+5229.98 -4.57E-3 2.09E-4 7.23186
+5648.38 -4.72E-3 2.17E-4 7.515571
+6100.25 -4.79E-3 2.23E-4 7.81041
+6588.27 -4.68E-3 2.28E-4 8.116816
+7115.33 -4.61E-3 2.32E-4 8.435242
+7684.55 -4.78E-3 2.46E-4 8.766157
+8299.32 -4.74E-3 2.46E-4 9.11006
+8963.26 -4.56E-3 2.50E-4 9.467449
+9680.32 -4.70E-3 2.58E-4 9.838862
+10454.7 -4.81E-3 2.64E-4 10.224823
+11291.1 -4.65E-3 2.69E-4 10.625959
+12194.4 -4.43E-3 2.79E-4 11.042826
+13170.0 -4.55E-3 3.01E-4 11.476062
+14223.6 -4.35E-3 3.20E-4 11.926274
+15361.5 -4.24E-3 3.51E-4 12.394152
+16590.4 -4.68E-3 4.12E-4 12.880373
+17917.6 -4.96E-3 4.98E-4 13.385664
+19303.4 -4.56E-3 5.98E-4 13.893668
Index: test/sasdataloader/test/sesans_examples/too_many_headers.ses
===================================================================
--- test/sasdataloader/test/sesans_examples/too_many_headers.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
+++ test/sasdataloader/test/sesans_examples/too_many_headers.ses	(revision 60820488c1a10ae2d10f1a606e4033bbdff2f503)
@@ -0,0 +1,73 @@
+FileFormatVersion       1.0
+DataFileTitle           PMMA in Mixed Deuterated decalin
+Sample                  Ostensibly 40$ 100nm radius PMMA hard spheres in mixed deuterarted decalin.
+Thickness               2
+Thickness_unit          mm
+Theta_zmax              0.09
+Theta_zmax_unit         radians
+Theta_ymax              0.09
+Theta_ymax_unit         radians
+Orientation             Z
+SpinEchoLength_unit     A
+Depolarisation_unit     A-2 cm-1
+Wavelength_unit         A
+
+BEGIN_DATA
+SpinEchoLength Depolarisation Depolarisation_error Wavelength SpinEchoLength_error
+260.0 -1.42E-3 2.04E-3 1.612452
+280.8 -1.45E-3 1.87E-3 1.675709
+303.264 -1.64E-3 1.23E-3 1.741448
+327.525 -1.69E-3 1.17E-3 1.809765
+353.727 -2.23E-3 9.09E-4 1.880763
+382.025 -2.26E-3 8.58E-4 1.954546
+412.587 -2.41E-3 7.29E-4 2.031224
+445.594 -2.58E-3 6.75E-4 2.11091
+481.242 -2.88E-3 6.04E-4 2.193723
+519.741 -3.35E-3 5.56E-4 2.279783
+561.32 -3.60E-3 5.22E-4 2.369219
+606.226 -3.92E-3 4.91E-4 2.462166
+654.724 -4.36E-3 4.73E-4 2.558758
+707.102 -4.67E-3 4.54E-4 2.659139
+763.67 -4.91E-3 4.22E-4 2.763458
+824.764 -5.32E-3 3.88E-4 2.87187
+890.745 -5.43E-3 3.53E-4 2.984535
+962.005 -5.61E-3 3.28E-4 3.101621
+1038.97 -5.83E-3 3.07E-4 3.223306
+1122.08 -5.88E-3 2.91E-4 3.349746
+1211.85 -5.91E-3 2.73E-4 3.481164
+1308.8 -5.71E-3 2.61E-4 3.617734
+1413.5 -5.40E-3 2.49E-4 3.759654
+1526.58 -5.10E-3 2.41E-4 3.907147
+1648.71 -4.77E-3 2.34E-4 4.060431
+1780.6 -4.34E-3 2.26E-4 4.219716
+1923.05 -4.18E-3 2.20E-4 4.385259
+2076.9 -4.08E-3 2.16E-4 4.557302
+2243.05 -4.37E-3 2.13E-4 4.736085
+2422.49 -4.66E-3 2.10E-4 4.92188
+2616.29 -4.96E-3 2.06E-4 5.114968
+2825.59 -5.04E-3 2.03E-4 5.315628
+3051.64 -4.96E-3 1.99E-4 5.524165
+3295.77 -4.72E-3 1.97E-4 5.74088
+3559.43 -4.52E-3 1.92E-4 5.966096
+3844.19 -4.65E-3 1.93E-4 6.200153
+4151.72 -4.74E-3 1.96E-4 6.443384
+4483.86 -4.87E-3 1.99E-4 6.696163
+4842.57 -4.81E-3 2.05E-4 6.958858
+5229.98 -4.57E-3 2.09E-4 7.23186
+5648.38 -4.72E-3 2.17E-4 7.515571
+6100.25 -4.79E-3 2.23E-4 7.81041
+6588.27 -4.68E-3 2.28E-4 8.116816
+7115.33 -4.61E-3 2.32E-4 8.435242
+7684.55 -4.78E-3 2.46E-4 8.766157
+8299.32 -4.74E-3 2.46E-4 9.11006
+8963.26 -4.56E-3 2.50E-4 9.467449
+9680.32 -4.70E-3 2.58E-4 9.838862
+10454.7 -4.81E-3 2.64E-4 10.224823
+11291.1 -4.65E-3 2.69E-4 10.625959
+12194.4 -4.43E-3 2.79E-4 11.042826
+13170.0 -4.55E-3 3.01E-4 11.476062
+14223.6 -4.35E-3 3.20E-4 11.926274
+15361.5 -4.24E-3 3.51E-4 12.394152
+16590.4 -4.68E-3 4.12E-4 12.880373
+17917.6 -4.96E-3 4.98E-4 13.385664
+19303.4 -4.56E-3 5.98E-4 13.893668
Index: test/sasdataloader/test/utest_sesans.py
===================================================================
--- test/sasdataloader/test/utest_sesans.py	(revision a67c494cf1732add92a4fd2796ea7d12b3cd618a)
+++ test/sasdataloader/test/utest_sesans.py	(revision a67c494cf1732add92a4fd2796ea7d12b3cd618a)
@@ -0,0 +1,100 @@
+"""
+    Unit tests for the SESANS .ses reader
+"""
+
+import unittest
+from sas.sascalc.dataloader.readers.sesans_reader import Reader
+from sas.sascalc.dataloader.loader import  Loader
+
+class sesans_reader(unittest.TestCase):
+
+    def setUp(self):
+        reader = Reader()
+        self.loader = reader.read
+
+    def test_full_load(self):
+        """
+            Test .SES in the full loader to make sure that the file type is correctly accepted
+        """
+        f = Loader().load("sesans_examples/sphere2micron.ses")
+        # self.assertEqual(f, 5)
+        self.assertEqual(len(f.x), 40)
+        self.assertEqual(f.x[0], 391.56)
+        self.assertEqual(f.x[-1], 46099)
+        self.assertEqual(f.y[-1], -0.19956)
+        self.assertEqual(f.x_unit, "A")
+        self.assertEqual(f.y_unit, "A-2 cm-1")
+        self.assertEqual(f.sample.name, "Polystyrene 2 um in 53% H2O, 47% D2O")
+        self.assertEqual(f.sample.thickness, 0.2)
+        self.assertEqual(f.sample.zacceptance, (0.0168, "radians"))
+        self.assertEqual(f.isSesans, True)
+
+    def test_sesans_tof(self):
+        """
+            Test .SES loading on a TOF dataset
+        """
+        f = self.loader("sesans_examples/sphere_isis.ses")
+        self.assertEqual(len(f.x), 57)
+        self.assertEqual(f.x[-1], 19303.4)
+        self.assertEqual(f.source.wavelength[-1], 13.893668)
+        self.assertEqual(f.source.wavelength[0], 1.612452)
+        self.assertEqual(f.sample.yacceptance, (0.09, "radians"))
+        self.assertEqual(f.sample.zacceptance, (0.09, "radians"))
+        self.assertEqual(f.sample.thickness, 0.2)
+
+    def test_sesans_no_data(self):
+        """
+            Confirm that sesans files with no actual data won't load.
+        """
+        self.assertRaises(
+            RuntimeError,
+            self.loader,
+            "sesans_examples/sesans_no_data.ses")
+
+    def test_sesans_no_spin_echo_unit(self):
+        """
+            Confirm that sesans files with no units from the spin echo length raise an appropriate error
+        """
+        self.assertRaises(
+            RuntimeError,
+            self.loader,
+            "sesans_examples/no_spin_echo_unit.ses")
+
+    def test_sesans_no_version(self):
+        """
+            Confirm that sesans files with no file format version raise an appropriate error
+        """
+        self.assertRaises(
+            RuntimeError,
+            self.loader,
+            "sesans_examples/no_version.ses")
+
+    def test_sesans_future_version(self):
+        """
+            Confirm that sesans files that, according to semantic version, are from a future, backwards-incompatible version of the SES file format throw an exception.
+        """
+        self.assertRaises(
+            RuntimeError,
+            self.loader,
+            "sesans_examples/next_gen.ses")
+
+    def test_sesans_mandatory_headers(self):
+        """
+            Confirm that sesans files throw an exception if one of the mandator headers is missing.
+        """
+        self.assertRaises(
+            RuntimeError,
+            self.loader,
+            "sesans_examples/no_wavelength.ses")
+
+    def test_sesans_columns_match_headers(self):
+        """
+            Confirm that sesans files throw an exception if one of the mandator headers is missing.
+        """
+        self.assertRaises(
+            RuntimeError,
+            self.loader,
+            "sesans_examples/too_many_headers.ses")
+
+if __name__ == "__main__":
+    unittest.main()
