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


Python BaseComponent.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CPoly_GaussCoil.__init__, (self,)) 
        CPoly_GaussCoil.__init__(self)
        
        ## Name of the model
        self.name = "Poly_GaussCoil"
        ## Model description
        self.description ="""I(q)=(scale)*2*[(1+U*x)^(-1/U)+x-1]/[(1+U)*x^2] + background
		where x = [rg^2*q^2]
		and the polydispersity is
		U = [M_w/M_n]-1.
		scale = scale factor * volume fraction
		rg = radius of gyration
		poly_m = polydispersity of molecular weight
		background = incoherent background"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['rg'] = ['[A]', None, None]
        self.details['poly_m'] = ['[Mw/Mn]', None, None]
        self.details['background'] = ['[1/cm]', None, None]

        ## fittable parameters
        self.fixed=[]
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:37,代码来源:Poly_GaussCoil.py

示例2: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CSLDCalFunc.__init__, (self,)) 
        CSLDCalFunc.__init__(self)
        
        ## Name of the model
        self.name = "SLDCalFunc"
        ## Model description
        self.description ="""To calculate sld values"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['fun_type'] = ['', None, None]
        self.details['npts_inter'] = ['', None, None]
        self.details['shell_num'] = ['', None, None]
        self.details['nu_inter'] = ['', None, None]
        self.details['sld_left'] = ['[1/A^(2)]', None, None]
        self.details['sld_right'] = ['[1/A^(2)]', None, None]

        ## fittable parameters
        self.fixed=['</text>']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:32,代码来源:SLDCalFunc.py

示例3: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CGaussian.__init__, (self,)) 
        CGaussian.__init__(self)
        
        ## Name of the model
        self.name = "Gaussian"
        ## Model description
        self.description ="""f(x)=scale * 1/(sigma^2*2pi)e^(-(x-mu)^2/2sigma^2)"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['sigma'] = ['', None, None]
        self.details['center'] = ['', None, None]

        ## fittable parameters
        self.fixed=[]
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:29,代码来源:Gaussian.py

示例4: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    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:mcvine,项目名称:sansmodels,代码行数:32,代码来源:DebyeModel.py

示例5: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CLorentzian.__init__, (self,)) 
        CLorentzian.__init__(self)
        
        ## Name of the model
        self.name = "Lorentzian"
        ## Model description
        self.description ="""f(x)=scale * 1/pi 0.5gamma / [ (x-x_0)^2 + (0.5gamma)^2 ]"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['gamma'] = ['', None, None]
        self.details['center'] = ['', None, None]

        ## fittable parameters
        self.fixed=[]
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:29,代码来源:Lorentzian.py

示例6: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CDiamEllipFunc.__init__, (self,)) 
        CDiamEllipFunc.__init__(self)
        
        ## Name of the model
        self.name = "DiamEllipFunc"
        ## Model description
        self.description ="""To calculate the 2nd virial coefficient for
		the non-spherical object, then find the
		radius of sphere that has this value of
		virial coefficient:
		radius_a = polar radius,
		radius_b = equatorial radius;
		radius_a > radius_b: Prolate spheroid,
		radius_a < radius_b: Oblate spheroid."""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['radius_a'] = ['A', None, None]
        self.details['radius_b'] = ['A', None, None]

        ## fittable parameters
        self.fixed=['radius_a.width', 'radius_b.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:35,代码来源:DiamEllipFunc.py

示例7: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    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:mcvine,项目名称:sansmodels,代码行数:36,代码来源:GaussLorentzGelModel.py

示例8: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CFlexCylEllipXModel.__init__, (self,)) 
        CFlexCylEllipXModel.__init__(self)
        
        ## Name of the model
        self.name = "FlexCylEllipXModel"
        ## Model description
        self.description =""" Note : scale and contrast=sldCyl-sldSolv are both multiplicative factors in the
		model and are perfectly correlated. One or
		both of these parameters must be held fixed
		during model fitting."""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['length'] = ['[A]', None, None]
        self.details['kuhn_length'] = ['[A]', None, None]
        self.details['radius'] = ['[A]', None, None]
        self.details['axis_ratio'] = ['', 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]

        ## fittable parameters
        self.fixed=['length.width', 'kuhn_length.width', 'radius.width', 'axis_ratio.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:37,代码来源:FlexCylEllipXModel.py

示例9: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    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:mcvine,项目名称:sansmodels,代码行数:32,代码来源:PeakLorentzModel.py

示例10: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self, model_info, parameter_collection):
        """ Initialization"""
        BaseComponent.__init__(self)

        self.model_info = model_info
        pars = model_info.parameters

        # ===== Variable state which needs to be copied/saved =====
        self.params = dict((p.name, p.default) for p in pars)
        self.details = dict((p.name, [p.unit, None, None]) for p in pars)
        self.dispersion = dict((p.name, GaussianDispersion().get_pars()) for p in pars
                               if p.flags & ParameterFlags.Polydisperse)
        #list of parameter that start out fixed by default
        self.fixed = []

        # ===== Fixed state that is not changed by the sasview gui =====
        ## Name of the model
        self.name = model_info.name
        self.description = model_info.description

        self.non_fittable = [p.name for p in pars
                             if p.flags & (ParameterFlags.Unfittable | ParameterFlags.RepeatCount)]
        self.orientation_params = [p.name for p in pars
                                   if p.flags & ParameterFlags.Orientation]

        self.magnetic_params = [p.name for p in pars
                                if p.flags & ParameterFlags.Magnetic]

        ## independent parameter name and unit [string]
        self.input_name = "Q"
        self.input_unit = "A^{-1}"
        ## output name and unit  [string]
        self.output_name = "Intensity"
        self.output_unit = "cm^{-1}"
开发者ID:pkienzle,项目名称:sasview-plugins,代码行数:36,代码来源:PluginModel.py

示例11: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
 def __init__(self , name="Plugin Model" ):
     """ Initialization """
     BaseComponent.__init__(self)
     self.name = name
     self.details = {}
     self.params  = {}
     self.description=''
开发者ID:mcvine,项目名称:sansmodels,代码行数:9,代码来源:pluginmodel.py

示例12: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CVesicleModel.__init__, (self,)) 
        CVesicleModel.__init__(self)
        
        ## Name of the model
        self.name = "VesicleModel"
        ## Model description
        self.description ="""Model parameters:    radius : the core radius of the vesicle
		thickness: the shell thickness
		core_sld: the core SLD
		shell_sld: the shell SLD
		background: incoherent background
		scale : scale factor"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['radius'] = ['[A]', None, None]
        self.details['thickness'] = ['[A]', None, None]
        self.details['core_sld'] = ['[1/A^(2)]', None, None]
        self.details['shell_sld'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]

        ## fittable parameters
        self.fixed=['radius.width', 'thickness.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:37,代码来源:VesicleModel.py

示例13: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    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:mcvine,项目名称:sansmodels,代码行数:36,代码来源:GuinierPorodModel.py

示例14: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CDiamCylFunc.__init__, (self,)) 
        CDiamCylFunc.__init__(self)
        
        ## Name of the model
        self.name = "DiamCylFunc"
        ## Model description
        self.description ="""To calculate the 2nd virial coefficient for
		the non-spherical object, then find the
		radius of sphere that has this value of
		virial coefficient."""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['radius'] = ['A', None, None]
        self.details['length'] = ['A', None, None]

        ## fittable parameters
        self.fixed=['radius.width', 'length.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:31,代码来源:DiamCylFunc.py

示例15: __init__

# 需要导入模块: from sans.models.BaseComponent import BaseComponent [as 别名]
# 或者: from sans.models.BaseComponent.BaseComponent import __init__ [as 别名]
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CSchulz.__init__, (self,)) 
        CSchulz.__init__(self)
        
        ## Name of the model
        self.name = "Schulz"
        ## Model description
        self.description =""" f(x)=scale * math.pow(z+1, z+1)*math.pow((R), z)*
		math.exp(-R*(z+1))/(center*gamma(z+1)
		z= math.pow[(1/(sigma/center),2]-1"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['sigma'] = ['', None, None]
        self.details['center'] = ['', None, None]

        ## fittable parameters
        self.fixed=[]
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
开发者ID:mcvine,项目名称:sansmodels,代码行数:31,代码来源:Schulz.py


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