Index: DataLoader/.pydevproject
===================================================================
--- DataLoader/.pydevproject	(revision a3f8d58994d10df4c15d5350e0eb4ab2acfcb19d)
+++ DataLoader/.pydevproject	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -3,9 +3,5 @@
 
 <pydev_project>
-<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
-<path>/DataLoader/src</path>
-<path>/DataLoader/extensions</path>
-</pydev_pathproperty>
 <pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5</pydev_property>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">C:\Python25\python.exe</pydev_property>
 </pydev_project>
Index: DataLoader/data_info.py
===================================================================
--- DataLoader/data_info.py	(revision 7d8094b6caf5d6d7b228ae3c7805b5e92f8ae612)
+++ DataLoader/data_info.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -137,5 +137,5 @@
     """
     ## Name of the instrument [string]
-    name = ''
+    name = None
     ## Sample to detector distance [float] [mm]
     distance = None
@@ -155,5 +155,4 @@
     ## Slit length of the instrument for this detector.[float] [mm]
     slit_length = None
-    #slit_length_unit = '1/A'
     slit_length_unit = 'mm'
     
@@ -207,5 +206,5 @@
     """
     ## Name
-    name = ''
+    name = None
     ## Length [float] [mm]
     length = None
Index: DataLoader/readers/IgorReader.py
===================================================================
--- DataLoader/readers/IgorReader.py	(revision 28caa03404030faac2dd29ba6ae3e5afc427a99b)
+++ DataLoader/readers/IgorReader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -290,5 +290,6 @@
             output.zaxis("\\rm{Intensity}","cm^{-1}")
     
-        
+        # Store loading process information
+        output.meta_data['loader'] = self.type_name
         return output
     
Index: DataLoader/readers/abs_reader.py
===================================================================
--- DataLoader/readers/abs_reader.py	(revision 28caa03404030faac2dd29ba6ae3e5afc427a99b)
+++ DataLoader/readers/abs_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -222,4 +222,7 @@
                 else:
                     output.yaxis("\\rm{Intensity}","cm^{-1}")
+                    
+                # Store loading process information
+                output.meta_data['loader'] = self.type_name                       
                 return output
         else:
Index: DataLoader/readers/ascii_reader.py
===================================================================
--- DataLoader/readers/ascii_reader.py	(revision e082e2cfc4f00926039169b8129f6917fdf3fd4b)
+++ DataLoader/readers/ascii_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -308,4 +308,8 @@
                 else:
                     output.yaxis("\\rm{Intensity}","cm^{-1}")
+                    
+                # Store loading process information
+                output.meta_data['loader'] = self.type_name    
+                    
                 return output
             
Index: DataLoader/readers/cansas_reader.py
===================================================================
--- DataLoader/readers/cansas_reader.py	(revision b0d072360e8109c7e554d3115ecbe42a599dd294)
+++ DataLoader/readers/cansas_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -92,68 +92,5 @@
     return value, attr
 
-def _store_float(location, node, variable, storage):
-    """
-        Get the content of a xpath location and store
-        the result. Check that the units are compatible
-        with the destination. The value is expected to
-        be a float.
-        
-        The xpath location might or might not exist.
-        If it does not exist, nothing is done
-        
-        @param location: xpath location to fetch
-        @param node: node to read the data from
-        @param variable: name of the data member to store it in [string]
-        @param storage: data object that has the 'variable' data member
-        
-        @raise ValueError: raised when the units are not recognized
-    """
-    entry = get_content(location, node)
-    try:
-        value = float(entry.text)
-    except:
-        value = None
-        
-    if value is not None:
-        # If the entry has units, check to see that they are
-        # compatible with what we currently have in the data object
-        units = entry.get('unit')
-        if units is not None:
-            toks = variable.split('.')
-            exec "local_unit = storage.%s_unit" % toks[0]
-            if units.lower()!=local_unit.lower():
-                if has_converter==True:
-                    try:
-                        conv = Converter(units)
-                        exec "storage.%s = %g" % (variable, conv(value, units=local_unit))
-                    except:
-                        raise ValueError, "CanSAS reader: could not convert %s unit [%s]; expecting [%s]\n  %s" \
-                        % (variable, units, local_unit, sys.exc_value)
-                else:
-                    raise ValueError, "CanSAS reader: unrecognized %s unit [%s]; expecting [%s]" \
-                        % (variable, units, local_unit)
-            else:
-                exec "storage.%s = value" % variable
-        else:
-            exec "storage.%s = value" % variable
-            
-
-def _store_content(location, node, variable, storage):
-    """
-        Get the content of a xpath location and store
-        the result. The value is treated as a string.
-        
-        The xpath location might or might not exist.
-        If it does not exist, nothing is done
-        
-        @param location: xpath location to fetch
-        @param node: node to read the data from
-        @param variable: name of the data member to store it in [string]
-        @param storage: data object that has the 'variable' data member
-    """
-    entry = get_content(location, node)
-    if entry is not None and entry.text is not None:
-        exec "storage.%s = entry.text.strip()" % variable
-
+            
 
 class Reader:
@@ -173,4 +110,8 @@
     ext=['.xml', '.XML']  
     
+    def __init__(self):
+        ## List of errors
+        self.errors = []
+    
     def read(self, path):
         """ 
@@ -199,6 +140,11 @@
                 
                 for entry in entry_list:
+                    self.errors = []
                     sas_entry = self._parse_entry(entry)
                     sas_entry.filename = basename
+                    
+                    # Store loading process information
+                    sas_entry.errors = self.errors
+                    sas_entry.meta_data['loader'] = self.type_name
                     output.append(sas_entry)
                 
@@ -227,5 +173,5 @@
         
         # Look up title      
-        _store_content('ns:Title', dom, 'title', data_info)
+        self._store_content('ns:Title', dom, 'title', data_info)
         
         # Look up run number   
@@ -240,5 +186,5 @@
                            
         # Look up instrument name              
-        _store_content('ns:SASinstrument/ns:name', dom, 'instrument', data_info)
+        self._store_content('ns:SASinstrument/ns:name', dom, 'instrument', data_info)
 
         # Notes
@@ -251,5 +197,7 @@
                         data_info.notes.append(note_value)
             except:
-                logging.error("cansas_reader.read: error processing entry notes\n  %s" % sys.exc_value)
+                err_mess = "cansas_reader.read: error processing entry notes\n  %s" % sys.exc_value
+                self.errors.append(err_mess)
+                logging.error(err_mess)
         
         # Sample info ###################
@@ -258,11 +206,11 @@
             data_info.sample.name = entry.get('name')
             
-        _store_content('ns:SASsample/ns:ID', 
+        self._store_content('ns:SASsample/ns:ID', 
                      dom, 'ID', data_info.sample)                    
-        _store_float('ns:SASsample/ns:thickness', 
+        self._store_float('ns:SASsample/ns:thickness', 
                      dom, 'thickness', data_info.sample)
-        _store_float('ns:SASsample/ns:transmission', 
+        self._store_float('ns:SASsample/ns:transmission', 
                      dom, 'transmission', data_info.sample)
-        _store_float('ns:SASsample/ns:temperature', 
+        self._store_float('ns:SASsample/ns:temperature', 
                      dom, 'temperature', data_info.sample)
         
@@ -275,20 +223,22 @@
                         data_info.sample.details.append(detail_value)
             except:
-                logging.error("cansas_reader.read: error processing sample details\n  %s" % sys.exc_value)
+                err_mess = "cansas_reader.read: error processing sample details\n  %s" % sys.exc_value
+                self.errors.append(err_mess)
+                logging.error(err_mess)
         
         # Position (as a vector)
-        _store_float('ns:SASsample/ns:position/ns:x', 
+        self._store_float('ns:SASsample/ns:position/ns:x', 
                      dom, 'position.x', data_info.sample)          
-        _store_float('ns:SASsample/ns:position/ns:y', 
+        self._store_float('ns:SASsample/ns:position/ns:y', 
                      dom, 'position.y', data_info.sample)          
-        _store_float('ns:SASsample/ns:position/ns:z', 
+        self._store_float('ns:SASsample/ns:position/ns:z', 
                      dom, 'position.z', data_info.sample)          
         
         # Orientation (as a vector)
-        _store_float('ns:SASsample/ns:orientation/ns:roll', 
+        self._store_float('ns:SASsample/ns:orientation/ns:roll', 
                      dom, 'orientation.x', data_info.sample)          
-        _store_float('ns:SASsample/ns:orientation/ns:pitch', 
+        self._store_float('ns:SASsample/ns:orientation/ns:pitch', 
                      dom, 'orientation.y', data_info.sample)          
-        _store_float('ns:SASsample/ns:orientation/ns:yaw', 
+        self._store_float('ns:SASsample/ns:orientation/ns:yaw', 
                      dom, 'orientation.z', data_info.sample)          
        
@@ -298,15 +248,15 @@
             data_info.source.name = entry.get('name')
         
-        _store_content('ns:SASinstrument/ns:SASsource/ns:radiation', 
+        self._store_content('ns:SASinstrument/ns:SASsource/ns:radiation', 
                      dom, 'radiation', data_info.source)                    
-        _store_content('ns:SASinstrument/ns:SASsource/ns:beam_shape', 
+        self._store_content('ns:SASinstrument/ns:SASsource/ns:beam_shape', 
                      dom, 'beam_shape', data_info.source)                    
-        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:wavelength', 
                      dom, 'wavelength', data_info.source)          
-        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_min', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_min', 
                      dom, 'wavelength_min', data_info.source)          
-        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_max', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_max', 
                      dom, 'wavelength_max', data_info.source)          
-        _store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_spread', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:wavelength_spread', 
                      dom, 'wavelength_spread', data_info.source)    
         
@@ -316,9 +266,9 @@
             data_info.source.beam_size_name = entry.get('name')
             
-        _store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:x', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:x', 
                      dom, 'beam_size.x', data_info.source)    
-        _store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:y', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:y', 
                      dom, 'beam_size.y', data_info.source)    
-        _store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:z', 
+        self._store_float('ns:SASinstrument/ns:SASsource/ns:beam_size/ns:z', 
                      dom, 'beam_size.z', data_info.source)    
         
@@ -329,5 +279,5 @@
             if item.get('name') is not None:
                 collim.name = item.get('name')
-            _store_float('ns:length', item, 'length', collim)  
+            self._store_float('ns:length', item, 'length', collim)  
             
             # Look for apertures
@@ -340,5 +290,5 @@
                 aperture.type = apert.get('type')
                     
-                _store_float('ns:distance', apert, 'distance', aperture)    
+                self._store_float('ns:distance', apert, 'distance', aperture)    
                 
                 entry = get_content('ns:size', apert)
@@ -346,7 +296,7 @@
                     aperture.size_name = entry.get('name')
                 
-                _store_float('ns:size/ns:x', apert, 'size.x', aperture)    
-                _store_float('ns:size/ns:y', apert, 'size.y', aperture)    
-                _store_float('ns:size/ns:z', apert, 'size.z', aperture)
+                self._store_float('ns:size/ns:x', apert, 'size.x', aperture)    
+                self._store_float('ns:size/ns:y', apert, 'size.y', aperture)    
+                self._store_float('ns:size/ns:z', apert, 'size.z', aperture)
                 
                 collim.aperture.append(aperture)
@@ -360,28 +310,28 @@
             detector = Detector()
             
-            _store_content('ns:name', item, 'name', detector)
-            _store_float('ns:SDD', item, 'distance', detector)    
+            self._store_content('ns:name', item, 'name', detector)
+            self._store_float('ns:SDD', item, 'distance', detector)    
             
             # Detector offset (as a vector)
-            _store_float('ns:offset/ns:x', item, 'offset.x', detector)    
-            _store_float('ns:offset/ns:y', item, 'offset.y', detector)    
-            _store_float('ns:offset/ns:z', item, 'offset.z', detector)    
+            self._store_float('ns:offset/ns:x', item, 'offset.x', detector)    
+            self._store_float('ns:offset/ns:y', item, 'offset.y', detector)    
+            self._store_float('ns:offset/ns:z', item, 'offset.z', detector)    
             
             # Detector orientation (as a vector)
-            _store_float('ns:orientation/ns:roll',  item, 'orientation.x', detector)    
-            _store_float('ns:orientation/ns:pitch', item, 'orientation.y', detector)    
-            _store_float('ns:orientation/ns:yaw',   item, 'orientation.z', detector)    
+            self._store_float('ns:orientation/ns:roll',  item, 'orientation.x', detector)    
+            self._store_float('ns:orientation/ns:pitch', item, 'orientation.y', detector)    
+            self._store_float('ns:orientation/ns:yaw',   item, 'orientation.z', detector)    
             
             # Beam center (as a vector)
-            _store_float('ns:beam_center/ns:x', item, 'beam_center.x', detector)    
-            _store_float('ns:beam_center/ns:y', item, 'beam_center.y', detector)    
-            _store_float('ns:beam_center/ns:z', item, 'beam_center.z', detector)    
+            self._store_float('ns:beam_center/ns:x', item, 'beam_center.x', detector)    
+            self._store_float('ns:beam_center/ns:y', item, 'beam_center.y', detector)    
+            self._store_float('ns:beam_center/ns:z', item, 'beam_center.z', detector)    
             
             # Pixel size (as a vector)
-            _store_float('ns:pixel_size/ns:x', item, 'pixel_size.x', detector)    
-            _store_float('ns:pixel_size/ns:y', item, 'pixel_size.y', detector)    
-            _store_float('ns:pixel_size/ns:z', item, 'pixel_size.z', detector)    
-            
-            _store_float('ns:slit_length', item, 'slit_length', detector)
+            self._store_float('ns:pixel_size/ns:x', item, 'pixel_size.x', detector)    
+            self._store_float('ns:pixel_size/ns:y', item, 'pixel_size.y', detector)    
+            self._store_float('ns:pixel_size/ns:z', item, 'pixel_size.z', detector)    
+            
+            self._store_float('ns:slit_length', item, 'slit_length', detector)
             
             data_info.detector.append(detector)    
@@ -391,7 +341,7 @@
         for item in nodes:
             process = Process()
-            _store_content('ns:name', item, 'name', process)
-            _store_content('ns:date', item, 'date', process)
-            _store_content('ns:description', item, 'description', process)
+            self._store_content('ns:name', item, 'name', process)
+            self._store_content('ns:date', item, 'date', process)
+            self._store_content('ns:description', item, 'description', process)
             
             term_list = item.xpath('ns:term', namespaces={'ns': CANSAS_NS})
@@ -405,5 +355,7 @@
                         process.term.append(term_attr)
                 except:
-                    logging.error("cansas_reader.read: error processing process term\n  %s" % sys.exc_value)
+                    err_mess = "cansas_reader.read: error processing process term\n  %s" % sys.exc_value
+                    self.errors.append(err_mess)
+                    logging.error(err_mess)
             
             note_list = item.xpath('ns:SASprocessnote', namespaces={'ns': CANSAS_NS})
@@ -756,5 +708,81 @@
         fd.close()
         
-        
+    def _store_float(self, location, node, variable, storage, optional=True):
+        """
+            Get the content of a xpath location and store
+            the result. Check that the units are compatible
+            with the destination. The value is expected to
+            be a float.
+            
+            The xpath location might or might not exist.
+            If it does not exist, nothing is done
+            
+            @param location: xpath location to fetch
+            @param node: node to read the data from
+            @param variable: name of the data member to store it in [string]
+            @param storage: data object that has the 'variable' data member
+            @param optional: if True, no exception will be raised if unit conversion can't be done
+    
+            @raise ValueError: raised when the units are not recognized
+        """
+        entry = get_content(location, node)
+        try:
+            value = float(entry.text)
+        except:
+            value = None
+            
+        if value is not None:
+            # If the entry has units, check to see that they are
+            # compatible with what we currently have in the data object
+            units = entry.get('unit')
+            if units is not None:
+                toks = variable.split('.')
+                exec "local_unit = storage.%s_unit" % toks[0]
+                if units.lower()!=local_unit.lower():
+                    if has_converter==True:
+                        try:
+                            conv = Converter(units)
+                            exec "storage.%s = %g" % (variable, conv(value, units=local_unit))
+                        except:
+                            err_mess = "CanSAS reader: could not convert %s unit [%s]; expecting [%s]\n  %s" \
+                                % (variable, units, local_unit, sys.exc_value)
+                            self.errors.append(err_mess)
+                            if optional:
+                                logging.info(err_mess)
+                            else:
+                                raise ValueError, err_mess 
+                    else:
+                        err_mess = "CanSAS reader: unrecognized %s unit [%s]; expecting [%s]" \
+                            % (variable, units, local_unit)
+                        self.errors.append(err_mess)
+                        if optional:
+                            logging.info(err_mess)
+                        else:
+                            raise ValueError, err_mess
+                else:
+                    exec "storage.%s = value" % variable
+            else:
+                exec "storage.%s = value" % variable
+                
+    def _store_content(self, location, node, variable, storage):
+        """
+            Get the content of a xpath location and store
+            the result. The value is treated as a string.
+            
+            The xpath location might or might not exist.
+            If it does not exist, nothing is done
+            
+            @param location: xpath location to fetch
+            @param node: node to read the data from
+            @param variable: name of the data member to store it in [string]
+            @param storage: data object that has the 'variable' data member
+            @return: return a list of errors
+        """
+        entry = get_content(location, node)
+        if entry is not None and entry.text is not None:
+            exec "storage.%s = entry.text.strip()" % variable
+
+            
+            
 if __name__ == "__main__": 
     logging.basicConfig(level=logging.ERROR,
Index: DataLoader/readers/danse_reader.py
===================================================================
--- DataLoader/readers/danse_reader.py	(revision 28caa03404030faac2dd29ba6ae3e5afc427a99b)
+++ DataLoader/readers/danse_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -275,5 +275,8 @@
             else:
                 logging.info("Danse_reader Reading %s \n"%filename)
-                return output
+            
+            # Store loading process information
+            output.meta_data['loader'] = self.type_name    
+            return output
         
         return None
Index: DataLoader/readers/hfir1d_reader.py
===================================================================
--- DataLoader/readers/hfir1d_reader.py	(revision 28caa03404030faac2dd29ba6ae3e5afc427a99b)
+++ DataLoader/readers/hfir1d_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -120,4 +120,6 @@
                     output.yaxis("\\rm{Intensity}","cm^{-1}")
                 
+                # Store loading process information
+                output.meta_data['loader'] = self.type_name   
                 return output
         else:
Index: DataLoader/readers/tiff_reader.py
===================================================================
--- DataLoader/readers/tiff_reader.py	(revision 28caa03404030faac2dd29ba6ae3e5afc427a99b)
+++ DataLoader/readers/tiff_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -95,4 +95,6 @@
         output.ymax       = im.size[0]-1
         
+        # Store loading process information
+        output.meta_data['loader'] = self.type_name 
         return output
         
Index: DataLoader/test/cansas1d_badunits.xml
===================================================================
--- DataLoader/test/cansas1d_badunits.xml	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
+++ DataLoader/test/cansas1d_badunits.xml	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -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/nm">0.002</Q>
+				<I unit="1/nm">1</I>
+				<Idev unit="1/nm">.003</Idev>
+				<Qdev unit="1/nm">0.001</Qdev>
+				<Qmean unit="1/A"><!-- Qmean is optional --></Qmean>
+				<Shadowfactor><!-- Shadowfactor is optional --></Shadowfactor>
+			</Idata>
+			<Idata>
+				<Q unit="1/nm">0.003</Q>
+				<I unit="1/nm">1.001</I>
+				<Idev unit="1/nm">.004</Idev>
+				<Qdev unit="1/nm">0.002</Qdev>
+				<Qmean unit="1/A"><!-- Qmean is optional --></Qmean>
+				<Shadowfactor><!-- Shadowfactor is optional --></Shadowfactor>
+			</Idata>
+		</SASdata>
+		<SASsample name='my sample'>
+			<ID>SI600-new-long</ID>
+			<thickness unit="mff">0.00103</thickness>
+			<transmission>0.327</transmission>
+			<temperature unit="C">0.0000</temperature>
+			<position>
+				<x unit="nm">10000000.00</x>
+				<y unit="mm">0.00</y>
+			</position>
+			<orientation>
+				<roll unit="rad">0.39269908<!-- was: sample_orientation --></roll>
+				<pitch unit="rad">3.4906585e-4<!-- 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="m">.01200</x>
+					<y unit="micrometer">13000.00</y>
+				</beam_size>
+				<beam_shape>disc</beam_shape>
+				<wavelength unit="nm">0.600</wavelength>
+				<wavelength_min unit="A">02.2</wavelength_min>
+				<wavelength_max unit="A">10.0</wavelength_max>
+				<wavelength_spread unit="percent">
+					14.3
+				</wavelength_spread>
+			</SASsource>
+			<SAScollimation name="test coll name">
+				<length unit='m'> 0.123</length>
+				<aperture name="source" type="radius">
+					<size>
+						<x unit="micron">50000</x>
+					</size>
+					<distance unit="cm">1100.000<!-- was: distance_coll --></distance>
+				</aperture>
+				<aperture name="sample" type="radius">
+					<size name='size name'>
+						<x unit="cm">.1</x>
+					</size>
+				</aperture>
+			</SAScollimation>
+			<SASdetector>
+				<name>fictional hybrid</name>
+				<SDD unit="m">
+					<!-- sample-to-detector distance -->
+					4.150
+				</SDD>
+				<orientation>
+					<roll unit="radian">.0174533</roll>
+					<pitch unit="rad">0.00</pitch>
+					<yaw unit="radian">0.00</yaw>
+				</orientation>
+				<offset>
+					<x unit="nm">1000000</x>
+					<y unit="micron">2000</y>
+				</offset>
+				<beam_center>
+					<x unit="m">.32264</x>
+					<y unit="m">.32768</y>
+				</beam_center>
+				<pixel_size>
+					<x unit="cm">.500</x>
+					<y unit="cm">.500</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="rad">4.1416</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 d00f8ff74790ad97d3fddff0a584009680fdda7d)
+++ DataLoader/test/utest_abs_reader.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -13,5 +13,6 @@
     
     def setUp(self):
-        self.data = Loader().load("jan08002.ABS")
+        from DataLoader.readers.abs_reader import Reader
+        self.data = Reader().read("jan08002.ABS")
         
     def test_checkdata(self):
@@ -24,4 +25,5 @@
         """
         self.assertEqual(self.data.filename, "jan08002.ABS")
+        self.assertEqual(self.data.meta_data['loader'], "IGOR 1D")
         
         self.assertEqual(self.data.source.wavelength_unit, 'A')
@@ -69,4 +71,6 @@
         """
         self.assertEqual(self.data.filename, "S2-30dq.d1d")
+        # THIS FILE FORMAT IS CURRENTLY READ BY THE ASCII READER
+        self.assertEqual(self.data.meta_data['loader'], "ASCII")
         self.assertEqual(len(self.data.x), 134)
         self.assertEqual(len(self.data.y), 134)
@@ -93,4 +97,5 @@
         """
         self.assertEqual(self.data.filename, "MAR07232_rest.ASC")
+        self.assertEqual(self.data.meta_data['loader'], "IGOR 2D")
         
         self.assertEqual(self.data.source.wavelength_unit, 'A')
@@ -127,4 +132,5 @@
         """
         self.assertEqual(self.data.filename, "MP_New.sans")
+        self.assertEqual(self.data.meta_data['loader'], "DANSE")
         
         self.assertEqual(self.data.source.wavelength_unit, 'A')
@@ -169,4 +175,6 @@
         
         self.assertEqual(self.data.run[0], "1234")
+        self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D")
+        self.assertEqual(len(self.data.errors), 0)
         
         # Data
@@ -325,4 +333,20 @@
         self._checkdata()
         
+    def test_badunits(self):
+        """
+            Check units.
+            Note that not all units are available.
+        """
+        filename = "cansas1d_badunits.xml"
+        self.data = Loader().load(filename)
+        self.assertEqual(self.data.filename, filename)
+        # The followed should not have been loaded
+        self.assertEqual(self.data.sample.thickness, None)
+        # This one should
+        self.assertEqual(self.data.sample.transmission, 0.327)
+        
+        self.assertEqual(self.data.meta_data['loader'], "CanSAS 1D")
+        self.assertEqual(len(self.data.errors), 1)
+        
         
     def test_slits(self):
@@ -356,4 +380,9 @@
 
 if __name__ == '__main__':
+    import logging
+    logging.basicConfig(level=logging.INFO,
+                        format='%(asctime)s %(levelname)s %(message)s',
+                        filename='utest_abs_reader.log',
+                        filemode='w')
     unittest.main()
    
Index: DataLoader/test/utest_ascii.py
===================================================================
--- DataLoader/test/utest_ascii.py	(revision af76bd97dd976b5b69fb9ec4ee74d0d1fcf40fa6)
+++ DataLoader/test/utest_ascii.py	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -24,4 +24,6 @@
         self.assertEqual(f.x[0],0.002618)
         self.assertEqual(f.x[9],0.0497)
+        
+        self.assertEqual(f.meta_data['loader'],"ASCII")
         
     def test_truncated_1(self):
Index: DataLoader/test/write_test.xml
===================================================================
--- DataLoader/test/write_test.xml	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
+++ DataLoader/test/write_test.xml	(revision fe78c7be16b3ca74072592fdeda007c4a989ce82)
@@ -0,0 +1,250 @@
+<?xml version="1.0" ?>
+<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.0
+				</I>
+				<Qdev unit="1/A">
+					0.01
+				</Qdev>
+				<Idev unit="1/cm">
+					3.0
+				</Idev>
+			</Idata>
+			<Idata>
+				<Q unit="1/A">
+					0.03
+				</Q>
+				<I unit="1/cm">
+					1001.0
+				</I>
+				<Qdev unit="1/A">
+					0.02
+				</Qdev>
+				<Idev unit="1/cm">
+					4.0
+				</Idev>
+			</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.0
+			</temperature>
+			<details>
+				http://chemtools.chem.soton.ac.uk/projects/blog/blogs.php/bit_id/2720
+			</details>
+			<details>
+				Some text here
+			</details>
+			<position>
+				<x unit="mm">
+					10.0
+				</x>
+				<y unit="mm">
+					0.0
+				</y>
+			</position>
+			<orientation>
+				<roll unit="degree">
+					22.5
+				</roll>
+				<pitch unit="degree">
+					0.02
+				</pitch>
+			</orientation>
+		</SASsample>
+		<SASinstrument>
+			<name>
+				canSAS instrument
+			</name>
+			<SASsource name="source name">
+				<radiation>
+					neutron
+				</radiation>
+				<beam_shape>
+					disc
+				</beam_shape>
+				<beam_size name="bm">
+					<x unit="mm">
+						12.0
+					</x>
+					<y unit="mm">
+						13.0
+					</y>
+				</beam_size>
+				<wavelength unit="A">
+					6.0
+				</wavelength>
+				<wavelength_min unit="nm">
+					0.22
+				</wavelength_min>
+				<wavelength_max unit="nm">
+					1.0
+				</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">
+					<distance unit="mm">
+						11000
+					</distance>
+					<size>
+						<x unit="mm">
+							50.0
+						</x>
+					</size>
+				</aperture>
+				<aperture name="sample" type="radius">
+					<size name="size name">
+						<x unit="mm">
+							1.0
+						</x>
+					</size>
+				</aperture>
+			</SAScollimation>
+			<SASdetector>
+				<name>
+					fictional hybrid
+				</name>
+				<SDD unit="mm">
+					4150
+				</SDD>
+				<offset>
+					<x unit="m">
+						0.001
+					</x>
+					<y unit="m">
+						0.002
+					</y>
+				</offset>
+				<beam_center>
+					<x unit="mm">
+						322.64
+					</x>
+					<y unit="mm">
+						327.68
+					</y>
+				</beam_center>
+				<pixel_size>
+					<x unit="mm">
+						5.0
+					</x>
+					<y unit="mm">
+						5.0
+					</y>
+				</pixel_size>
+				<orientation>
+					<roll unit="degree">
+						1.0
+					</roll>
+					<pitch unit="degree">
+						0.0
+					</pitch>
+					<yaw unit="degree">
+						0.0
+					</yaw>
+				</orientation>
+			</SASdetector>
+		</SASinstrument>
+		<SASprocess>
+			<name>
+				spol
+			</name>
+			<date>
+				04-Sep-2007 18:35:02
+			</date>
+			<description>
+				
+			</description>
+			<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>
+				
+			</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>
+		</SASprocess>
+	</SASentry>
+</SASroot>
