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 sphere.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 CSphereModel |
---|
14 | import copy |
---|
15 | |
---|
16 | class SphereModel(CSphereModel, BaseComponent): |
---|
17 | """ Class that evaluates a SphereModel model. |
---|
18 | This file was auto-generated from sphere.h. |
---|
19 | Refer to that file and the structure it contains |
---|
20 | for details of the model. |
---|
21 | List of default parameters: |
---|
22 | scale = 1e-006 |
---|
23 | radius = 60.0 A |
---|
24 | contrast = 1.0 A-2 |
---|
25 | background = 0.0 cm-1 |
---|
26 | |
---|
27 | """ |
---|
28 | |
---|
29 | def __init__(self): |
---|
30 | """ Initialization """ |
---|
31 | |
---|
32 | # Initialize BaseComponent first, then sphere |
---|
33 | BaseComponent.__init__(self) |
---|
34 | CSphereModel.__init__(self) |
---|
35 | |
---|
36 | ## Name of the model |
---|
37 | self.name = "SphereModel" |
---|
38 | |
---|
39 | ## Parameter details [units, min, max] |
---|
40 | self.details = {} |
---|
41 | self.details['scale'] = ['', None, None] |
---|
42 | self.details['radius'] = ['A', None, None] |
---|
43 | self.details['contrast'] = ['A-2', None, None] |
---|
44 | self.details['background'] = ['cm-1', None, None] |
---|
45 | |
---|
46 | |
---|
47 | def clone(self): |
---|
48 | """ Return a identical copy of self """ |
---|
49 | obj = SphereModel() |
---|
50 | obj.params = copy.deepcopy(self.params) |
---|
51 | return obj |
---|
52 | |
---|
53 | def run(self, x = 0.0): |
---|
54 | """ Evaluate the model |
---|
55 | @param x: input q, or [q,phi] |
---|
56 | @return: scattering function P(q) |
---|
57 | """ |
---|
58 | |
---|
59 | return CSphereModel.run(self, x) |
---|
60 | |
---|
61 | def runXY(self, x = 0.0): |
---|
62 | """ Evaluate the model in cartesian coordinates |
---|
63 | @param x: input q, or [qx, qy] |
---|
64 | @return: scattering function P(q) |
---|
65 | """ |
---|
66 | |
---|
67 | return CSphereModel.runXY(self, x) |
---|
68 | |
---|
69 | # End of file |
---|