Ignore:
Timestamp:
Jan 18, 2011 10: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/UnifiedPowerRgModel.py

    r29100cb r18695bf  
    11    
    22from sans.models.BaseComponent import BaseComponent 
    3 from math import pow,exp, sqrt 
     3from math import exp, sqrt 
     4from numpy import power 
    45from scipy.special import erf 
    56max_level_n = 7 
     
    7475        for ind in range(1,l_num+1): 
    7576            # get exp term 
    76             exp_now = exp(-pow(x*self.params['Rg%s'% ind],2)/3.0) 
     77            exp_now = exp(-power(x*self.params['Rg%s'% ind],2)/3.0) 
    7778            # get erf term 
    7879            erf_now = erf(x*self.params['Rg%s'% ind]/sqrt(6.0)) 
    7980            # get power term 
    80             pow_now = pow((erf_now*erf_now*erf_now/x),self.params['power%s'% ind]) 
     81            pow_now = power((erf_now*erf_now*erf_now/x),self.params['power%s'% ind]) 
    8182            # get next exp term only if it exists 
    8283            try: 
    83                 exp_next = exp(-pow(x*self.params['Rg%s'% (ind+1)],2)/3.0) 
     84                exp_next = exp(-power(x*self.params['Rg%s'% (ind+1)],2)/3.0) 
    8485            except: 
    8586                exp_next = 1.0 
Note: See TracChangeset for help on using the changeset viewer.