Ignore:
Timestamp:
Oct 11, 2018 11:59:57 AM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1249
Children:
88d2e70
Parents:
67ed543
Message:

remove errors and warnings from py37 tests of sascalc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/manipulations.py

    r574adc7 re090ba90  
    928928 
    929929        # Organize the results 
    930         for i in range(self.nbins): 
    931             y[i] = y[i] / y_counts[i] 
    932             y_err[i] = math.sqrt(y_err[i]) / y_counts[i] 
    933  
     930        with np.errstate(divide='ignore', invalid='ignore'): 
     931            y = y/y_counts 
     932            y_err = np.sqrt(y_err)/y_counts 
    934933            # The type of averaging: phi,q2, or q 
    935934            # Calculate x[i]should be at the center of the bin 
    936935            if run.lower() == 'phi': 
    937                 x[i] = (self.phi_max - self.phi_min) / self.nbins * \ 
    938                     (1.0 * i + 0.5) + self.phi_min 
     936                step  = (self.phi_max - self.phi_min) / self.nbins 
     937                x = (np.arange(self.nbins) + 0.5) * step + self.phi_min 
    939938            else: 
    940939                # We take the center of ring area, not radius. 
     
    944943                # r_outer = r_inner + delta_r 
    945944                # x[i] = math.sqrt((r_inner * r_inner + r_outer * r_outer) / 2) 
    946                 x[i] = x[i] / y_counts[i] 
    947         y_err[y_err == 0] = np.average(y_err) 
     945                x = x/y_counts 
     946 
    948947        idx = (np.isfinite(y) & np.isfinite(y_err)) 
    949948        if x_err is not None: 
Note: See TracChangeset for help on using the changeset viewer.