source: sasview/sansmodels/src/sans/models/CoreShellCylinderModel.py @ 9316609

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 9316609 was 9316609, checked in by Gervaise Alina <gervyh@…>, 16 years ago

added description to model

  • Property mode set to 100644
File size: 3.5 KB
Line 
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
12from sans.models.BaseComponent import BaseComponent
13from sans_extension.c_models import CCoreShellCylinderModel
14import copy   
15   
16class 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        self.description= """P(q,alpha)= scale/Vs*f(q)^(2) + bkg  Where:\n\
45                f(q)= 2(core_sld- solvant_sld)* Vc*sin[qLcos(alpha/2)]/\n\
46                [qLcos(alpha/2)]*J1(qRsin(alpha))/[qRsin(alpha)] +\n 2(shell_sld-solvent_sld)*Vs
47                *sin[q(L+T)cos(alpha/2)]/[[q(L+T)cos(alpha/2)]
48                *J1(q(R+T)sin(alpha))/q(R+T)sin(alpha)]
49                alpha:is the angle between the axis of the cylinder and the q-vector
50                Vs: the volume of the outer shell
51                Vc: the volume of the core
52                L: the length of the core
53                shell_sld: the scattering length density of the shell
54                solvent_sld: the scattering length density of the solvent
55                bkg: the background
56                T: the thickness
57                R+T: is the outer radius
58                L+2T: The total length of the outershell
59                J1: the first order Bessel function
60                theta: axis_theta of the cylinder
61                phi: the axis_phi of the cylinder"""
62                ## Parameter details [units, min, max]
63        self.details = {}
64        self.details['scale'] = ['', None, None]
65        self.details['radius'] = ['A', None, None]
66        self.details['thickness'] = ['A', None, None]
67        self.details['length'] = ['A', None, None]
68        self.details['core_sld'] = ['A-2', None, None]
69        self.details['shell_sld'] = ['A-2', None, None]
70        self.details['solvent_sld'] = ['A-2', None, None]
71        self.details['background'] = ['cm-1', None, None]
72        self.details['axis_theta'] = ['rad', None, None]
73        self.details['axis_phi'] = ['rad', None, None]
74
75   
76    def clone(self):
77        """ Return a identical copy of self """
78        obj = CoreShellCylinderModel()
79        obj.params = copy.deepcopy(self.params)
80        return obj   
81   
82    def run(self, x = 0.0):
83        """ Evaluate the model
84            @param x: input q, or [q,phi]
85            @return: scattering function P(q)
86        """
87       
88        return CCoreShellCylinderModel.run(self, x)
89   
90    def runXY(self, x = 0.0):
91        """ Evaluate the model in cartesian coordinates
92            @param x: input q, or [qx, qy]
93            @return: scattering function P(q)
94        """
95       
96        return CCoreShellCylinderModel.runXY(self, x)
97   
98# End of file
Note: See TracBrowser for help on using the repository browser.