Changeset 1726b21 in sasmodels for Models/code_cylinder.py
- Timestamp:
- Aug 8, 2014 11:45:51 AM (10 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:
- ae7d639
- Parents:
- 8cdb9f1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Models/code_cylinder.py
ra42fec0 r1726b21 6 6 7 7 from weights import GaussianDispersion 8 from sasmodel import card, set_precision, set_precision_1d 8 from sasmodel import card, set_precision, set_precision_1d, tic, toc 9 9 10 10 … … 33 33 def eval(self, pars): 34 34 35 tic() 35 36 _ctx,queue = card() 36 37 self.res[:] = 0 … … 55 56 for i in xrange(len(radius.weight)): 56 57 for j in xrange(len(length.weight)): 58 59 vol += radius.weight[i]*length.weight[j]*pow(radius.value[i], 2)*length.value[j] 60 norm_vol += radius.weight[i]*length.weight[j] 61 57 62 for k in xrange(len(cyl_theta.weight)): 58 63 for l in xrange(len(cyl_phi.weight)): … … 63 68 np.uint32(self.qx.size), np.uint32(size)) 64 69 65 vol += radius.weight[i]*length.weight[j]*pow(radius.value[i], 2)*length.value[j]66 norm_vol += radius.weight[i]*length.weight[j]67 70 norm += radius.weight[i]*length.weight[j]*cyl_theta.weight[k]*cyl_phi.weight[l] 71 68 72 69 73 # if size > 1: … … 74 78 sum *= norm_vol/vol 75 79 80 print toc()*1000, self.qx.shape[0] 76 81 return sum/norm+pars['background'] 77 82
Note: See TracChangeset
for help on using the changeset viewer.