Changeset ae7d639 in sasmodels


Ignore:
Timestamp:
Aug 8, 2014 2:55:23 PM (10 years ago)
Author:
HMP1 <helen.park@…>
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:
a953943
Parents:
1726b21
Message:

Ellipse now MUCH faster!

Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • Kernel/Kernel-Ellipse.cpp

    ra42fec0 rae7d639  
    1 __kernel void EllipsoidKernel(const real radius_a_weight, const real radius_b_weight, const real axis_theta_weight, 
    2 const real axis_phi_weight, const real scale, const real radius_a, const real radius_b, const real sub, const real axis_theta, const real axis_phi, __global const real *qx, 
     1__kernel void EllipsoidKernel(const real radius_a_weight, const real radius_b_weight, 
     2const real axis_theta_weight, 
     3const real axis_phi_weight, const real scale, const real radius_a, const real radius_b, 
     4 const real sub, const real axis_theta, const real axis_phi, __global const real *qx, 
    35__global const real *qy, __global real *_ptvalue, const int length, const int size) 
    46{ 
  • Models/code_cylinder_f.py

    r1726b21 rae7d639  
    22# -*- coding: utf-8 -*- 
    33 
    4 import sys 
     4 
    55import ctypes 
    66from ctypes import c_int, c_double, c_void_p 
     
    4545        loops_b = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR, hostbuf=loops) 
    4646        loops_l = cl.LocalMemory(len(loops.data)) 
     47 
    4748        self.prg.CylinderKernel(queue, self.qx.shape, None, 
    4849            self.qx_b, self.qy_b, self.res_b, 
     
    5152            real(pars['sldCyl']-pars['sldSolv']), 
    5253            *[np.uint32(pn) for pn in loop_lengths]) 
     54 
    5355        cl.enqueue_copy(queue, self.res, self.res_b) 
    5456        print toc()*1000, self.qx.shape[0] 
     
    8587        length.get_weights(pars['length'], 0, 10000, True), 
    8688        theta.get_weights(pars['cyl_theta'], -np.inf, np.inf, False), 
    87         theta.get_weights(pars['cyl_phi'], -np.inf, np.inf, False), 
     89        phi.get_weights(pars['cyl_phi'], -np.inf, np.inf, False), 
    8890        ] 
    8991    # Make sure that weights are normalized to peaks at 1 so that 
  • fit.py

    r1726b21 rae7d639  
    88from Models.code_cylinder_f import GpuCylinder 
    99#from Models.code_cylinder import GpuCylinder, OneDGpuCylinder 
    10 from Models.code_ellipse import GpuEllipse 
     10from Models.code_ellipse_f import GpuEllipse 
    1111from Models.code_lamellar import GpuLamellar 
    1212from Models.code_triaxialellipse import GpuTriEllipse 
     
    3131 
    3232 
    33 if 0: 
     33if 1: 
    3434    model = SasModel(data, GpuEllipse, 
    3535    scale=0.08, 
     
    4141    radius_a_pd=0.222296, radius_a_pd_n=1, radius_a_pd_nsigma=0, 
    4242    radius_b_pd=.000128, radius_b_pd_n=1, radius_b_pd_nsigma=0, 
    43     axis_phi_pd=2.63698e-05, axis_phi_pd_n=20, axis_phi_pd_nsigma=0, 
     43    axis_phi_pd=2.63698e-05, axis_phi_pd_n=20, axis_phi_pd_nsigma=3, 
    4444    dtype='float32') 
    4545 
    4646 
    4747    # SET THE FITTING PARAMETERS 
    48     model.radius_a.range(15, 1000) 
    49     model.radius_b.range(15, 1000) 
     48    #model.radius_a.range(15, 1000) 
     49    #model.radius_b.range(15, 1000) 
    5050    #model.axis_theta_pd.range(0, 360) 
    5151    #model.background.range(0,1000) 
    52     #model.scale.range(0, 1) 
     52    model.scale.range(0, 1) 
    5353 
    5454 
     
    7070 
    7171 
    72 if 1: 
     72if 0: 
    7373    """ 
    7474    pars = dict(scale=0.0023, radius=92.5, length=798.3, 
Note: See TracChangeset for help on using the changeset viewer.