Changeset 473183c in sasmodels for Models


Ignore:
Timestamp:
Jul 24, 2014 9:59:02 AM (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:
ca6c007
Parents:
dbb0048
Message:

organizing

Location:
Models
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • Models/code_capcyl.py

    rdbb0048 r473183c  
    55from math import asin, sqrt, fabs, atan 
    66import pyopencl as cl 
     7 
    78from weights import GaussianDispersion 
    8 from sasmodel import card 
     9from Models.sasmodel import card 
     10 
    911 
    1012def set_precision(src, qx, qy, dtype): 
  • Models/code_coreshellcyl.py

    rdbb0048 r473183c  
    33 
    44import numpy as np 
    5 import math 
    65import pyopencl as cl 
     6 
    77from weights import GaussianDispersion 
    8 from sasmodel import card 
     8from Models.sasmodel import card 
     9 
    910 
    1011def set_precision(src, qx, qy, dtype): 
  • Models/code_cylinder.py

    rdbb0048 r473183c  
    44import numpy as np 
    55import pyopencl as cl 
     6 
    67from weights import GaussianDispersion 
    7 from sasmodel import card 
     8from Models.sasmodel import card 
     9 
    810 
    911def set_precision(src, qx, qy, dtype): 
  • Models/code_ellipse.py

    rdbb0048 r473183c  
    33 
    44import numpy as np 
    5 import math 
    65import pyopencl as cl 
     6 
    77from weights import GaussianDispersion 
    8 from sasmodel import card 
     8from Models.sasmodel import card 
     9 
    910 
    1011def set_precision(src, qx, qy, dtype): 
  • Models/code_lamellar.py

    rdbb0048 r473183c  
    6161        return sum/norm + pars['background'] 
    6262 
    63 def demo(): 
    64  
    65     from time import time 
    66     import matplotlib.pyplot as plt 
    67  
    68     #create qx and qy evenly spaces 
    69     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 qx 
    74     r_shape = qx.shape 
    75  
    76     #reshape for calculation; resize as float32 
    77     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() 
    10063 
    10164 
     
    12689 
    12790 
    128  
    129  
    130  
    131  
  • Models/code_triaxialellipse.py

    rdbb0048 r473183c  
    33 
    44import numpy as np 
    5 from math import asin 
    65import pyopencl as cl 
     6 
    77from weights import GaussianDispersion 
    8 from sasmodel import card 
     8from Models.sasmodel import card 
     9 
    910 
    1011def set_precision(src, qx, qy, dtype): 
Note: See TracChangeset for help on using the changeset viewer.