Index: DataLoader/readers/red2d_reader.py
===================================================================
--- DataLoader/readers/red2d_reader.py	(revision ec02ddd7e0ee95fb9746829dffba3785538c0584)
+++ DataLoader/readers/red2d_reader.py	(revision 22b3fe15181ee3ceab08875646232cc70efbd3e5)
@@ -138,4 +138,6 @@
         #Read Header and find the dimensions of 2D data
         line_num = 0
+        # Old version NIST files: 0
+        ver = 0
         for line in lines:      
             line_num += 1
@@ -188,7 +190,10 @@
             if line.count("BCENT") > 0:
                 isCenter = True
-                       
+            # Check version
+            if line.count("Data columns") > 0:
+                if line.count("err(I)") > 0:
+                    ver = 1
             # Find data start
-            if line.count("Data columns") or line.count("ASCII data") > 0:
+            if line.count("ASCII data") > 0:
                 dataStarted = True
                 continue
@@ -229,5 +234,5 @@
         #data_list = map(float,data_list)
         data_list1 = map(check_point,data_list)
-      
+
         # numpy array form
         data_array = numpy.array(data_list1)
@@ -239,9 +244,9 @@
             msg = "red2d_reader: Can't read this file: Not a proper file format"
             raise ValueError, msg
-        
         ## Get the all data: Let's HARDcoding; Todo find better way
         # Defaults
         dqx_data = numpy.zeros(0)
         dqy_data = numpy.zeros(0)
+        err_data = numpy.ones(row_num)
         qz_data = numpy.zeros(row_num)
         mask = numpy.ones(row_num,dtype=bool)
@@ -250,8 +255,10 @@
         qy_data = data_point[1]
         data = data_point[2]
-        if col_num > 3: qz_data = data_point[3]
-        if col_num > 4: dqx_data = data_point[4]
-        if col_num > 5: dqy_data = data_point[5]
-        if col_num > 6: mask[data_point[6] < 1] = False
+        if ver == 1:
+            if col_num > (2 + ver): err_data = data_point[(2 + ver)]
+        if col_num > (3 + ver): qz_data = data_point[(3 + ver)]
+        if col_num > (4 + ver): dqx_data = data_point[(4 + ver)]
+        if col_num > (5 + ver): dqy_data = data_point[(5 + ver)]
+        #if col_num > (6 + ver): mask[data_point[(6 + ver)] < 1] = False
         q_data = numpy.sqrt(qx_data*qx_data+qy_data*qy_data+qz_data*qz_data)
            
@@ -259,5 +266,5 @@
         # If all mask elements are False, put all True
         if not mask.any(): mask[mask==False] = True   
-            
+  
         # Store limits of the image in q space
         xmin    = numpy.min(qx_data)
@@ -298,5 +305,10 @@
         #TODO: Check the lengths 
         output.data     = data
-        output.err_data = numpy.sqrt(numpy.abs(data))
+        if (err_data == 1).all():
+            output.err_data = numpy.sqrt(numpy.abs(data))
+            output.err_data[output.err_data == 0.0] = 1.0
+        else:
+            output.err_data = err_data
+            
         output.qx_data  = qx_data
         output.qy_data  = qy_data             
@@ -326,7 +338,22 @@
             #(1 axis dq is not supported yet).
             if len(dqy_data) == len(qy_data) and dqy_data.any()!=0:
-                output.dqx_data = dqx_data
-                output.dqy_data = dqy_data
-        
+                # Currently we do not support dq parr, perp.
+                # tranfer the comp. to cartesian coord. for newer version.
+                if ver == 1:
+                    diag = numpy.sqrt(qx_data * qx_data + qy_data * qy_data)
+                    cos_th = qx_data / diag
+                    sin_th = qy_data / diag
+                    output.dqx_data = numpy.sqrt((dqx_data * cos_th) * \
+                                                 (dqx_data * cos_th) \
+                                                 + ( dqy_data * sin_th) * \
+                                                  ( dqy_data * sin_th))
+                    output.dqy_data = numpy.sqrt((dqx_data * sin_th) * \
+                                                 (dqx_data * sin_th) \
+                                                 + ( dqy_data * cos_th) * \
+                                                  ( dqy_data * cos_th))
+                else:
+                    output.dqx_data = dqx_data
+                    output.dqy_data = dqy_data
+
         # Units of axes
         if data_conv_q is not None:
