Ignore:
Timestamp:
Mar 26, 2017 11:33:16 PM (8 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/data_util/qsmearing.py

    r775e0b7 r9a5097c  
    99#copyright 2008, University of Tennessee 
    1010###################################################################### 
    11 import numpy 
    1211import math 
    1312import logging 
     
    6059    if data.dx is not None and data.isSesans: 
    6160        #if data.dx[0] > 0.0: 
    62         if numpy.size(data.dx[data.dx <= 0]) == 0: 
     61        if np.size(data.dx[data.dx <= 0]) == 0: 
    6362            _found_sesans = True 
    6463        # if data.dx[0] <= 0.0: 
    65         if numpy.size(data.dx[data.dx <= 0]) > 0: 
     64        if np.size(data.dx[data.dx <= 0]) > 0: 
    6665            raise ValueError('one or more of your dx values are negative, please check the data file!') 
    6766 
     
    121120        self.resolution = resolution 
    122121        if offset is None: 
    123             offset = numpy.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 
     122            offset = np.searchsorted(self.resolution.q_calc, self.resolution.q[0]) 
    124123        self.offset = offset 
    125124 
     
    137136        start, end = first_bin + self.offset, last_bin + self.offset 
    138137        q_calc = self.resolution.q_calc 
    139         iq_calc = numpy.empty_like(q_calc) 
     138        iq_calc = np.empty_like(q_calc) 
    140139        if start > 0: 
    141140            iq_calc[:start] = self.model.evalDistribution(q_calc[:start]) 
     
    157156        """ 
    158157        q = self.resolution.q 
    159         first = numpy.searchsorted(q, q_min) 
    160         last = numpy.searchsorted(q, q_max) 
     158        first = np.searchsorted(q, q_min) 
     159        last = np.searchsorted(q, q_max) 
    161160        return first, min(last,len(q)-1) 
    162161 
Note: See TracChangeset for help on using the changeset viewer.