• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python BaseComponent.BaseComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __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:mcvine,项目名称:sansmodels,代码行数:30,代码来源:DebyeModel.py


示例2: __init__

    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,代码行数:30,代码来源:SLDCalFunc.py


示例3: __init__

    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,代码行数:29,代码来源:Schulz.py


示例4: __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:mcvine,项目名称:sansmodels,代码行数:28,代码来源:PowerLawModel.py


示例5: __init__

    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,代码行数:35,代码来源:FlexCylEllipXModel.py


示例6: __init__

    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,代码行数:27,代码来源:Gaussian.py


示例7: __init__

    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,代码行数:29,代码来源:DiamCylFunc.py


示例8: setParam

 def setParam(self, name, value):
 	"""
 	"""
 	if name.lower() in self.params:
 		BaseComponent.setParam(self, name, value)
 	else:
 		self.model.setParam(name, value)
开发者ID:mcvine,项目名称:sansmodels,代码行数:7,代码来源:DisperseModel.py


示例9: __init__

    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,代码行数:27,代码来源:Lorentzian.py


示例10: __init__

    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,代码行数:33,代码来源:DiamEllipFunc.py


示例11: __init__

    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,代码行数:34,代码来源:PluginModel.py


示例12: __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:mcvine,项目名称:sansmodels,代码行数:34,代码来源:GuinierPorodModel.py


示例13: __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:mcvine,项目名称:sansmodels,代码行数:34,代码来源:GaussLorentzGelModel.py


示例14: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        
        ## Name of the model
        self.name = "Teubner Strey"
        self.description="""The TeubnerStrey model.
        F(x) = 1/( scale + c1*(x)^(2)+  c2*(x)^(4)) + bkd
        
        The model has Four parameters: 
        scale  =  scale factor
        c1     =  constant
        c2     =  constant
        bkd    =  incoherent background"""
        ## Define parameters
        self.params = {}
        self.params['c1']     = -30.0
        self.params['c2']     = 5000.0
        self.params['scale']  = 0.1
        self.params['background']    = 0.0

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['c1']    = ['', None, None ]
        self.details['c2']    = ['', 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,代码行数:31,代码来源:TeubnerStreyModel.py


示例15: __init__

    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,代码行数:35,代码来源:Poly_GaussCoil.py


示例16: __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:mcvine,项目名称:sansmodels,代码行数:30,代码来源:PeakLorentzModel.py


示例17: __init__

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


示例18: __init__

    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,代码行数:35,代码来源:VesicleModel.py


示例19: __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:mcvine,项目名称:sansmodels,代码行数:28,代码来源:LorentzModel.py


示例20: __init__

    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CCoreShellCylinderModel.__init__, (self,)) 
        CCoreShellCylinderModel.__init__(self)
        
        ## Name of the model
        self.name = "CoreShellCylinderModel"
        ## Model description
        self.description ="""P(q,alpha)= scale/Vs*f(q)^(2) + bkg,  where: f(q)= 2(core_sld
		- solvant_sld)* Vc*sin[qLcos(alpha/2)]
		/[qLcos(alpha/2)]*J1(qRsin(alpha))
		/[qRsin(alpha)]+2(shell_sld-solvent_sld)
		*Vs*sin[q(L+T)cos(alpha/2)][[q(L+T)
		*cos(alpha/2)]*J1(q(R+T)sin(alpha))
		/q(R+T)sin(alpha)]
		
		alpha:is the angle between the axis of
		the cylinder and the q-vector
		Vs: the volume of the outer shell
		Vc: the volume of the core
		L: the length of the core
		shell_sld: the scattering length density
		of the shell
		solvent_sld: the scattering length density
		of the solvent
		bkg: the background
		T: the thickness
		R+T: is the outer radius
		L+2T: The total length of the outershell
		J1: the first order Bessel function
		theta: axis_theta of the cylinder
		phi: the axis_phi of the cylinder..."""
       
        ## 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['length'] = ['[A]', None, None]
        self.details['core_sld'] = ['[1/A^(2)]', None, None]
        self.details['shell_sld'] = ['[1/A^(2)]', None, None]
        self.details['solvent_sld'] = ['[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]

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python data.get_data_builder函数代码示例发布时间:2022-05-27
下一篇:
Python state_gui_model.StateGuiModel类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap