[ae3ce4e] | 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 ellipsoid.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 CEllipsoidModel |
---|
| 14 | import copy |
---|
| 15 | |
---|
| 16 | class EllipsoidModel(CEllipsoidModel, BaseComponent): |
---|
| 17 | """ Class that evaluates a EllipsoidModel model. |
---|
| 18 | This file was auto-generated from ellipsoid.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_a = 20.0 A |
---|
| 24 | radius_b = 400.0 A |
---|
| 25 | contrast = 3e-006 A-2 |
---|
| 26 | background = 0.0 cm-1 |
---|
| 27 | axis_theta = 1.57 rad |
---|
| 28 | axis_phi = 0.0 rad |
---|
| 29 | |
---|
| 30 | """ |
---|
| 31 | |
---|
| 32 | def __init__(self): |
---|
| 33 | """ Initialization """ |
---|
| 34 | |
---|
| 35 | # Initialize BaseComponent first, then sphere |
---|
| 36 | BaseComponent.__init__(self) |
---|
| 37 | CEllipsoidModel.__init__(self) |
---|
| 38 | |
---|
| 39 | ## Name of the model |
---|
| 40 | self.name = "EllipsoidModel" |
---|
| 41 | |
---|
| 42 | ## Parameter details [units, min, max] |
---|
| 43 | self.details = {} |
---|
| 44 | self.details['scale'] = ['', None, None] |
---|
| 45 | self.details['radius_a'] = ['A', None, None] |
---|
| 46 | self.details['radius_b'] = ['A', None, None] |
---|
| 47 | self.details['contrast'] = ['A-2', None, None] |
---|
| 48 | self.details['background'] = ['cm-1', None, None] |
---|
| 49 | self.details['axis_theta'] = ['rad', None, None] |
---|
| 50 | self.details['axis_phi'] = ['rad', None, None] |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | def clone(self): |
---|
| 54 | """ Return a identical copy of self """ |
---|
| 55 | obj = EllipsoidModel() |
---|
| 56 | obj.params = copy.deepcopy(self.params) |
---|
| 57 | return obj |
---|
| 58 | |
---|
| 59 | def run(self, x = 0.0): |
---|
| 60 | """ Evaluate the model |
---|
| 61 | @param x: input q, or [q,phi] |
---|
| 62 | @return: scattering function P(q) |
---|
| 63 | """ |
---|
| 64 | |
---|
| 65 | return CEllipsoidModel.run(self, x) |
---|
| 66 | |
---|
| 67 | def runXY(self, x = 0.0): |
---|
| 68 | """ Evaluate the model in cartesian coordinates |
---|
| 69 | @param x: input q, or [qx, qy] |
---|
| 70 | @return: scattering function P(q) |
---|
| 71 | """ |
---|
| 72 | |
---|
| 73 | return CEllipsoidModel.runXY(self, x) |
---|
| 74 | |
---|
| 75 | # End of file |
---|