Index: src/sas/sascalc/dataloader/manipulations.py
===================================================================
--- src/sas/sascalc/dataloader/manipulations.py	(revision b2b3693291d8e49fd33718753161206c1964548c)
+++ src/sas/sascalc/dataloader/manipulations.py	(revision 9a5097cd1c76689d1f997b85ba43d12a95d8f243)
@@ -14,5 +14,5 @@
 #TODO: copy the meta data from the 2D object to the resulting 1D object
 import math
-import numpy
+import numpy as np
 
 #from data_info import plottable_2D
@@ -82,6 +82,6 @@
     if data2d.data == None or data2d.x_bins == None or data2d.y_bins == None:
         raise ValueError, "Can't convert this data: data=None..."
-    new_x = numpy.tile(data2d.x_bins, (len(data2d.y_bins), 1))
-    new_y = numpy.tile(data2d.y_bins, (len(data2d.x_bins), 1))
+    new_x = np.tile(data2d.x_bins, (len(data2d.y_bins), 1))
+    new_y = np.tile(data2d.y_bins, (len(data2d.x_bins), 1))
     new_y = new_y.swapaxes(0, 1)
 
@@ -89,10 +89,10 @@
     qx_data = new_x.flatten()
     qy_data = new_y.flatten()
-    q_data = numpy.sqrt(qx_data * qx_data + qy_data * qy_data)
-    if data2d.err_data == None or numpy.any(data2d.err_data <= 0):
-        new_err_data = numpy.sqrt(numpy.abs(new_data))
+    q_data = np.sqrt(qx_data * qx_data + qy_data * qy_data)
+    if data2d.err_data == None or np.any(data2d.err_data <= 0):
+        new_err_data = np.sqrt(np.abs(new_data))
     else:
         new_err_data = data2d.err_data.flatten()
-    mask = numpy.ones(len(new_data), dtype=bool)
+    mask = np.ones(len(new_data), dtype=bool)
 
     #TODO: make sense of the following two lines...
@@ -149,8 +149,8 @@
 
         # Get data
-        data = data2D.data[numpy.isfinite(data2D.data)]
-        err_data = data2D.err_data[numpy.isfinite(data2D.data)]
-        qx_data = data2D.qx_data[numpy.isfinite(data2D.data)]
-        qy_data = data2D.qy_data[numpy.isfinite(data2D.data)]
+        data = data2D.data[np.isfinite(data2D.data)]
+        err_data = data2D.err_data[np.isfinite(data2D.data)]
+        qx_data = data2D.qx_data[np.isfinite(data2D.data)]
+        qy_data = data2D.qy_data[np.isfinite(data2D.data)]
 
         # Build array of Q intervals
@@ -170,8 +170,8 @@
             raise RuntimeError, "_Slab._avg: unrecognized axis %s" % str(maj)
 
-        x = numpy.zeros(nbins)
-        y = numpy.zeros(nbins)
-        err_y = numpy.zeros(nbins)
-        y_counts = numpy.zeros(nbins)
+        x = np.zeros(nbins)
+        y = np.zeros(nbins)
+        err_y = np.zeros(nbins)
+        y_counts = np.zeros(nbins)
 
         # Average pixelsize in q space
@@ -225,5 +225,5 @@
         y = y / y_counts
         x = x / y_counts
-        idx = (numpy.isfinite(y) & numpy.isfinite(x))
+        idx = (np.isfinite(y) & np.isfinite(x))
 
         if not idx.any():
@@ -304,8 +304,8 @@
             raise RuntimeError, msg
         # Get data
-        data = data2D.data[numpy.isfinite(data2D.data)]
-        err_data = data2D.err_data[numpy.isfinite(data2D.data)]
-        qx_data = data2D.qx_data[numpy.isfinite(data2D.data)]
-        qy_data = data2D.qy_data[numpy.isfinite(data2D.data)]
+        data = data2D.data[np.isfinite(data2D.data)]
+        err_data = data2D.err_data[np.isfinite(data2D.data)]
+        qx_data = data2D.qx_data[np.isfinite(data2D.data)]
+        qy_data = data2D.qy_data[np.isfinite(data2D.data)]
 
         y = 0.0
@@ -414,8 +414,8 @@
         """
         # Get data W/ finite values
-        data = data2D.data[numpy.isfinite(data2D.data)]
-        q_data = data2D.q_data[numpy.isfinite(data2D.data)]
-        err_data = data2D.err_data[numpy.isfinite(data2D.data)]
-        mask_data = data2D.mask[numpy.isfinite(data2D.data)]
+        data = data2D.data[np.isfinite(data2D.data)]
+        q_data = data2D.q_data[np.isfinite(data2D.data)]
+        err_data = data2D.err_data[np.isfinite(data2D.data)]
+        mask_data = data2D.mask[np.isfinite(data2D.data)]
 
         dq_data = None
@@ -448,18 +448,18 @@
             dq_overlap_y *= dq_overlap_y
 
-            dq_overlap = numpy.sqrt((dq_overlap_x + dq_overlap_y) / 2.0)
+            dq_overlap = np.sqrt((dq_overlap_x + dq_overlap_y) / 2.0)
             # Final protection of dq
             if dq_overlap < 0:
                 dq_overlap = y_min
-            dqx_data = data2D.dqx_data[numpy.isfinite(data2D.data)]
-            dqy_data = data2D.dqy_data[numpy.isfinite(data2D.data)] - dq_overlap
+            dqx_data = data2D.dqx_data[np.isfinite(data2D.data)]
+            dqy_data = data2D.dqy_data[np.isfinite(data2D.data)] - dq_overlap
             # def; dqx_data = dq_r dqy_data = dq_phi
             # Convert dq 2D to 1D here
             dqx = dqx_data * dqx_data
             dqy = dqy_data * dqy_data
-            dq_data = numpy.add(dqx, dqy)
-            dq_data = numpy.sqrt(dq_data)
-
-        #q_data_max = numpy.max(q_data)
+            dq_data = np.add(dqx, dqy)
+            dq_data = np.sqrt(dq_data)
+
+        #q_data_max = np.max(q_data)
         if len(data2D.q_data) == None:
             msg = "Circular averaging: invalid q_data: %g" % data2D.q_data
@@ -469,9 +469,9 @@
         nbins = int(math.ceil((self.r_max - self.r_min) / self.bin_width))
 
-        x = numpy.zeros(nbins)
-        y = numpy.zeros(nbins)
-        err_y = numpy.zeros(nbins)
-        err_x = numpy.zeros(nbins)
-        y_counts = numpy.zeros(nbins)
+        x = np.zeros(nbins)
+        y = np.zeros(nbins)
+        err_y = np.zeros(nbins)
+        err_x = np.zeros(nbins)
+        y_counts = np.zeros(nbins)
 
         for npt in range(len(data)):
@@ -527,8 +527,8 @@
 
         err_y = err_y / y_counts
-        err_y[err_y == 0] = numpy.average(err_y)
+        err_y[err_y == 0] = np.average(err_y)
         y = y / y_counts
         x = x / y_counts
-        idx = (numpy.isfinite(y)) & (numpy.isfinite(x))
+        idx = (np.isfinite(y)) & (np.isfinite(x))
 
         if err_x != None:
@@ -585,15 +585,15 @@
 
         # Get data
-        data = data2D.data[numpy.isfinite(data2D.data)]
-        q_data = data2D.q_data[numpy.isfinite(data2D.data)]
-        err_data = data2D.err_data[numpy.isfinite(data2D.data)]
-        qx_data = data2D.qx_data[numpy.isfinite(data2D.data)]
-        qy_data = data2D.qy_data[numpy.isfinite(data2D.data)]
+        data = data2D.data[np.isfinite(data2D.data)]
+        q_data = data2D.q_data[np.isfinite(data2D.data)]
+        err_data = data2D.err_data[np.isfinite(data2D.data)]
+        qx_data = data2D.qx_data[np.isfinite(data2D.data)]
+        qy_data = data2D.qy_data[np.isfinite(data2D.data)]
 
         # Set space for 1d outputs
-        phi_bins = numpy.zeros(self.nbins_phi)
-        phi_counts = numpy.zeros(self.nbins_phi)
-        phi_values = numpy.zeros(self.nbins_phi)
-        phi_err = numpy.zeros(self.nbins_phi)
+        phi_bins = np.zeros(self.nbins_phi)
+        phi_counts = np.zeros(self.nbins_phi)
+        phi_values = np.zeros(self.nbins_phi)
+        phi_err = np.zeros(self.nbins_phi)
 
         # Shift to apply to calculated phi values in order
@@ -636,5 +636,5 @@
             phi_values[i] = 2.0 * math.pi / self.nbins_phi * (1.0 * i)
 
-        idx = (numpy.isfinite(phi_bins))
+        idx = (np.isfinite(phi_bins))
 
         if not idx.any():
@@ -769,9 +769,9 @@
 
         # Get the all data & info
-        data = data2D.data[numpy.isfinite(data2D.data)]
-        q_data = data2D.q_data[numpy.isfinite(data2D.data)]
-        err_data = data2D.err_data[numpy.isfinite(data2D.data)]
-        qx_data = data2D.qx_data[numpy.isfinite(data2D.data)]
-        qy_data = data2D.qy_data[numpy.isfinite(data2D.data)]
+        data = data2D.data[np.isfinite(data2D.data)]
+        q_data = data2D.q_data[np.isfinite(data2D.data)]
+        err_data = data2D.err_data[np.isfinite(data2D.data)]
+        qx_data = data2D.qx_data[np.isfinite(data2D.data)]
+        qy_data = data2D.qy_data[np.isfinite(data2D.data)]
         dq_data = None
 
@@ -803,22 +803,22 @@
             dq_overlap_y *= dq_overlap_y
 
-            dq_overlap = numpy.sqrt((dq_overlap_x + dq_overlap_y) / 2.0)
+            dq_overlap = np.sqrt((dq_overlap_x + dq_overlap_y) / 2.0)
             if dq_overlap < 0:
                 dq_overlap = y_min
-            dqx_data = data2D.dqx_data[numpy.isfinite(data2D.data)]
-            dqy_data = data2D.dqy_data[numpy.isfinite(data2D.data)] - dq_overlap
+            dqx_data = data2D.dqx_data[np.isfinite(data2D.data)]
+            dqy_data = data2D.dqy_data[np.isfinite(data2D.data)] - dq_overlap
             # def; dqx_data = dq_r dqy_data = dq_phi
             # Convert dq 2D to 1D here
             dqx = dqx_data * dqx_data
             dqy = dqy_data * dqy_data
-            dq_data = numpy.add(dqx, dqy)
-            dq_data = numpy.sqrt(dq_data)
+            dq_data = np.add(dqx, dqy)
+            dq_data = np.sqrt(dq_data)
 
         #set space for 1d outputs
-        x = numpy.zeros(self.nbins)
-        y = numpy.zeros(self.nbins)
-        y_err = numpy.zeros(self.nbins)
-        x_err = numpy.zeros(self.nbins)
-        y_counts = numpy.zeros(self.nbins)
+        x = np.zeros(self.nbins)
+        y = np.zeros(self.nbins)
+        y_err = np.zeros(self.nbins)
+        x_err = np.zeros(self.nbins)
+        y_counts = np.zeros(self.nbins)
 
         # Get the min and max into the region: 0 <= phi < 2Pi
@@ -923,6 +923,6 @@
                 #x[i] = math.sqrt((r_inner * r_inner + r_outer * r_outer) / 2)
                 x[i] = x[i] / y_counts[i]
-        y_err[y_err == 0] = numpy.average(y_err)
-        idx = (numpy.isfinite(y) & numpy.isfinite(y_err))
+        y_err[y_err == 0] = np.average(y_err)
+        idx = (np.isfinite(y) & np.isfinite(y_err))
         if x_err != None:
             d_x = x_err[idx] / y_counts[idx]
@@ -1012,5 +1012,5 @@
         qx_data = data2D.qx_data
         qy_data = data2D.qy_data
-        q_data = numpy.sqrt(qx_data * qx_data + qy_data * qy_data)
+        q_data = np.sqrt(qx_data * qx_data + qy_data * qy_data)
 
         # check whether or not the data point is inside ROI
@@ -1113,5 +1113,5 @@
 
         # get phi from data
-        phi_data = numpy.arctan2(qy_data, qx_data)
+        phi_data = np.arctan2(qy_data, qx_data)
 
         # Get the min and max into the region: -pi <= phi < Pi
