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