- Timestamp:
- Jul 24, 2014 9:59:02 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:
- ca6c007
- Parents:
- dbb0048
- Location:
- Models
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Models/code_capcyl.py
rdbb0048 r473183c 5 5 from math import asin, sqrt, fabs, atan 6 6 import pyopencl as cl 7 7 8 from weights import GaussianDispersion 8 from sasmodel import card 9 from Models.sasmodel import card 10 9 11 10 12 def set_precision(src, qx, qy, dtype): -
Models/code_coreshellcyl.py
rdbb0048 r473183c 3 3 4 4 import numpy as np 5 import math6 5 import pyopencl as cl 6 7 7 from weights import GaussianDispersion 8 from sasmodel import card 8 from Models.sasmodel import card 9 9 10 10 11 def set_precision(src, qx, qy, dtype): -
Models/code_cylinder.py
rdbb0048 r473183c 4 4 import numpy as np 5 5 import pyopencl as cl 6 6 7 from weights import GaussianDispersion 7 from sasmodel import card 8 from Models.sasmodel import card 9 8 10 9 11 def set_precision(src, qx, qy, dtype): -
Models/code_ellipse.py
rdbb0048 r473183c 3 3 4 4 import numpy as np 5 import math6 5 import pyopencl as cl 6 7 7 from weights import GaussianDispersion 8 from sasmodel import card 8 from Models.sasmodel import card 9 9 10 10 11 def set_precision(src, qx, qy, dtype): -
Models/code_lamellar.py
rdbb0048 r473183c 61 61 return sum/norm + pars['background'] 62 62 63 def demo():64 65 from time import time66 import matplotlib.pyplot as plt67 68 #create qx and qy evenly spaces69 qx = np.linspace(-.01, .01, 128)70 qy = np.linspace(-.01, .01, 128)71 qx, qy = np.meshgrid(qx, qy)72 73 #saved shape of qx74 r_shape = qx.shape75 76 #reshape for calculation; resize as float3277 qx = qx.flatten()78 qy = qy.flatten()79 80 pars = LamellarParameters(scale=1, bi_thick=100, sld_bi=.291e-6, sld_sol=5.77e-6, background=0)81 t = time()82 result = GpuLamellar(qx, qy)83 result.x = result.lamellar_fit(pars, b_n=35, b_w=.1, sigma=3)84 result.x = np.reshape(result.x, r_shape)85 tt = time()86 87 print("Time taken: %f" % (tt - t))88 89 f = open("r.txt", "w")90 for x in xrange(len(r_shape)):91 f.write(str(result.x[x]))92 f.write("\n")93 94 plt.pcolormesh(np.log10(result.x))95 plt.show()96 97 98 if __name__ == "__main__":99 demo()100 63 101 64 … … 126 89 127 90 128 129 130 131 -
Models/code_triaxialellipse.py
rdbb0048 r473183c 3 3 4 4 import numpy as np 5 from math import asin6 5 import pyopencl as cl 6 7 7 from weights import GaussianDispersion 8 from sasmodel import card 8 from Models.sasmodel import card 9 9 10 10 11 def set_precision(src, qx, qy, dtype):
Note: See TracChangeset
for help on using the changeset viewer.