Ignore:
Timestamp:
Mar 26, 2017 9:33:16 PM (7 years ago)
Author:
andyfaff
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ed2276f
Parents:
9146ed9
Message:

MAINT: import numpy as np

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/ascii_reader.py

    rd2471870 r9a5097c  
    1414 
    1515 
    16 import numpy 
     16import numpy as np 
    1717import os 
    1818from sas.sascalc.dataloader.data_info import Data1D 
     
    6969 
    7070                # Arrays for data storage 
    71                 tx = numpy.zeros(0) 
    72                 ty = numpy.zeros(0) 
    73                 tdy = numpy.zeros(0) 
    74                 tdx = numpy.zeros(0) 
     71                tx = np.zeros(0) 
     72                ty = np.zeros(0) 
     73                tdy = np.zeros(0) 
     74                tdx = np.zeros(0) 
    7575 
    7676                # The first good line of data will define whether 
     
    140140                            is_data == False: 
    141141                            try: 
    142                                 tx = numpy.zeros(0) 
    143                                 ty = numpy.zeros(0) 
    144                                 tdy = numpy.zeros(0) 
    145                                 tdx = numpy.zeros(0) 
     142                                tx = np.zeros(0) 
     143                                ty = np.zeros(0) 
     144                                tdy = np.zeros(0) 
     145                                tdx = np.zeros(0) 
    146146                            except: 
    147147                                pass 
    148148 
    149149                        if has_error_dy == True: 
    150                             tdy = numpy.append(tdy, _dy) 
     150                            tdy = np.append(tdy, _dy) 
    151151                        if has_error_dx == True: 
    152                             tdx = numpy.append(tdx, _dx) 
    153                         tx = numpy.append(tx, _x) 
    154                         ty = numpy.append(ty, _y) 
     152                            tdx = np.append(tdx, _dx) 
     153                        tx = np.append(tx, _x) 
     154                        ty = np.append(ty, _y) 
    155155 
    156156                        #To remember the # of columns on the current line 
     
    188188                #Let's re-order the data to make cal. 
    189189                # curve look better some cases 
    190                 ind = numpy.lexsort((ty, tx)) 
    191                 x = numpy.zeros(len(tx)) 
    192                 y = numpy.zeros(len(ty)) 
    193                 dy = numpy.zeros(len(tdy)) 
    194                 dx = numpy.zeros(len(tdx)) 
     190                ind = np.lexsort((ty, tx)) 
     191                x = np.zeros(len(tx)) 
     192                y = np.zeros(len(ty)) 
     193                dy = np.zeros(len(tdy)) 
     194                dx = np.zeros(len(tdx)) 
    195195                output = Data1D(x, y, dy=dy, dx=dx) 
    196196                self.filename = output.filename = basename 
     
    212212                output.y = y[x != 0] 
    213213                output.dy = dy[x != 0] if has_error_dy == True\ 
    214                     else numpy.zeros(len(output.y)) 
     214                    else np.zeros(len(output.y)) 
    215215                output.dx = dx[x != 0] if has_error_dx == True\ 
    216                     else numpy.zeros(len(output.x)) 
     216                    else np.zeros(len(output.x)) 
    217217 
    218218                output.xaxis("\\rm{Q}", 'A^{-1}') 
Note: See TracChangeset for help on using the changeset viewer.