Index: src/sas/dataloader/data_info.py
===================================================================
--- src/sas/dataloader/data_info.py	(revision 7eaf9f21f295baa6e9594bfada6f9dde6baa5f67)
+++ src/sas/dataloader/data_info.py	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
@@ -26,11 +26,10 @@
 import math
 
-
 class plottable_sesans1D:
     """
     SESANS is a place holder for 1D SESANS plottables.
     
-    #TODO: This was directly copied from the plottables_1D.
-    #TODO: The class has not been updated from there.
+    #TODO: This was directly copied from the plottables_1D. Modified Somewhat.
+    #Class has been updated.
     """
     # The presence of these should be mutually
@@ -38,6 +37,8 @@
     x = None
     y = None
+    lam = None
     dx = None
     dy = None
+    dlam = None
     ## Slit smearing length
     dxl = None
@@ -51,16 +52,20 @@
     _yunit = ''
     
-    def __init__(self, x, y, dx=None, dy=None, dxl=None, dxw=None):
+    def __init__(self, x, y, lam, dx=None, dy=None, dlam=None):
+#        print "SESANS plottable working"
         self.x = numpy.asarray(x)
         self.y = numpy.asarray(y)
+        self.lam = numpy.asarray(lam)
         if dx is not None:
             self.dx = numpy.asarray(dx)
         if dy is not None:
             self.dy = numpy.asarray(dy)
-        if dxl is not None:
-            self.dxl = numpy.asarray(dxl)
-        if dxw is not None: 
-            self.dxw = numpy.asarray(dxw)
-
+        if dlam is not None:
+            self.dlam = numpy.asarray(dlam)
+#        if dxl is not None:
+#            self.dxl = numpy.asarray(dxl)
+#        if dxw is not None: 
+#            self.dxw = numpy.asarray(dxw)
+#        print "SESANS plottable init fin"
     def xaxis(self, label, unit):
         """
@@ -69,9 +74,15 @@
         self._xaxis = label
         self._xunit = unit
-        
+        print "xaxis active"
+        print label
+        print unit
     def yaxis(self, label, unit):
         """
         set the y axis label and unit
         """
+        print "yaxis active"
+        print label
+        print unit
+        
         self._yaxis = label
         self._yunit = unit
@@ -750,5 +761,85 @@
         """
         return self._perform_union(other)
-                
+  
+class SESANSData1D(plottable_sesans1D, DataInfo):
+    """
+    SESANS 1D data class
+    """
+    x_unit = 'nm'
+    y_unit = 'a.u.'
+    
+    def __init__(self, x=None, y=None, lam=None, dy=None, dx=None, dlam=None):
+#        print "dat init"
+        DataInfo.__init__(self)
+#        print "dat init fin"
+        plottable_sesans1D.__init__(self, x, y, lam, dx, dy, dlam)
+#        print "SESANSdata1D init"
+    def __str__(self):
+        """
+        Nice printout
+        """
+#        print "string printer active"
+        _str =  "%s\n" % DataInfo.__str__(self)
+    
+        _str += "Data:\n"
+        _str += "   Type:         %s\n" % self.__class__.__name__
+        _str += "   X-axis:       %s\t[%s]\n" % (self._xaxis, self._xunit)
+        _str += "   Y-axis:       %s\t[%s]\n" % (self._yaxis, self._yunit)
+        _str += "   Length:       %g\n" % len(self.x)
+#        print _str
+        return _str
+#
+#    def is_slit_smeared(self):
+#        """
+#        Check whether the data has slit smearing information
+#        
+#        :return: True is slit smearing info is present, False otherwise
+#        
+#        """
+#        def _check(v):
+#            if (v.__class__ == list or v.__class__ == numpy.ndarray) \
+#                and len(v) > 0 and min(v) > 0:
+#                return True
+#            
+#            return False
+#        
+#        return _check(self.dxl) or _check(self.dxw)
+        
+    def clone_without_data(self, length=0, clone=None):
+        """
+        Clone the current object, without copying the data (which
+        will be filled out by a subsequent operation).
+        The data arrays will be initialized to zero.
+        
+        :param length: length of the data array to be initialized
+        :param clone: if provided, the data will be copied to clone
+        """
+        from copy import deepcopy
+#        print " SESANS data 1D clone active"
+        if clone is None or not issubclass(clone.__class__, Data1D):
+            x  = numpy.zeros(length)
+            dx = numpy.zeros(length)
+            lam  = numpy.zeros(length)
+            dlam = numpy.zeros(length)
+            y  = numpy.zeros(length)
+            dy = numpy.zeros(length)
+            clone = Data1D(x, y, dx=dx, dy=dy)
+        
+        clone.title          = self.title
+        clone.run            = self.run
+        clone.filename       = self.filename
+        clone.instrument     = self.instrument
+        clone.notes          = deepcopy(self.notes)
+        clone.process        = deepcopy(self.process)
+        clone.detector       = deepcopy(self.detector)
+        clone.sample         = deepcopy(self.sample)
+        clone.source         = deepcopy(self.source)
+        clone.collimation    = deepcopy(self.collimation)
+        clone.trans_spectrum = deepcopy(self.trans_spectrum)
+        clone.meta_data      = deepcopy(self.meta_data)
+        clone.errors         = deepcopy(self.errors)
+#        print "SESANS Data 1Dclone done"
+        return clone
+              
 class Data1D(plottable_1D, DataInfo):
     """
@@ -991,80 +1082,4 @@
         
         
-class SESANSData1D(plottable_sesans1D, DataInfo):
-    """
-    SESANS 1D data class
-    """
-    x_unit = '1/A'
-    y_unit = '1/cm'
-    
-    def __init__(self, x, y, dx=None, dy=None):
-        DataInfo.__init__(self)
-        plottable_sesans1D.__init__(self, x, y, dx, dy)
-        
-    def __str__(self):
-        """
-        Nice printout
-        """
-        _str =  "%s\n" % DataInfo.__str__(self)
-    
-        _str += "Data:\n"
-        _str += "   Type:         %s\n" % self.__class__.__name__
-        _str += "   X-axis:       %s\t[%s]\n" % (self._xaxis, self._xunit)
-        _str += "   Y-axis:       %s\t[%s]\n" % (self._yaxis, self._yunit)
-        _str += "   Length:       %g\n" % len(self.x)
-
-        return _str
-
-    def is_slit_smeared(self):
-        """
-        Check whether the data has slit smearing information
-        
-        :return: True is slit smearing info is present, False otherwise
-        
-        """
-        def _check(v):
-            if (v.__class__ == list or v.__class__ == numpy.ndarray) \
-                and len(v) > 0 and min(v) > 0:
-                return True
-            
-            return False
-        
-        return _check(self.dxl) or _check(self.dxw)
-        
-    def clone_without_data(self, length=0, clone=None):
-        """
-        Clone the current object, without copying the data (which
-        will be filled out by a subsequent operation).
-        The data arrays will be initialized to zero.
-        
-        :param length: length of the data array to be initialized
-        :param clone: if provided, the data will be copied to clone
-        """
-        from copy import deepcopy
-        
-        if clone is None or not issubclass(clone.__class__, Data1D):
-            x  = numpy.zeros(length)
-            dx = numpy.zeros(length)
-            y  = numpy.zeros(length)
-            dy = numpy.zeros(length)
-            clone = Data1D(x, y, dx=dx, dy=dy)
-        
-        clone.title          = self.title
-        clone.run            = self.run
-        clone.filename       = self.filename
-        clone.instrument     = self.instrument
-        clone.notes          = deepcopy(self.notes)
-        clone.process        = deepcopy(self.process)
-        clone.detector       = deepcopy(self.detector)
-        clone.sample         = deepcopy(self.sample)
-        clone.source         = deepcopy(self.source)
-        clone.collimation    = deepcopy(self.collimation)
-        clone.trans_spectrum = deepcopy(self.trans_spectrum)
-        clone.meta_data      = deepcopy(self.meta_data)
-        clone.errors         = deepcopy(self.errors)
-        
-        return clone
-    
-    
 class Data2D(plottable_2D, DataInfo):
     """
Index: src/sas/dataloader/loader.py
===================================================================
--- src/sas/dataloader/loader.py	(revision 794922220f2fb3b23dd08c648aabf87b4850596c)
+++ src/sas/dataloader/loader.py	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
@@ -363,4 +363,5 @@
         :return: DataInfo object
         """
+        print self.__registry.extensions
         return self.__registry.load(file, format)
     
Index: src/sas/dataloader/readers/associations.py
===================================================================
--- src/sas/dataloader/readers/associations.py	(revision 5dfdfa7b1103a8dfb020e940cb1e38dcde633256)
+++ src/sas/dataloader/readers/associations.py	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
@@ -91,5 +91,6 @@
     #import tiff_reader
     import nexus_reader
-
+    import sesans_reader
+    registry_function(sesans_reader)
     registry_function(abs_reader)
     registry_function(ascii_reader)
Index: src/sas/dataloader/readers/defaults.json
===================================================================
--- src/sas/dataloader/readers/defaults.json	(revision 5dfdfa7b1103a8dfb020e940cb1e38dcde633256)
+++ src/sas/dataloader/readers/defaults.json	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
@@ -5,4 +5,8 @@
             "-extension":".xml",
             "-reader":"cansas_reader"
+         },
+         {
+            "-extension":".ses",
+            "-reader":"sesans_reader"
          },
          {
Index: src/sas/dataloader/readers/sesans_reader.py
===================================================================
--- src/sas/dataloader/readers/sesans_reader.py	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
+++ src/sas/dataloader/readers/sesans_reader.py	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
@@ -0,0 +1,270 @@
+"""
+    SESANS reader
+"""
+
+import numpy
+import os
+from sas.dataloader.data_info import SESANSData1D
+
+# Check whether we have a converter available
+has_converter = True
+try:
+    from sas.data_util.nxsunit import Converter
+except:
+    has_converter = False
+_ZERO = 1e-16
+
+class Reader:
+    """
+    Class to load sesans files (6 columns).
+    """
+    ## File type
+    type_name = "SESANS"
+    
+    ## Wildcards
+    type = ["SESANS files (*.ses)|*.ses",
+            "SESANS files (*..sesans)|*.sesans"]
+    ## List of allowed extensions
+    ext = ['.ses', '.SES', '.sesans', '.SESANS']
+    
+    ## 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
+        """
+        if os.path.isfile(path):
+            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()
+#                print buff
+                lines = buff.splitlines()
+#                print lines
+                #Jae could not find python universal line spliter:
+                #keep the below for now
+                # some ascii data has \r line separator,
+                # try it when the data is on only one long line
+#                if len(lines) < 2 :
+#                    lines = buff.split('\r')
+                 
+                x  = numpy.zeros(0)
+                y  = numpy.zeros(0)
+                dy = numpy.zeros(0)
+                lam  = numpy.zeros(0)
+                dlam = numpy.zeros(0)
+                dx = numpy.zeros(0)
+                
+               #temp. space to sort data
+                tx  = numpy.zeros(0)
+                ty  = numpy.zeros(0)
+                tdy = numpy.zeros(0)
+                tlam  = numpy.zeros(0)
+                tdlam = numpy.zeros(0)
+                tdx = numpy.zeros(0)
+#                print "all good"
+                output = SESANSData1D(x=x, y=y, lam=lam, dy=dy, dx=dx, dlam=dlam)
+#                print output                
+                self.filename = output.filename = basename
+                
+                
+                data_conv_z = None
+                data_conv_P = None
+#                print "passing"
+                if has_converter == True and output.x_unit != 'A':
+                    data_conv_z = Converter('nm')
+                    # Test it
+                    data_conv_z(1.0, output.x_unit)
+#                    print data_conv_z
+#                    print data_conv_z(1.0, output.x_unit)
+                if has_converter == True and output.y_unit != ' ':
+                    data_conv_P = Converter('a.u.')
+                    # Test it
+                    data_conv_P(1.0, output.y_unit)
+#                    print data_conv_P
+#                    print data_conv_P(1.0, output.y_unit)
+                # The first good line of data will define whether
+                # we have 2-column or 3-column ascii
+#                print output.x_unit
+#                print output.y_unit
+                
+#                print "past output"
+                
+#                has_error_dx = None
+#                has_error_dy = None
+                
+#                #Initialize counters for data lines and header lines.
+#                is_data = False  # Has more than 5 lines
+#                # More than "5" lines of data is considered as actual
+#                # data unless that is the only data
+#                mum_data_lines = 5
+#                # To count # of current data candidate lines
+#                i = -1
+#                # To count total # of previous data candidate lines
+#                i1 = -1
+#                # To count # of header lines
+#                j = -1
+#                # Helps to count # of header lines
+#                j1 = -1
+#                #minimum required number of columns of data; ( <= 4).
+#                lentoks = 2
+                paramnames=[]
+                paramvals=[]
+                zvals=[]
+                dzvals=[]
+                lamvals=[]
+                dlamvals=[]
+                Pvals=[]
+                dPvals=[]
+#                print x
+#                print zvals
+                for line in lines:
+                    # Initial try for CSV (split on ,)
+#                    print line
+                    line=line.strip()
+#                    print line
+                    toks = line.split('\t')
+#                    print toks
+                    if len(toks)==2:
+                        paramnames.append(toks[0])
+#                        print paramnames
+                        paramvals.append(toks[1])
+#                        print paramvals
+                    if len(toks)>5:
+                        zvals.append(toks[0])
+                        dzvals.append(toks[1])
+                        lamvals.append(toks[2])
+                        dlamvals.append(toks[3])
+                        Pvals.append(toks[4])
+                        dPvals.append(toks[5])
+                    else:
+                        continue
+#                print varheaders
+#                print paramnames
+#                print paramvals
+#                print zvals  
+#                print len(zvals)
+                
+                x=[]
+                y=[]
+                lam=[]
+                dx=[]
+                dy=[]
+                dlam=[]
+                varheader=[zvals[0],dzvals[0],lamvals[0],dlamvals[0],Pvals[0],dPvals[0]]
+#                print varheader
+                valrange=range(len(zvals)-1)
+#                print valrange
+                for i in valrange:
+                    x.append(float(zvals[i+1]))
+                    y.append(float(Pvals[i+1]))
+                    lam.append(float(lamvals[i+1]))
+                    dy.append(float(dPvals[i+1]))
+                    dx.append(float(dzvals[i+1]))
+                    dlam.append(float(dlamvals[i+1]))
+                    
+                x,y,lam,dy,dx,dlam = [
+                   numpy.asarray(v, 'double')
+                   for v in (x,y,lam,dy,dx,dlam)
+                ]
+
+#                print x
+#                print y
+#                print dx
+#                print dy
+#                print len(x)
+#                print len(y)
+#                print len(dx)
+#                print len(dy)
+                
+                
+                input_f.close()
+                # Sanity check
+#                if has_error_dy == True and not len(y) == len(dy):
+#                    msg = "sesans_reader: y and dy have different length"
+#                    raise RuntimeError, msg
+#                if has_error_dx == True and not len(x) == len(dx):
+#                    msg = "sesans_reader: y and dy have different length"
+#                    raise RuntimeError, msg
+#                # If the data length is zero, consider this as
+#                # though we were not able to read the file.
+#                if len(x) == 0:
+#                    raise RuntimeError, "sesans_reader: could not load file"
+#                print "alive"
+                #Let's re-order the data to make cal.
+                # curve look better some cases
+#                ind = numpy.lexsort((ty, tx))
+#                for i in ind:
+#                    x[i] = tx[ind[i]]
+#                    y[i] = ty[ind[i]]
+#                    if has_error_dy == True:
+#                        dy[i] = tdy[ind[i]]
+#                    if has_error_dx == True:
+#                        dx[i] = tdx[ind[i]]
+                # Zeros in dx, dy
+#                if has_error_dx:
+#                    dx[dx == 0] = _ZERO
+#                if has_error_dy:
+#                    dy[dy == 0] = _ZERO
+                #Data
+                output.x = x #[x != 0]
+#                print output.x
+                output.y = y #[x != 0]
+#                print output.y
+#                output.dy = dy[x != 0] if has_error_dy == True\
+#                    else numpy.zeros(len(output.y))
+#                output.dx = dx[x != 0] if has_error_dx == True\
+#                    else numpy.zeros(len(output.x))
+                output.dy = dy
+                output.dx = dx
+                output.lam = lam
+                output.dlam = dlam
+
+
+#                print "still alive"                
+#                if data_conv_z is not None:
+#                    output.xaxis("\\rm{z}", output.x_unit)
+#                else:
+#                    output.xaxis("\\rm{z}", 'nm')
+#                if data_conv_P is not None:
+#                    output.yaxis("\\rm{P/P0}", output.y_unit)
+#                else:
+#                    output.yaxis("\\rm{P/P0}", "a.u.")
+                output.xaxis("\\rm{z}", 'A')   
+                output.yaxis("\\rm{P/P0}", " ")
+                # 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]
+                output.sample.zacceptance=float(paramvals[7])
+#                print output                
+
+#                print "sesans_reader end"
+                
+                if len(output.x) < 1:
+                    raise RuntimeError, "%s is empty" % path
+#                print output
+                
+                return output
+            
+        else:
+            raise RuntimeError, "%s is not a file" % path
+        return None
