当前位置: 首页>>代码示例>>Python>>正文


Python BaseComponent.BaseComponent类代码示例

本文整理汇总了Python中sas.models.BaseComponent.BaseComponent的典型用法代码示例。如果您正苦于以下问题:Python BaseComponent类的具体用法?Python BaseComponent怎么用?Python BaseComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了BaseComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, multfactor=1):
        """ Initialization """
        self.__dict__ = {}
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CEllipticalCylinderModel.__init__, (self,)) 

        CEllipticalCylinderModel.__init__(self)
        self.is_multifunc = False
		        
        ## Name of the model
        self.name = "EllipticalCylinderModel"
        ## Model description
        self.description = """
         Model parameters: r_minor = the radius of minor axis of the cross section
		r_ratio = the ratio of (r_major /r_minor >= 1)
		length = the length of the cylinder
		sldCyl = SLD of the cylinder
		sldSolv = SLD of solvent -
		background = incoherent background
        """
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['r_minor'] = ['[A]', None, None]
        self.details['scale'] = ['', None, None]
        self.details['r_ratio'] = ['', None, None]
        self.details['length'] = ['[A]', None, None]
        self.details['sldCyl'] = ['[1/A^(2)]', None, None]
        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['cyl_theta'] = ['[deg]', None, None]
        self.details['cyl_phi'] = ['[deg]', None, None]
        self.details['cyl_psi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed = ['cyl_phi.width',
                      'cyl_theta.width',
                      'cyl_psi.width',
                      'length.width',
                      'r_minor.width',
                      'r_ratio.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = ['cyl_phi',
                                   'cyl_theta',
                                   'cyl_psi',
                                   'cyl_phi.width',
                                   'cyl_theta.width',
                                   'cyl_psi.width']

        ## parameters with magnetism
        self.magnetic_params = []

        self.category = None
        self.multiplicity_info = None
开发者ID:ricleal,项目名称:SasModeling,代码行数:60,代码来源:EllipticalCylinderModel.py

示例2: __init__

    def __init__(self):
        """ Initialization """

        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)

        ## Name of the model
        self.name = "Peak Gauss Model"
        self.description = """ F(q) = scale*exp( -1/2 *[(q-q0)/B]^2 )+ background
        
        The model has three parameters: 
        scale     =  scale
        q0        =  peak position
        B         =  standard deviation
        background=  incoherent background"""
        ## Define parameters
        self.params = {}
        self.params["scale"] = 100.0
        self.params["q0"] = 0.05
        self.params["B"] = 0.005
        self.params["background"] = 1.0

        ## Parameter details [units, min, max]
        self.details = {}
        self.details["q0"] = ["[1/A]", None, None]
        self.details["scale"] = ["", 0, None]
        self.details["B"] = ["[1/A]", None, None]
        self.details["background"] = ["[1/cm]", None, None]
        # list of parameter that cannot be fitted
        self.fixed = []
开发者ID:imewei,项目名称:sasview,代码行数:30,代码来源:PeakGaussModel.py

示例3: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "TwoPowerLaw"
        self.description="""I(q) = coef_A*pow(qval,-1.0*power1) for q<=qc
            =C*pow(qval,-1.0*power2) for q>qc
            where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2).
             List of default parameters:
             coef_A = coefficient
             power1 = (-) Power @ low Q
             power2 = (-) Power @ high Q
             qc = crossover Q-value
             background = incoherent background
        """
        ## Define parameters
        self.params = {}
        self.params['coef_A']  = 1.0
        self.params['power1']     = 1.0
        self.params['power2']  = 4.0
        self.params['qc']     = 0.04
        self.params['background']     = 0.0
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['coef_A'] = ['', None, None]
        self.details['power1'] =  ['', None, None]
        self.details['power2']  =  ['', None, None]
        self.details['qc']  =   ['1/A', None, None]
        self.details['background']   =  ['[1/cm]', None, None]

        #list of parameter that cannot be fitted
        self.fixed= []  
开发者ID:ricleal,项目名称:SasModeling,代码行数:35,代码来源:TwoPowerLawModel.py

示例4: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "GuinierPorod"
        self.description = """
         I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql
         = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql
                        where ql = sqrt((m-s)(3-s)/2)/Rg.
                        List of parameters:
                        scale = Guinier Scale
                        s = Dimension Variable
                        Rg = Radius of Gyration [A] 
                        m = Porod Exponent
                        background  = Background [1/cm]"""
        ## Define parameters
        self.params = {}
        self.params['scale']  = 1.0
        self.params['dim']  = 1.0
        self.params['rg']     = 100.0
        self.params['m']     = 3.0
        self.params['background']     = 0.1
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['dim']  = ['', None, None]
        self.details['rg']    = ['[A]', None, None]
        self.details['m']     = ['', None, None]
        self.details['background']     = ['[1/cm]', None, None]

        #list of parameter that cannot be fitted
        self.fixed = []  
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:35,代码来源:GuinierPorodModel.py

示例5: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "Lorentz"
        self.description="""Lorentz (Ornstein-Zernicke) model.
        F(x) = scale/( 1 + (x*L)^2 ) + bkd 
        
        The model has three parameters:      
        L     =  screen Length\n\
        scale  =  scale factor\n\
        bkd    =  incoherent background"""
        ## Define parameters
        self.params = {}
        self.params['length']      = 50.0
        self.params['scale']       = 1.0
        self.params['background']  = 0.0

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['length']     = ['[A]', None, None]
        self.details['scale']      = ['', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        #list of parameter that cannot be fitted
        self.fixed= []      
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:28,代码来源:LorentzModel.py

示例6: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "Peak Lorentz Model"
        self.description = """ F(q) = scale/(1+[(q-q0)/B]^2 ) + background
        
        The model has three parameters: 
        scale     =  scale
        q0        =  peak position
        B         =  ( hwhm) half-width-halfmaximum
        background=  incoherent background"""
        ## Define parameters
        self.params = {}
        self.params['scale']              = 100.0
        self.params['q0']                 = 0.05
        self.params['B']              = 0.005
        self.params['background']         = 1.0

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['q0']            = ['[1/A]', None, None]
        self.details['scale']             = ['', 0, None]
        self.details['B']            = ['[1/A]', None, None]
        self.details['background']        = ['[1/cm]', None, None]
        #list of parameter that cannot be fitted
        self.fixed = []  
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:30,代码来源:PeakLorentzModel.py

示例7: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "GaussLorentzGel"
        self.description = """I(q)=scale_g*exp(-q^2*Z^2/2)+scale_l/(1+q^2*z^2)
            + background
            List of default parameters:
             scale_g = Gauss scale factor
             stat_colength = Static correlation length
             scale_l = Lorentzian scale factor
             dyn_colength = Dynamic correlation length
             background = Incoherent background
"""
        ## Define parameters
        self.params = {}
        self.params['scale_g']  = 100.0
        self.params['stat_colength']     = 100.0
        self.params['scale_l']  = 50.0
        self.params['dyn_colength']     = 20.0
        self.params['background']     = 0.0
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale_g'] = ['', None, None]
        self.details['stat_colength'] =  ['A', None, None]
        self.details['scale_l']  =  ['', None, None]
        self.details['dyn_colength']  =   ['A', None, None]
        self.details['background']   =  ['[1/cm]', None, None]

        #list of parameter that cannot be fitted
        self.fixed = []  
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:34,代码来源:GaussLorentzGelModel.py

示例8: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "Debye"
        self.description = """ 
        F(x) = 2( exp(-x) + x - 1 )/x**2
        with x = (q*R_g)**2
        
        The model has three parameters: 
        Rg     =  radius of gyration
        scale  =  scale factor
        bkd    =  Constant background
        """
        ## Define parameters
        self.params = {}
        self.params['rg']          = 50.0
        self.params['scale']       = 1.0
        self.params['background']  = 0.0

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['rg']         = ['[A]', None, None]
        self.details['scale']      = ['', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        #list of parameter that cannot be fitted
        self.fixed = [] 
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:30,代码来源:DebyeModel.py

示例9: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "Power_Law"

        ## Define parameters
        self.params = {}
        self.params['m']            = 4.0
        self.params['scale']        = 1.0
        self.params['background']   = 0.0
        self.description = """ The Power_Law model.
        F(x) = scale* (x)^(-m) + bkd
        
        The model has three parameters: 
        m     =  power
        scale  =  scale factor
        bkd    =  incoherent background"""
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['m']           = ['', 0,    None]
        self.details['scale']       = ['', None, None]
        self.details['background']  = ['[1/cm]', None, None]
        #list of parameter that cannot be fitted
        self.fixed = []    
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:28,代码来源:PowerLawModel.py

示例10: __init__

 def __init__(self , name="Plugin Model" ):
     """ Initialization """
     BaseComponent.__init__(self)
     self.name = name
     self.details = {}
     self.params  = {}
     self.description = 'plugin model'
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:7,代码来源:pluginmodel.py

示例11: __init__

    def __init__(self, multfactor=1):
        """ Initialization """
        self.__dict__ = {}
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CLinearPearlsModel.__init__, (self,)) 

        CLinearPearlsModel.__init__(self)
        self.is_multifunc = False
		        
        ## Name of the model
        self.name = "LinearPearlsModel"
        ## Model description
        self.description = """
        Calculate form factor for Pearl Necklace Model
		[Macromol. 1996, 29, 2974-2979]
		Parameters:
		background:background
		scale: scale factor
		sld_pearl: the SLD of the pearl spheres
		sld_solv: the SLD of the solvent
		num_pearls: number of the pearls
		radius: the radius of a pearl
		edge_separation: the length of string segment; surface to surface
        """
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['radius'] = ['[A]', None, None]
        self.details['edge_separation'] = ['[A]', None, None]
        self.details['num_pearls'] = ['', None, None]
        self.details['sld_pearl'] = ['[1/A^(2)]', None, None]
        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['', None, None]
        self.details['scale'] = ['', None, None]
        self.details['radius'] = ['[A]', None, None]
        self.details['edge_separation'] = ['[A]', None, None]
        self.details['num_pearls'] = ['', None, None]
        self.details['sld_pearl'] = ['[1/A^(2)]', None, None]
        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['', None, None]

        ## fittable parameters
        self.fixed = ['radius.width',
                      'edge_separation.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []

        ## parameters with magnetism
        self.magnetic_params = []

        self.category = None
        self.multiplicity_info = None
开发者ID:ricleal,项目名称:SasModeling,代码行数:59,代码来源:LinearPearlsModel.py

示例12: __init__

    def __init__(self, multfactor=1):
        """ Initialization """
        self.__dict__ = {}
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CTriaxialEllipsoidModel.__init__, (self,)) 

        CTriaxialEllipsoidModel.__init__(self)
        self.is_multifunc = False
		        
        ## Name of the model
        self.name = "TriaxialEllipsoidModel"
        ## Model description
        self.description = """
        Note: During fitting ensure that the inequality A<B<C is not
		violated. Otherwise the calculation will
		not be correct.
        """
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['semi_axisA'] = ['[A]', None, None]
        self.details['semi_axisB'] = ['[A]', None, None]
        self.details['semi_axisC'] = ['[A]', None, None]
        self.details['sldEll'] = ['[1/A^(2)]', None, None]
        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['axis_theta'] = ['[deg]', None, None]
        self.details['axis_phi'] = ['[deg]', None, None]
        self.details['axis_psi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed = ['axis_psi.width',
                      'axis_phi.width',
                      'axis_theta.width',
                      'semi_axisA.width',
                      'semi_axisB.width',
                      'semi_axisC.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = ['axis_psi',
                                   'axis_phi',
                                   'axis_theta',
                                   'axis_psi.width',
                                   'axis_phi.width',
                                   'axis_theta.width']

        ## parameters with magnetism
        self.magnetic_params = []

        self.category = None
        self.multiplicity_info = None
开发者ID:ricleal,项目名称:SasModeling,代码行数:57,代码来源:TriaxialEllipsoidModel.py

示例13: setParam

 def setParam(self, name, value):
     """
         Set a parameter value
         :param name: parameter name
     """
     if name.lower() in self.params:
         BaseComponent.setParam(self, name, value)
     else:
         self.model.setParam(name, value)
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:9,代码来源:DisperseModel.py

示例14: __init__

 def __init__(self):
     """ Initialization """
     
     # Initialize BaseComponent first, then sphere
     BaseComponent.__init__(self)
     
     ## Name of the model
     self.name = "NoStructure"
     self.description=""" NoStructure factor
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:9,代码来源:NoStructure.py

示例15: __init__

 def __init__(self):
     """ Initialization """
     
     # Initialize BaseComponent first, then sphere
     BaseComponent.__init__(self)
     
     ## Name of the model
     self.name = "Error!"
     self.description="""Error  model
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:9,代码来源:NullModel.py


注:本文中的sas.models.BaseComponent.BaseComponent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。