1 | #!/usr/bin/env python |
---|
2 | """ Provide functionality for a C extension model |
---|
3 | |
---|
4 | WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY |
---|
5 | DO NOT MODIFY THIS FILE, MODIFY core_shell_cylinder.h |
---|
6 | AND RE-RUN THE GENERATOR SCRIPT |
---|
7 | |
---|
8 | @author: Mathieu Doucet / UTK |
---|
9 | @contact: mathieu.doucet@nist.gov |
---|
10 | """ |
---|
11 | |
---|
12 | from sans.models.BaseComponent import BaseComponent |
---|
13 | from sans_extension.c_models import CCoreShellCylinderModel |
---|
14 | import copy |
---|
15 | |
---|
16 | class CoreShellCylinderModel(CCoreShellCylinderModel, BaseComponent): |
---|
17 | """ Class that evaluates a CoreShellCylinderModel model. |
---|
18 | This file was auto-generated from core_shell_cylinder.h. |
---|
19 | Refer to that file and the structure it contains |
---|
20 | for details of the model. |
---|
21 | List of default parameters: |
---|
22 | scale = 1.0 |
---|
23 | radius = 20.0 A |
---|
24 | thickness = 10.0 A |
---|
25 | length = 400.0 A |
---|
26 | core_sld = 1e-006 A-2 |
---|
27 | shell_sld = 4e-006 A-2 |
---|
28 | solvent_sld = 1e-006 A-2 |
---|
29 | background = 0.0 cm-1 |
---|
30 | axis_theta = 1.57 rad |
---|
31 | axis_phi = 0.0 rad |
---|
32 | |
---|
33 | """ |
---|
34 | |
---|
35 | def __init__(self): |
---|
36 | """ Initialization """ |
---|
37 | |
---|
38 | # Initialize BaseComponent first, then sphere |
---|
39 | BaseComponent.__init__(self) |
---|
40 | CCoreShellCylinderModel.__init__(self) |
---|
41 | |
---|
42 | ## Name of the model |
---|
43 | self.name = "CoreShellCylinderModel" |
---|
44 | |
---|
45 | ## Parameter details [units, min, max] |
---|
46 | self.details = {} |
---|
47 | self.details['scale'] = ['', None, None] |
---|
48 | self.details['radius'] = ['A', None, None] |
---|
49 | self.details['thickness'] = ['A', None, None] |
---|
50 | self.details['length'] = ['A', None, None] |
---|
51 | self.details['core_sld'] = ['A-2', None, None] |
---|
52 | self.details['shell_sld'] = ['A-2', None, None] |
---|
53 | self.details['solvent_sld'] = ['A-2', None, None] |
---|
54 | self.details['background'] = ['cm-1', None, None] |
---|
55 | self.details['axis_theta'] = ['rad', None, None] |
---|
56 | self.details['axis_phi'] = ['rad', None, None] |
---|
57 | |
---|
58 | |
---|
59 | def clone(self): |
---|
60 | """ Return a identical copy of self """ |
---|
61 | obj = CoreShellCylinderModel() |
---|
62 | obj.params = copy.deepcopy(self.params) |
---|
63 | return obj |
---|
64 | |
---|
65 | def run(self, x = 0.0): |
---|
66 | """ Evaluate the model |
---|
67 | @param x: input q, or [q,phi] |
---|
68 | @return: scattering function P(q) |
---|
69 | """ |
---|
70 | |
---|
71 | return CCoreShellCylinderModel.run(self, x) |
---|
72 | |
---|
73 | def runXY(self, x = 0.0): |
---|
74 | """ Evaluate the model in cartesian coordinates |
---|
75 | @param x: input q, or [qx, qy] |
---|
76 | @return: scattering function P(q) |
---|
77 | """ |
---|
78 | |
---|
79 | return CCoreShellCylinderModel.runXY(self, x) |
---|
80 | |
---|
81 | # End of file |
---|