Ignore:
Timestamp:
Jan 18, 2011 8:38:36 AM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
18b89c4
Parents:
1b02da1d
Message:

replaced math.pow to numpy.power since math.pow is not working with list of x values(remember we use the list in fitting for speed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/BroadPeakModel.py

    r8f20419d r18695bf  
    55 
    66from sans.models.BaseComponent import BaseComponent 
    7 from math import pow, fabs 
     7from math import fabs 
     8from numpy import power 
    89 
    910class BroadPeakModel(BaseComponent): 
     
    1920        # Initialize BaseComponent first, then sphere 
    2021        BaseComponent.__init__(self) 
    21          
     22        self.counter = 0 
    2223        ## Name of the model 
    2324        self.name = "BroadPeak" 
     
    6061        inten = self.params['scale_p']/pow(x,self.params['exponent_p']) 
    6162        inten += self.params['scale_l']/(1.0 + \ 
    62                 pow((fabs(x-self.params['q_peak'])*self.params['length_l']),self.params['exponent_l'])) 
     63                power((fabs(x-self.params['q_peak'])*self.params['length_l']),\ 
     64                    self.params['exponent_l'])) 
     65 
    6366        inten += self.params['background'] 
    64  
     67         
    6568        return inten   
    6669    
Note: See TracChangeset for help on using the changeset viewer.