Changeset 3eb3312 in sasmodels

Ignore:
Timestamp:
Feb 15, 2016 7:49:22 AM (8 years ago)
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
bdb3313
Parents:
34d6cab
Message:

Vectorized version of two power law model

Files:
4 edited

Unmodified
Removed
• extra/pylint.rc

 ra36c6d3 # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. #load-plugins=pylint_numpy,pylint_pyopencl load-plugins=pylint_numpy,pylint_pyopencl # Use multiple processes to speed up Pylint.
• sasmodels/models/line.py

 r34d6cab """ #TODO: Instrcution tels 2D has different deffinition than oher models #Iq(qx*cos(qy), *args)*Iq(qy, *args #return  Iq(qy,*args)*Iq(qy,*args) return  Iq(qx*cos(qy), *args)*Iq(qx*sin(qy), *args) [{'intercept':   1.0, 'slope': 1.0, }, [1.3, 1.57], [2.3, 2.57]], }, (1.3, 1.57),2.30238060425], ]
• sasmodels/models/two_power_law.py

 r34d6cab from numpy import sqrt from numpy import inf from numpy import concatenate name = "two_power_law" # pylint: disable=bad-whitespace if q<=crossover: intensity = coefficent_1*power(q,-1.0*power_1) else: coefficent_2 = coefficent_1*power(crossover,-1.0*power_1)/power(crossover,-1.0*power_2) intensity = coefficent_2*power(q,-1.0*power_2) #Two sub vectors are created to treat crossover values q_lower = q[q<=crossover] q_upper = q[q>crossover] coefficent_2 = coefficent_1*power(crossover,-1.0*power_1)/power(crossover,-1.0*power_2) intensity_lower = coefficent_1*power(q_lower,-1.0*power_1) intensity_upper = coefficent_2*power(q_upper,-1.0*power_2) intensity = concatenate( ( intensity_lower,intensity_upper ), axis=0) return intensity Iq.vectorized = False  # Iq accepts an array of q values Iq.vectorized = True  # Iq accepts an array of q values def Iqxy(qx, qy, *args): return Iq(sqrt(qx**2 + qy**2), *args) Iqxy.vectorized = False  # Iqxy accepts an array of qx, qy values Iqxy.vectorized = True  # Iqxy doesn't accept an array of qx, qy values demo = dict(scale=1, background=0.1, 'background': 0.0, }, 0.442528, 0.00166884], [{'coeffcent_1':    1.0, 'crossover':  0.04, 'power_1':    1.0, 'power_2':    4.0, 'background': 0.0, }, (0.442528, 0.00166884), 0.00166884], ]