Esempio n. 1
0
    def __init__(self, model_info):
        """ Initialization"""
        BaseComponent.__init__(self)

        self.parameter_info = pars = model_info.parameter_info

        # ===== 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.units, None, None]) for p in pars)
        self.dispersion = dict((p.name, GaussianDispersion().get_pars())
                               for p in pars
                               if p.flags & (PF_Polydisperse | PF_Orientation))
        #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 & (PF_Unfittable | PF_RepeatCount)
        ]
        self.orientation_params = [
            p.name for p in pars if p.flags & PF_Orientation
        ]

        self.magnetic_params = [p.name for p in pars if p.flags & PF_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}"
Esempio n. 2
0
    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 = []
Esempio n. 3
0
    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 = []
Esempio n. 4
0
    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= []      
Esempio n. 5
0
    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 = []
Esempio n. 6
0
    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 = []
Esempio n. 7
0
    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 = []
Esempio n. 8
0
    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= []    
Esempio n. 9
0
    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 = []
Esempio n. 10
0
    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 = []
Esempio n. 11
0
    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 = []
Esempio n. 12
0
    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 = []
Esempio n. 13
0
    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 = []
Esempio n. 14
0
    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 = []
Esempio n. 15
0
    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 = []
Esempio n. 16
0
    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 = []
Esempio n. 17
0
    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}"
Esempio n. 18
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "LogNormal"
        ## Model description
        self.description = """f(x)=scale * 1/(sigma*math.sqrt(2pi))e^(-1/2*((math.log(x)-mu)/sigma)^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 = []
Esempio n. 19
0
    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= []  
Esempio n. 20
0
    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 = []
Esempio n. 21
0
    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 = []
Esempio n. 22
0
    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 = []
Esempio n. 23
0
    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 = []
Esempio n. 24
0
    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 = []
Esempio n. 25
0
    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 = []
Esempio n. 26
0
    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 = []
Esempio n. 27
0
    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 = []
Esempio n. 28
0
    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= []
Esempio n. 29
0
 def setParam(self, name, value):
 	"""
 	"""
 	if name.lower() in self.params:
 		BaseComponent.setParam(self, name, value)
 	else:
 		self.model.setParam(name, value)
Esempio n. 30
0
 def __init__(self, name="Plugin Model"):
     """ Initialization """
     BaseComponent.__init__(self)
     self.name = name
     self.details = {}
     self.params = {}
     self.description = ''
Esempio n. 31
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "FlexibleCylinderModel"
        ## 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['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']

        ## non-fittable parameters
        self.non_fittable = []

        ## parameters with orientation
        self.orientation_params = []
Esempio n. 32
0
    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= []  
Esempio n. 33
0
    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= []      
Esempio n. 34
0
    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= []  
Esempio n. 35
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "DAB_Model"
        self.description = """F(x) = scale*(L^3)/( 1 + (x*L)^2 )^(2) + background
        
        The model has three parameters: 
        L             =  Correlation Length
        scale         =  scale factor
        background    =  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 = []
Esempio n. 36
0
 def __init__(self , name="Plugin Model" ):
     """ Initialization """
     BaseComponent.__init__(self)
     self.name = name
     self.details = {}
     self.params  = {}
     self.description=''
Esempio n. 37
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "CSParallelepipedModel"
        ## Model description
        self.description = """ Form factor for a rectangular Shell. Below are the Parameters.
		scale: scale factor
		shortA: length of short edge  [A]
		midB: length of another short edge [A]
		longC: length of long edge  of the parallelepiped [A]
		rimA: length of short edge  [A]
		rimB: length of another short edge [A]
		rimC: length of long edge  of the parallelepiped [A]
		sld_rimA: sld of rimA [1/A^(2)]
		sld_rimB: sld of rimB [1/A^(2)]
		sld_rimC: sld of rimC [1/A^(2)]
		sld_core: Pipe_sld [1/A^(2)]
		sld_solv: solvent_sld [1/A^(2)]
		background: incoherent Background [1/cm]"""

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['shortA'] = ['[A]', None, None]
        self.details['midB'] = ['[A]', None, None]
        self.details['longC'] = ['[A]', None, None]
        self.details['rimA'] = ['[A]', None, None]
        self.details['rimB'] = ['[A]', None, None]
        self.details['rimC'] = ['[A]', None, None]
        self.details['sld_rimA'] = ['[1/A^(2)]', None, None]
        self.details['sld_rimB'] = ['[1/A^(2)]', None, None]
        self.details['sld_rimC'] = ['[1/A^(2)]', None, None]
        self.details['sld_pcore'] = ['[1/A^(2)]', None, None]
        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['parallel_theta'] = ['[deg]', None, None]
        self.details['parallel_phi'] = ['[deg]', None, None]
        self.details['parallel_psi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed = [
            'shortA.width', 'midB.width', 'longC.width', 'parallel_phi.width',
            'parallel_psi.width', 'parallel_theta.width'
        ]

        ## non-fittable parameters
        self.non_fittable = []

        ## parameters with orientation
        self.orientation_params = [
            'parallel_phi', 'parallel_psi', 'parallel_theta',
            'parallel_phi.width', 'parallel_psi.width', 'parallel_theta.width'
        ]
Esempio n. 38
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "CoreShellEllipsoidModel"
        ## Model description
        self.description = """[SpheroidCoreShellModel] Calculates the form factor for an spheroid
		ellipsoid particle with a core_shell structure.
		The form factor is averaged over all possible
		orientations of the ellipsoid such that P(q)
		= scale*<f^2>/Vol + bkg, where f is the
		single particle scattering amplitude.
		[Parameters]:
		equat_core = equatorial radius of core,
		polar_core = polar radius of core,
		equat_shell = equatorial radius of shell,
		polar_shell = polar radius (revolution axis) of shell,
		sld_core = SLD_core
		sld_shell = SLD_shell
		sld_solvent = SLD_solvent
		background = Incoherent bkg
		scale =scale
		Note:It is the users' responsibility to ensure
		that shell radii are larger than core radii.
		oblate: polar radius < equatorial radius
		prolate :  polar radius > equatorial radius"""

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['equat_core'] = ['[A]', None, None]
        self.details['polar_core'] = ['[A]', None, None]
        self.details['equat_shell'] = ['[A]', None, None]
        self.details['polar_shell'] = ['[A]', None, None]
        self.details['sld_core'] = ['[1/A^(2)]', None, None]
        self.details['sld_shell'] = ['[1/A^(2)]', None, None]
        self.details['sld_solvent'] = ['[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 = [
            'equat_core.width', 'polar_core.width', 'equat_shell.width',
            'polar_shell.width', 'axis_phi.width', 'axis_theta.width'
        ]

        ## non-fittable parameters
        self.non_fittable = []

        ## parameters with orientation
        self.orientation_params = [
            'axis_phi', 'axis_theta', 'axis_phi.width', 'axis_theta.width'
        ]
Esempio n. 39
0
    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']
Esempio n. 40
0
 def __init__(self):
     """ Initialization """
     
     # Initialize BaseComponent first, then sphere
     BaseComponent.__init__(self)
     
     ## Name of the model
     self.name = "NoStructure"
     self.description=""" NoStructure factor
Esempio n. 41
0
 def __init__(self):
     """ Initialization """
     
     # Initialize BaseComponent first, then sphere
     BaseComponent.__init__(self)
     
     ## Name of the model
     self.name = "Error!"
     self.description="""Error  model
Esempio n. 42
0
 def __init__(self):
     """ Initialization """
     
     # Initialize BaseComponent first, then sphere
     BaseComponent.__init__(self)
     
     ## Name of the model
     self.name = "Cos"
     self.description='F(x)=cos(x)'
     ## Parameter details [units, min, max]
     self.details = {}
Esempio n. 43
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "Cos"
        self.description = 'F(x)=cos(x)'
        ## Parameter details [units, min, max]
        self.details = {}
Esempio n. 44
0
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CCoreShellEllipsoidModel.__init__, (self,)) 
        CCoreShellEllipsoidModel.__init__(self)
        
        ## Name of the model
        self.name = "CoreShellEllipsoidModel"
        ## Model description
        self.description ="""[SpheroidCoreShellModel] Calculates the form factor for an spheroid
		ellipsoid particle with a core_shell structure.
		The form factor is averaged over all possible
		orientations of the ellipsoid such that P(q)
		= scale*<f^2>/Vol + bkg, where f is the
		single particle scattering amplitude.
		[Parameters]:
		equat_core = equatorial radius of core,
		polar_core = polar radius of core,
		equat_shell = equatorial radius of shell,
		polar_shell = polar radius (revolution axis) of shell,
		sld_core = SLD_core
		sld_shell = SLD_shell
		sld_solvent = SLD_solvent
		background = Incoherent bkg
		scale =scale
		Note:It is the users' responsibility to ensure
		that shell radii are larger than core radii.
		oblate: polar radius < equatorial radius
		prolate :  polar radius > equatorial radius"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['equat_core'] = ['[A]', None, None]
        self.details['polar_core'] = ['[A]', None, None]
        self.details['equat_shell'] = ['[A]', None, None]
        self.details['polar_shell'] = ['[A]', None, None]
        self.details['sld_core'] = ['[1/A^(2)]', None, None]
        self.details['sld_shell'] = ['[1/A^(2)]', None, None]
        self.details['sld_solvent'] = ['[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=['equat_core.width', 'polar_core.width', 'equat_shell.width', 'polar_shell.width', 'axis_phi.width', 'axis_theta.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = ['axis_phi', 'axis_theta', 'axis_phi.width', 'axis_theta.width']
Esempio n. 45
0
 def __init__(self, base=None, other=None):
     """
         @param base: component to multiply
         @param other: component to multiply by
     """
     BaseComponent.__init__(self)
     # Component to multiply
     self.operateOn = base
     # Component to multiply by
     self.other = other
     # name
     self.name = 'MulComponent'
Esempio n. 46
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "EllipsoidModel"
        ## Model description
        self.description = """"P(q.alpha)= scale*f(q)^(2)+ bkg, where f(q)= 3*(sld_ell
		- sld_solvent)*V*[sin(q*r(Ra,Rb,alpha))
		-q*r*cos(qr(Ra,Rb,alpha))]
		/[qr(Ra,Rb,alpha)]^(3)"
		
		r(Ra,Rb,alpha)= [Rb^(2)*(sin(alpha))^(2)
		+ Ra^(2)*(cos(alpha))^(2)]^(1/2)
		
		scatter_sld: SLD of the scatter
		solvent_sld: SLD of the solvent
		sldEll: SLD of ellipsoid
		sldSolv: SLD of solvent
		V: volune of the Eliipsoid
		Ra: radius along the rotation axis
		of the Ellipsoid
		Rb: radius perpendicular to the
		rotation axis of the ellipsoid"""

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['radius_a'] = ['[A]', None, None]
        self.details['radius_b'] = ['[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]

        ## fittable parameters
        self.fixed = [
            'axis_phi.width', 'axis_theta.width', 'radius_a.width',
            'radius_b.width', 'length.width', 'r_minor.width'
        ]

        ## non-fittable parameters
        self.non_fittable = []

        ## parameters with orientation
        self.orientation_params = [
            'axis_phi.width', 'axis_theta.width', 'axis_phi', 'axis_theta'
        ]
Esempio n. 47
0
 def __init__(self, base=None, other=None):
     """
         @param base: component to subtract from
         @param other: component to subtract
     """
     BaseComponent.__init__(self)
     # Component to subtract from
     self.operateOn = base
     # Component to subtract
     self.other = other
     # name
     self.name = 'SubComponent'
Esempio n. 48
0
    def __init__(self):
        """ Initialization """

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

        ## Name of the model
        self.name = "BCCrystalModel"
        ## Model description
        self.description = """P(q)=(scale/Vp)*V_lattice*P(q)*Z(q)+bkg where scale is the volume
		fraction of sphere,
		Vp = volume of the primary particle,
		V_lattice = volume correction for
		for the crystal structure,
		P(q)= form factor of the sphere (normalized),
		Z(q)= paracrystalline structure factor
		for a face centered cubic structure.
		[Body Centered Cubic ParaCrystal Model]
		Parameters;
		scale: volume fraction of spheres
		bkg:background, R: radius of sphere
		dnn: Nearest neighbor distance
		d_factor: Paracrystal distortion factor
		radius: radius of the spheres
		sldSph: SLD of the sphere
		sldSolv: SLD of the solvent
		"""

        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['dnn'] = ['[A]', None, None]
        self.details['d_factor'] = ['', None, None]
        self.details['radius'] = ['[A]', None, None]
        self.details['sldSph'] = ['[1/A^(2)]', None, None]
        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['theta'] = ['[deg]', None, None]
        self.details['phi'] = ['[deg]', None, None]
        self.details['psi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed = ['radius.width', 'phi.width', 'psi.width', 'theta.width']

        ## non-fittable parameters
        self.non_fittable = []

        ## parameters with orientation
        self.orientation_params = [
            'phi', 'psi', 'theta', 'phi.width', 'psi.width', 'theta.width'
        ]
Esempio n. 49
0
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CCSParallelepipedModel.__init__, (self,)) 
        CCSParallelepipedModel.__init__(self)
        
        ## Name of the model
        self.name = "CSParallelepipedModel"
        ## Model description
        self.description =""" Form factor for a rectangular Shell. Below are the Parameters.
		scale: scale factor
		shortA: length of short edge  [A]
		midB: length of another short edge [A]
		longC: length of long edge  of the parallelepiped [A]
		rimA: length of short edge  [A]
		rimB: length of another short edge [A]
		rimC: length of long edge  of the parallelepiped [A]
		sld_rimA: sld of rimA [1/A^(2)]
		sld_rimB: sld of rimB [1/A^(2)]
		sld_rimC: sld of rimC [1/A^(2)]
		sld_core: Pipe_sld [1/A^(2)]
		sld_solv: solvent_sld [1/A^(2)]
		background: incoherent Background [1/cm]"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['shortA'] = ['[A]', None, None]
        self.details['midB'] = ['[A]', None, None]
        self.details['longC'] = ['[A]', None, None]
        self.details['rimA'] = ['[A]', None, None]
        self.details['rimB'] = ['[A]', None, None]
        self.details['rimC'] = ['[A]', None, None]
        self.details['sld_rimA'] = ['[1/A^(2)]', None, None]
        self.details['sld_rimB'] = ['[1/A^(2)]', None, None]
        self.details['sld_rimC'] = ['[1/A^(2)]', None, None]
        self.details['sld_pcore'] = ['[1/A^(2)]', None, None]
        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['parallel_theta'] = ['[deg]', None, None]
        self.details['parallel_phi'] = ['[deg]', None, None]
        self.details['parallel_psi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed=['shortA.width', 'midB.width', 'longC.width', 'parallel_phi.width', 'parallel_psi.width', 'parallel_theta.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = ['parallel_phi', 'parallel_psi', 'parallel_theta', 'parallel_phi.width', 'parallel_psi.width', 'parallel_theta.width']
Esempio n. 50
0
 def __init__(self, base=None, other=None):
     """
         @param base: component to div
         @param other: component to div by
     """
     BaseComponent.__init__(self)
     # Component to divide
     self.operateOn = base
     # Component to divide by
     self.other = other
     # name
     self.name = 'DivComponent'
Esempio n. 51
0
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CLamellarPSHGModel.__init__, (self,)) 
        CLamellarPSHGModel.__init__(self)
        
        ## Name of the model
        self.name = "LamellarPSHGModel"
        ## Model description
        self.description ="""[Concentrated Lamellar (head+tail) Form Factor]: Calculates the
		intensity from a lyotropic lamellar phase.
		The intensity (form factor and structure factor)
		calculated is for lamellae of two-layer scattering
		length density that are randomly distributed in
		solution (a powder average). The scattering
		length density of the tail region, headgroup
		region, and solvent are taken to be different.
		The model can also be applied to large,
		multi-lamellar vesicles.
		No resolution smeared version is included
		in the structure factor of this model.
		*Parameters: spacing = repeat spacing,
		deltaT = tail length,
		deltaH = headgroup thickness,
		n_plates = # of Lamellar plates
		caille = Caille parameter (<0.8 or <1)
		background = incoherent bgd
		scale = scale factor ..."""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['spacing'] = ['[A]', None, None]
        self.details['deltaT'] = ['[A]', None, None]
        self.details['deltaH'] = ['[A]', None, None]
        self.details['sld_tail'] = ['[1/A^(2)]', None, None]
        self.details['sld_head'] = ['[1/A^(2)]', None, None]
        self.details['sld_solvent'] = ['[1/A^(2)]', None, None]
        self.details['n_plates'] = ['', None, None]
        self.details['caille'] = ['', None, None]
        self.details['background'] = ['[1/cm]', None, None]

        ## fittable parameters
        self.fixed=['deltaT.width', 'deltaH.width', 'spacing.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = []
Esempio n. 52
0
 def __init__(self, base=None, other=None):
     """
     :param base: component to add to 
     :param other: component to add
     
     """
     BaseComponent.__init__(self)
     # Component to add to
     self.operateOn = base
     # Component to add
     self.other = other
     # name
     self.name = 'AddComponent'
Esempio n. 53
0
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CSCCrystalModel.__init__, (self,)) 
        CSCCrystalModel.__init__(self)
        
        ## Name of the model
        self.name = "SCCrystalModel"
        ## Model description
        self.description ="""P(q)=(scale/Vp)*V_lattice*P(q)*Z(q)+bkg where scale is the volume
		fraction of sphere,
		Vp = volume of the primary particle,
		V_lattice = volume correction for
		for the crystal structure,
		P(q)= form factor of the sphere (normalized),
		Z(q)= paracrystalline structure factor
		for a simple cubic structure.
		[Simple Cubic ParaCrystal Model]
		Parameters;
		scale: volume fraction of spheres
		bkg:background, R: radius of sphere
		dnn: Nearest neighbor distance
		d_factor: Paracrystal distortion factor
		radius: radius of the spheres
		sldSph: SLD of the sphere
		sldSolv: SLD of the solvent
		"""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['dnn'] = ['[A]', None, None]
        self.details['d_factor'] = ['', None, None]
        self.details['radius'] = ['[A]', None, None]
        self.details['sldSph'] = ['[1/A^(2)]', None, None]
        self.details['sldSolv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['theta'] = ['[deg]', None, None]
        self.details['phi'] = ['[deg]', None, None]
        self.details['psi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed=['radius.width', 'phi.width', 'psi.width', 'theta.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = ['phi', 'psi', 'theta', 'phi.width', 'psi.width', 'theta.width']
Esempio n. 54
0
    def __init__(self):
        """ Initialization """
        
        # Initialize BaseComponent first, then sphere
        BaseComponent.__init__(self)
        #apply(CBarBellModel.__init__, (self,)) 
        CBarBellModel.__init__(self)
        
        ## Name of the model
        self.name = "BarBellModel"
        ## Model description
        self.description ="""Calculates the scattering from a barbell-shaped cylinder. That is
		a sphereocylinder with spherical end caps
		that have a radius larger than that of
		the cylinder and the center of the end cap
		radius lies outside of the cylinder.
		Note: As the length of cylinder(bar) -->0,
		it becomes a dumbbell.
		And when rad_bar = rad_bell,
		it is a spherocylinder.
		It must be that rad_bar <(=) rad_bell.
		[Parameters];
		scale: volume fraction of spheres,
		background:incoherent background,
		rad_bar: radius of the cylindrical bar,
		len_bar: length of the cylindrical bar,
		rad_bell: radius of the spherical bell,
		sld_barbell: SLD of the barbell,
		sld_solv: SLD of the solvent."""
       
        ## Parameter details [units, min, max]
        self.details = {}
        self.details['scale'] = ['', None, None]
        self.details['rad_bar'] = ['[A]', None, None]
        self.details['len_bar'] = ['[A]', None, None]
        self.details['rad_bell'] = ['[A]', None, None]
        self.details['sld_barbell'] = ['[1/A^(2)]', None, None]
        self.details['sld_solv'] = ['[1/A^(2)]', None, None]
        self.details['background'] = ['[1/cm]', None, None]
        self.details['theta'] = ['[deg]', None, None]
        self.details['phi'] = ['[deg]', None, None]

        ## fittable parameters
        self.fixed=['rad_bar.width', 'len_bar', 'rad_bell', 'phi.width', 'theta.width']
        
        ## non-fittable parameters
        self.non_fittable = []
        
        ## parameters with orientation
        self.orientation_params = ['phi', 'theta', 'phi.width', 'theta.width']