Index: DataLoader/notes.txt
===================================================================
--- DataLoader/notes.txt	(revision daa56d02ac884aa84b81111db375d2dab7e1edcf)
+++ DataLoader/notes.txt	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
@@ -1,2 +1,1 @@
 - Need support for images. tiff_reader.py needs to be tested.
-- Need support for zip file plugins for when we use py2exe.
Index: DataLoader/readers/hfir1d_reader.py
===================================================================
--- DataLoader/readers/hfir1d_reader.py	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
+++ DataLoader/readers/hfir1d_reader.py	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
@@ -0,0 +1,130 @@
+"""
+This software was developed by the University of Tennessee as part of the
+Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+project funded by the US National Science Foundation. 
+
+See the license text in license.txt
+
+copyright 2008, University of Tennessee
+"""
+
+import numpy
+import os
+from DataLoader.data_info import Data1D
+
+# Check whether we have a converter available
+has_converter = True
+try:
+    from data_util.nxsunit import Converter
+except:
+    has_converter = False
+
+class Reader(object):
+    """
+        Class to load HFIR 1D 4-column files
+    """
+    ## File type
+    type = ["HFIR 1D files (*.d1d)|*.d1d"]
+    ## List of allowed extensions
+    ext=['.d1d']  
+    
+    def read(self, path):
+        """ 
+            Load data file
+            
+            @param path: file path
+            @return: Data1D 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)
+            root, extension = os.path.splitext(basename)
+            if extension.lower() in self.ext:
+                try:
+                    input_f =  open(path,'r')
+                except :
+                    raise  RuntimeError, "hfir1d_reader: cannot open %s" % path
+                buff = input_f.read()
+                lines = buff.split('\n')
+                x  = numpy.zeros(0)
+                y  = numpy.zeros(0)
+                dx = numpy.zeros(0)
+                dy = numpy.zeros(0)
+                output = Data1D(x, y, dx=dx, dy=dy)
+                self.filename = output.filename = basename
+           
+                data_conv_q = None
+                data_conv_i = None
+                
+                if has_converter == True and output.x_unit != '1/A':
+                    data_conv_q = Converter('1/A')
+                    # Test it
+                    data_conv_q(1.0, output.x_unit)
+                    
+                if has_converter == True and output.y_unit != '1/cm':
+                    data_conv_i = Converter('1/cm')
+                    # Test it
+                    data_conv_i(1.0, output.y_unit)
+                           
+                for line in lines:
+                    toks = line.split()
+                    try:
+                        _x = float(toks[0])
+                        _y = float(toks[1])
+                        _dx = float(toks[3])
+                        _dy = float(toks[2])
+                        
+                        if data_conv_q is not None:
+                            _x = data_conv_q(_x, units=output.x_unit)
+                            _dx = data_conv_q(_dx, units=output.x_unit)
+                            
+                        if data_conv_i is not None:
+                            _y = data_conv_i(_y, units=output.y_unit)                        
+                            _dy = data_conv_i(_dy, units=output.y_unit)                        
+                                                    
+
+                        x   = numpy.append(x, _x) 
+                        y   = numpy.append(y, _y)
+                        dx  = numpy.append(dx, _dx)
+                        dy  = numpy.append(dy, _dy)                        
+                    except:
+                        # Couldn't parse this line, skip it 
+                        pass
+                         
+                     
+                # Sanity check
+                if not len(y) == len(dy):
+                    raise RuntimeError, "hfir1d_reader: y and dy have different length"
+                if not len(x) == len(dx):
+                    raise RuntimeError, "hfir1d_reader: x and dx have different length"
+
+                # If the data length is zero, consider this as
+                # though we were not able to read the file.
+                if len(x)==0:
+                    raise RuntimeError, "hfir1d_reader: could not load file"
+               
+                output.x = x
+                output.y = y
+                output.dy = dy
+                output.dx = dx
+                if data_conv_q is not None:
+                    output.xaxis("\\rm{Q}", output.x_unit)
+                else:
+                    output.xaxis("\\rm{Q}", 'A^{-1}')
+                if data_conv_i is not None:
+                    output.yaxis("\\{I(Q)}", output.y_unit)
+                else:
+                    output.yaxis("\\rm{I(Q)}","cm^{-1}")
+                
+                return output
+        else:
+            raise RuntimeError, "%s is not a file" % path
+        return None
+    
+if __name__ == "__main__": 
+    reader = Reader()
+    print reader.read("../test/S2-30dq.d1d")
+    
+    
+                        
Index: DataLoader/release_notes.txt
===================================================================
--- DataLoader/release_notes.txt	(revision 579ba85b3ae066f0c232974fcfbc64c128eec44f)
+++ DataLoader/release_notes.txt	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
@@ -7,5 +7,8 @@
 	- Release date: ?
 	- First version of CanSAS reader/writer
-	- 1D data manipulations available
+	- 1D and 2D data manipulations available
+	- 1D CanSAS writer available
+	- HFIR 1D 4-col reader available (*.d1d)
+	- Allows plugins through python source or zip files
 	
 	Version 0.1
Index: DataLoader/test/S2-30dq.d1d
===================================================================
--- DataLoader/test/S2-30dq.d1d	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
+++ DataLoader/test/S2-30dq.d1d	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
@@ -0,0 +1,134 @@
+0.000000	0.002950	    0.000567	0.008247
+0.003014	0.003010	    0.000315	0.008249
+0.006027	0.003084	    0.000270	0.008252
+0.009041	0.003119	    0.000221	0.008258
+0.012054	0.003327	    0.000221	0.008265
+0.015067	0.003225	    0.000200	0.008274
+0.018080	0.003362	    0.000225	0.008285
+0.021093	0.003365	    0.000202	0.008297
+0.024105	0.003540	    0.000205	0.008312
+0.027117	0.003508	    0.000201	0.008328
+0.030128	0.003661	    0.000211	0.008346
+0.033138	0.004016	    0.000236	0.008365
+0.036148	0.004666	    0.000270	0.008387
+0.039158	0.034288	    0.001752	0.008410
+0.042166	0.425503	    0.011896	0.008435
+0.045174	1.475945	    0.027787	0.008461
+0.048181	2.244056	    0.036616	0.008489
+0.051187	2.338684	    0.039997	0.008519
+0.054192	2.002295	    0.032145	0.008551
+0.057196	1.687026	    0.025300	0.008584
+0.060199	1.433134	    0.020717	0.008619
+0.063201	1.307086	    0.019885	0.008655
+0.066202	1.123490	    0.016574	0.008693
+0.069202	0.970546	    0.014224	0.008732
+0.072200	0.882704	    0.013446	0.008773
+0.075197	0.761977	    0.011665	0.008816
+0.078193	0.669466	    0.009830	0.008860
+0.081187	0.601099	    0.009282	0.008905
+0.084179	0.515879	    0.007613	0.008952
+0.087170	0.455008	    0.006677	0.009000
+0.090160	0.405245	    0.006086	0.009050
+0.093148	0.357576	    0.005549	0.009101
+0.096134	0.313114	    0.004792	0.009154
+0.099118	0.275679	    0.004295	0.009207
+0.102100	0.241687	    0.003817	0.009262
+0.105081	0.214123	    0.003522	0.009319
+0.108060	0.191283	    0.003304	0.009377
+0.111037	0.169340	    0.003194	0.009436
+0.114011	0.148193	    0.002869	0.009496
+0.116984	0.128917	    0.002550	0.009557
+0.119954	0.114015	    0.002350	0.009620
+0.122923	0.099329	    0.002161	0.009684
+0.125889	0.086567	    0.002063	0.009748
+0.128853	0.077225	    0.002016	0.009814
+0.131814	0.068015	    0.001846	0.009882
+0.134773	0.059221	    0.001759	0.009950
+0.137730	0.051170	    0.001566	0.010019
+0.140684	0.045517	    0.001523	0.010089
+0.143635	0.040138	    0.001487	0.010161
+0.146584	0.034817	    0.001356	0.010233
+0.149531	0.030886	    0.001329	0.010306
+0.152475	0.027638	    0.001341	0.010381
+0.155415	0.024419	    0.001282	0.010456
+0.158354	0.021799	    0.001257	0.010532
+0.161289	0.019441	    0.001217	0.010609
+0.164221	0.017663	    0.001188	0.010687
+0.167151	0.015951	    0.001159	0.010766
+0.170078	0.014820	    0.001173	0.010845
+0.173001	0.013679	    0.001178	0.010926
+0.175921	0.012938	    0.001147	0.011007
+0.178839	0.012056	    0.001157	0.011089
+0.181753	0.011225	    0.001124	0.011172
+0.184664	0.010612	    0.001174	0.011256
+0.187572	0.010183	    0.001236	0.011340
+0.190476	0.009791	    0.001210	0.011425
+0.193377	0.009604	    0.001229	0.011511
+0.196275	0.008896	    0.001194	0.011598
+0.199169	0.009057	    0.001208	0.011685
+0.202060	0.008678	    0.001199	0.011773
+0.204947	0.008825	    0.001250	0.011862
+0.207831	0.008604	    0.001262	0.011951
+0.210711	0.008522	    0.001230	0.012041
+0.213587	0.008612	    0.001249	0.012132
+0.216460	0.008626	    0.001277	0.012223
+0.219329	0.008487	    0.001305	0.012315
+0.222194	0.008400	    0.001293	0.012407
+0.225056	0.008465	    0.001242	0.012500
+0.227913	0.008333	    0.001259	0.012594
+0.230767	0.008191	    0.001263	0.012688
+0.233616	0.008295	    0.001256	0.012783
+0.236462	0.008345	    0.001238	0.012878
+0.239304	0.008564	    0.001282	0.012974
+0.242141	0.008321	    0.001260	0.013070
+0.244975	0.008592	    0.001267	0.013167
+0.247804	0.008598	    0.001253	0.013264
+0.250630	0.008671	    0.001269	0.013362
+0.253451	0.008519	    0.001331	0.013461
+0.256267	0.008123	    0.001215	0.013559
+0.259080	0.008541	    0.001222	0.013659
+0.261888	0.008186	    0.001238	0.013758
+0.264692	0.008386	    0.001283	0.013859
+0.267491	0.008436	    0.001276	0.013959
+0.270286	0.008392	    0.001263	0.014060
+0.273077	0.008246	    0.001236	0.014162
+0.275863	0.008533	    0.001286	0.014264
+0.278644	0.008021	    0.001209	0.014366
+0.281421	0.007843	    0.001227	0.014469
+0.284193	0.007855	    0.001259	0.014572
+0.286961	0.008037	    0.001233	0.014676
+0.289724	0.007724	    0.001226	0.014780
+0.292482	0.007862	    0.001239	0.014884
+0.295236	0.008066	    0.001237	0.014989
+0.297985	0.008320	    0.001285	0.015094
+0.300729	0.007980	    0.001213	0.015199
+0.303468	0.008066	    0.001245	0.015305
+0.306202	0.007857	    0.001198	0.015411
+0.308931	0.007975	    0.001173	0.015518
+0.311656	0.007737	    0.001246	0.015625
+0.314376	0.007929	    0.001209	0.015732
+0.317090	0.008120	    0.001212	0.015840
+0.319800	0.007825	    0.001198	0.015947
+0.322504	0.008239	    0.001290	0.016056
+0.325204	0.008118	    0.001252	0.016164
+0.327898	0.007811	    0.001206	0.016273
+0.330587	0.007637	    0.001173	0.016382
+0.333272	0.007916	    0.001221	0.016492
+0.335951	0.008030	    0.001220	0.016602
+0.338624	0.008072	    0.001131	0.016712
+0.341293	0.007986	    0.001244	0.016822
+0.343956	0.007830	    0.001368	0.016933
+0.346615	0.007580	    0.001440	0.017044
+0.349267	0.007906	    0.001546	0.017155
+0.351915	0.007404	    0.001601	0.017266
+0.354557	0.007657	    0.001775	0.017378
+0.357194	0.007266	    0.001829	0.017490
+0.359825	0.007696	    0.001873	0.017603
+0.362451	0.008356	    0.002254	0.017715
+0.365072	0.007734	    0.002492	0.017828
+0.367687	0.008076	    0.002661	0.017941
+0.370297	0.007791	    0.003077	0.018055
+0.372901	0.007797	    0.003795	0.018168
+0.375499	0.007782	    0.005681	0.018282
+0.378093	0.006695	    0.009273	0.018396
+0.380680	0.001744	    0.000058	0.018511
Index: DataLoader/test/utest_abs_reader.py
===================================================================
--- DataLoader/test/utest_abs_reader.py	(revision e3909330e1535bc5d73b41d2bca645ae2236eade)
+++ DataLoader/test/utest_abs_reader.py	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
@@ -57,4 +57,23 @@
     def test_checkdata2(self):
         self.assertEqual(self.data.dy[126], 1)
+        
+class hfir_reader(unittest.TestCase):
+    
+    def setUp(self):
+        self.data = Loader().load("S2-30dq.d1d")
+        
+    def test_checkdata(self):
+        """
+            Check the data content to see whether 
+            it matches the specific file we loaded.
+        """
+        self.assertEqual(self.data.filename, "S2-30dq.d1d")
+        #          Q           I               dI          dQ  
+        # Point 1: 0.003014    0.003010        0.000315    0.008249
+        self.assertEqual(self.data.x[1], 0.003014)
+        self.assertEqual(self.data.y[1], 0.003010)
+        self.assertEqual(self.data.dy[1], 0.000315)
+        self.assertEqual(self.data.dx[1], 0.008249)
+        
 
 class igor_reader(unittest.TestCase):
Index: DataLoader/test/write_test.xml
===================================================================
--- DataLoader/test/write_test.xml	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
+++ DataLoader/test/write_test.xml	(revision bee885e9167ee1682eceb5e5c2805ea0f688a26c)
@@ -0,0 +1,250 @@
+<?xml version="1.0" ?>
+<SASroot version="1.0">
+	<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>
