source: sasview/sansmodels/prototypes/DisperseEllipsoidModel.py @ c09ace41

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 c09ace41 was 7df1a50, checked in by Jae Cho <jhjcho@…>, 13 years ago

moving a file

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#!/usr/bin/env python
2""" Provide functionality for a C extension model
3
4
5    @author: Mathieu Doucet / UTK
6    @contact: mathieu.doucet@nist.gov
7"""
8
9from sans.models.EllipsoidModel import EllipsoidModel
10from sans.models.DisperseModel import DisperseModel
11import copy   
12   
13class DisperseEllipsoidModel(EllipsoidModel):
14    """ Class that evaluates a DisperseEllipsoidModel model.
15    """
16       
17    def __init__(self):
18        """ Initialization """
19       
20        # Initialize BaseComponent first, then sphere
21        EllipsoidModel.__init__(self)
22        self.params['sigma_phi'] = 0.0
23        self.params['sigma_theta'] = 0.0
24        self.params['n_pts'] = 20
25       
26       
27        ## Name of the model
28        self.name = "DisperseEllipsoidModel"
29   
30    def clone(self):
31        """ Return a identical copy of self """
32        obj = DisperseEllipsoidModel()
33        obj.params = copy.deepcopy(self.params)
34        return obj   
35   
36    def run(self, x = 0.0):
37        """ Evaluate the model
38            @param x: input q, or [q,phi]
39            @return: scattering function P(q)
40        """
41        model = EllipsoidModel()
42        model.params = copy.deepcopy(self.params)
43        #d = Disperser(model, ["cyl_phi", "cyl_theta"],
44                #                                 [self.params['sigma_phi'], self.params['sigma_theta']])
45        d = DisperseModel(model, ["axis_phi", "axis_theta"], 
46                                          [self.params['sigma_phi'], self.params['sigma_theta']])
47        d.params['n_pts'] = self.params['n_pts']
48        return d.run(x)
49   
50# End of file
Note: See TracBrowser for help on using the repository browser.