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 = []
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 = []
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 = []
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 = []
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= []
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CEllipticalCylinderModel.__init__, (self,)) CEllipticalCylinderModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "EllipticalCylinderModel" ## Model description self.description = """ Model parameters: r_minor = the radius of minor axis of the cross section r_ratio = the ratio of (r_major /r_minor >= 1) length = the length of the cylinder sldCyl = SLD of the cylinder sldSolv = SLD of solvent - background = incoherent background """ ## Parameter details [units, min, max] self.details = {} self.details['r_minor'] = ['[A]', None, None] self.details['scale'] = ['', None, None] self.details['r_ratio'] = ['', None, None] self.details['length'] = ['[A]', None, None] self.details['sldCyl'] = ['[1/A^(2)]', None, None] self.details['sldSolv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] self.details['cyl_theta'] = ['[deg]', None, None] self.details['cyl_phi'] = ['[deg]', None, None] self.details['cyl_psi'] = ['[deg]', None, None] ## fittable parameters self.fixed = ['cyl_phi.width', 'cyl_theta.width', 'cyl_psi.width', 'length.width', 'r_minor.width', 'r_ratio.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = ['cyl_phi', 'cyl_theta', 'cyl_psi', 'cyl_phi.width', 'cyl_theta.width', 'cyl_psi.width'] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
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 = []
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= []
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 = []
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= []
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 = []
def __init__(self, name="Plugin Model"): """ Initialization """ BaseComponent.__init__(self) self.name = name self.details = {} self.params = {} self.description = 'plugin model'
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 = []
def __init__(self , name="Plugin Model" ): """ Initialization """ BaseComponent.__init__(self) self.name = name self.details = {} self.params = {} self.description = 'plugin model'
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CLinearPearlsModel.__init__, (self,)) CLinearPearlsModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "LinearPearlsModel" ## Model description self.description = """ Calculate form factor for Pearl Necklace Model [Macromol. 1996, 29, 2974-2979] Parameters: background:background scale: scale factor sld_pearl: the SLD of the pearl spheres sld_solv: the SLD of the solvent num_pearls: number of the pearls radius: the radius of a pearl edge_separation: the length of string segment; surface to surface """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['radius'] = ['[A]', None, None] self.details['edge_separation'] = ['[A]', None, None] self.details['num_pearls'] = ['', None, None] self.details['sld_pearl'] = ['[1/A^(2)]', None, None] self.details['sld_solv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['', None, None] self.details['scale'] = ['', None, None] self.details['radius'] = ['[A]', None, None] self.details['edge_separation'] = ['[A]', None, None] self.details['num_pearls'] = ['', None, None] self.details['sld_pearl'] = ['[1/A^(2)]', None, None] self.details['sld_solv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['', None, None] ## fittable parameters self.fixed = ['radius.width', 'edge_separation.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def setParam(self, name, value): """ Set a parameter value :param name: parameter name """ if name.lower() in self.params: BaseComponent.setParam(self, name, value) else: self.model.setParam(name, value)
def __init__(self): """ Initialization """ # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) ## Name of the model self.name = "NoStructure" self.description = """ NoStructure factor
def __init__(self): """ Initialization """ # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) ## Name of the model self.name = "NoStructure" self.description=""" NoStructure factor
def __init__(self): """ Initialization """ # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) ## Name of the model self.name = "Error!" self.description="""Error model
def __init__(self): """ Initialization """ # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) ## Name of the model self.name = "Error!" self.description = """Error model
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CTriaxialEllipsoidModel.__init__, (self,)) CTriaxialEllipsoidModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "TriaxialEllipsoidModel" ## Model description self.description = """ Note: During fitting ensure that the inequality A<B<C is not violated. Otherwise the calculation will not be correct. """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['semi_axisA'] = ['[A]', None, None] self.details['semi_axisB'] = ['[A]', None, None] self.details['semi_axisC'] = ['[A]', None, None] self.details['sldEll'] = ['[1/A^(2)]', None, None] self.details['sldSolv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] self.details['axis_theta'] = ['[deg]', None, None] self.details['axis_phi'] = ['[deg]', None, None] self.details['axis_psi'] = ['[deg]', None, None] ## fittable parameters self.fixed = ['axis_psi.width', 'axis_phi.width', 'axis_theta.width', 'semi_axisA.width', 'semi_axisB.width', 'semi_axisC.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = ['axis_psi', 'axis_phi', 'axis_theta', 'axis_psi.width', 'axis_phi.width', 'axis_theta.width'] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CEllipticalCylinderModel.__init__, (self,)) CEllipticalCylinderModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "EllipticalCylinderModel" ## Model description self.description = """ Model parameters: r_minor = the radius of minor axis of the cross section r_ratio = the ratio of (r_major /r_minor >= 1) length = the length of the cylinder sldCyl = SLD of the cylinder sldSolv = SLD of solvent - background = incoherent background """ ## Parameter details [units, min, max] self.details = {} self.details['r_minor'] = ['[A]', None, None] self.details['scale'] = ['', None, None] self.details['r_ratio'] = ['', None, None] self.details['length'] = ['[A]', None, None] self.details['sldCyl'] = ['[1/A^(2)]', None, None] self.details['sldSolv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] self.details['cyl_theta'] = ['[deg]', None, None] self.details['cyl_phi'] = ['[deg]', None, None] self.details['cyl_psi'] = ['[deg]', None, None] ## fittable parameters self.fixed = [ 'cyl_phi.width', 'cyl_theta.width', 'cyl_psi.width', 'length.width', 'r_minor.width', 'r_ratio.width' ] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [ 'cyl_phi', 'cyl_theta', 'cyl_psi', 'cyl_phi.width', 'cyl_theta.width', 'cyl_psi.width' ] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CRaspBerryModel.__init__, (self,)) CRaspBerryModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "RaspBerryModel" ## Model description self.description = """ RaspBerryModel: volf_Lsph = volume fraction large spheres radius_Lsph = radius large sphere (A) sld_Lsph = sld large sphere (A-2) volf_Ssph = volume fraction small spheres radius_Ssph = radius small sphere (A) surfrac_Ssph = fraction of small spheres at surface sld_Ssph = sld small sphere delta_Ssph = small sphere penetration (A) sld_solv = sld solvent background = background (cm-1) Ref: J. coll. inter. sci. (2010) vol. 343 (1) pp. 36-41. """ ## Parameter details [units, min, max] self.details = {} self.details['volf_Lsph'] = ['', None, None] self.details['radius_Lsph'] = ['[A]', None, None] self.details['sld_Lsph'] = ['[1/A^(2)]', None, None] self.details['volf_Ssph'] = ['', None, None] self.details['radius_Ssph'] = ['[A]', None, None] self.details['surfrac_Ssph'] = ['', None, None] self.details['sld_Ssph'] = ['[1/A^(2)]', None, None] self.details['delta_Ssph'] = ['', None, None] self.details['sld_solv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] ## fittable parameters self.fixed = ['radius_Lsph.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CHollowCylinderModel.__init__, (self,)) CHollowCylinderModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "HollowCylinderModel" ## Model description self.description = """ P(q) = scale*<f*f>/Vol + bkg, where f is the scattering amplitude. core_radius = the radius of core radius = the radius of shell length = the total length of the cylinder sldCyl = SLD of the shell sldSolv = SLD of the solvent background = incoherent background """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['core_radius'] = ['[A]', None, None] self.details['radius'] = ['[A]', None, None] self.details['length'] = ['[A]', None, None] self.details['sldCyl'] = ['[1/A^(2)]', None, None] self.details['sldSolv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] self.details['axis_theta'] = ['[deg]', None, None] self.details['axis_phi'] = ['[deg]', None, None] ## fittable parameters self.fixed = [ 'axis_phi.width', 'axis_theta.width', 'length.width', 'core_radius.width', 'radius' ] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [ 'axis_phi', 'axis_theta', 'axis_phi.width', 'axis_theta.width' ] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CStickyHSStructure.__init__, (self,)) CStickyHSStructure.__init__(self) self.is_multifunc = False ## Name of the model self.name = "StickyHSStructure" ## Model description self.description = """ Structure Factor for interacting particles: . The interaction potential is U(r)= inf , r < 2R = -Uo , 2R < r < 2R + w = 0 , r >= 2R +w R: effective radius of the hardsphere stickiness = [exp(Uo/kT)]/(12*perturb) perturb = w/(w+ 2R) , 0.01 =< w <= 0.1 w: The width of the square well ,w > 0 v: The volume fraction , v > 0 Ref: Menon, S. V. G.,et.al., J. Chem. Phys., 1991, 95(12), 9186-9190. """ ## Parameter details [units, min, max] self.details = {} self.details['effect_radius'] = ['[A]', None, None] self.details['volfraction'] = ['', None, None] self.details['perturb'] = ['', None, None] self.details['stickiness'] = ['', None, None] ## fittable parameters self.fixed = ['effect_radius.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CHayterMSAStructure.__init__, (self,)) CHayterMSAStructure.__init__(self) self.is_multifunc = False ## Name of the model self.name = "HayterMSAStructure" ## Model description self.description = """ To calculate the structure factor (the Fourier transform of the pair correlation function g(r)) for a system of charged, spheroidal objects in a dielectric medium. When combined with an appropriate form factor, this allows for inclusion of the interparticle interference effects due to screened coulomb repulsion between charged particles. (Note: charge > 0 required.) Ref: JP Hansen and JB Hayter, Molecular Physics 46, 651-656 (1982). """ ## Parameter details [units, min, max] self.details = {} self.details['effect_radius'] = ['[A]', None, None] self.details['charge'] = ['', None, None] self.details['volfraction'] = ['', None, None] self.details['temperature'] = ['[K]', None, None] self.details['saltconc'] = ['[M]', None, None] self.details['dielectconst'] = ['', None, None] ## fittable parameters self.fixed = ['effect_radius.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CRectangularHollowPrismModel.__init__, (self,)) CRectangularHollowPrismModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "RectangularHollowPrismModel" ## Model description self.description = """ Form factor for a hollow rectangular prism with uniform scattering length density. scale:Scale factor short_side: shortest side of the rectangular prism [A] b2a_ratio: ratio b/a [adim] c2a_ratio: ratio c/a [adim] thickness: thickness of the walls [A] sldPipe: Pipe_sld sldSolv: solvent_sld background:Incoherent Background [1/cm] """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['short_side'] = ['[A]', None, None] self.details['b2a_ratio'] = ['[adim]', None, None] self.details['c2a_ratio'] = ['[adim]', None, None] self.details['thickness'] = ['[A]', None, None] self.details['sldPipe'] = ['[1/A^(2)]', None, None] self.details['sldSolv'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] ## fittable parameters self.fixed = [ 'short_side.width', 'b2a_ratio.width', 'c2a_ratio.width', 'thicness.width' ] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): BaseComponent.__init__(self) """ :param multfactor: number of cases in the model, assumes 0<= case# <=10. """ ## Setting model name model description self.description = "" model = RPAModel() self.model = model self.name = "RPA10Model" self.description = model.description self.case_num = multfactor ## Define parameters self.params = {} ## Parameter details [units, min, max] self.details = {} # non-fittable parameters self.non_fittable = model.non_fittable # list of function in order of the function number self.fun_list = self._get_func_list() ## dispersion self._set_dispersion() ## Define parameters self._set_params() ## Parameter details [units, min, max] self._set_details() # list of parameter that can be fitted self._set_fixed_params() self.model.params["lcase_n"] = self.case_num ## functional multiplicity of the model self.multiplicity_info = [ max_case_n, "Case No.:", [ "C/D Binary Mixture of Homopolymers", "C-D Diblock Copolymer", "B/C/D Ternary Mixture of Homopolymers", "B/C-D Mixture of Homopolymer B and Diblock Copolymer C-D", "B-C-D Triblock Copolymer", "A/B/C/D Quaternary Mixture of Homopolymers", "A/B/C-D Mixture of Homopolymer A/B and Diblock C-D", "A/B-C-D Mixture of Homopolymer A and triblock B-C-D", "A-B/C-D Mixture of Diblock Copolymer A-B and Diblock C-D", "A-B-C-D Four-block Copolymer", ], [], ]
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CCore2ndMomentModel.__init__, (self,)) CCore2ndMomentModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "Core2ndMomentModel" ## Model description self.description = """ Calculate CoreSecondMoment Model scale:calibration factor, density_poly: density of the layer sld_poly: the SLD of the layer volf_cores: volume fraction of cores ads_amount: adsorbed amount second_moment: second moment of the layer sld_solv: the SLD of the solvent background """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['density_poly'] = ['[g/cm^(3)]', None, None] self.details['sld_poly'] = ['[1/A^(2)]', None, None] self.details['radius_core'] = ['[A]', None, None] self.details['volf_cores'] = ['', None, None] self.details['ads_amount'] = ['[mg/m^(2)]', None, None] self.details['sld_solv'] = ['[1/A^(2)]', None, None] self.details['second_moment'] = ['[A]', None, None] self.details['background'] = ['[1/cm]', None, None] ## fittable parameters self.fixed = ['radius_core.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CSquareWellStructure.__init__, (self,)) CSquareWellStructure.__init__(self) self.is_multifunc = False ## Name of the model self.name = "SquareWellStructure" ## Model description self.description = """ Structure Factor for interacting particles: . The interaction potential is U(r)= inf , r < 2R = -d , 2R <= r <=2Rw = 0 , r >= 2Rw R: effective radius (A)of the particle v: volume fraction d: well depth w: well width; multiples of the particle diameter Ref: Sharma, R. V.; Sharma, K. C., Physica, 1977, 89A, 213. """ ## Parameter details [units, min, max] self.details = {} self.details['effect_radius'] = ['[A]', None, None] self.details['volfraction'] = ['', None, None] self.details['welldepth'] = ['[kT]', None, None] self.details['wellwidth'] = ['', None, None] ## fittable parameters self.fixed = ['effect_radius.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
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 = {}
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CMassFractalModel.__init__, (self,)) CMassFractalModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "MassFractalModel" ## Model description self.description = """ The scattering intensity I(x) = scale*P(x)*S(x) + background, where scale = scale_factor * V * delta^(2) p(x)= F(x*radius)^(2) F(x) = 3*[sin(x)-x cos(x)]/x**3 S(x) = [(gamma(Dm-1)*colength^(Dm-1)*[1+(x^2*colength^2)]^((1-Dm)/2) * sin[(Dm-1)*arctan(x*colength)])/x] where delta = sldParticle -sldSolv. radius = Particle radius mass_dim = Mass fractal dimension co_length = Cut-off length background = background Ref.:Mildner, Hall,J Phys D Appl Phys(1986), 9, 1535-1545 Note I: This model is valid for 1<mass_dim<6. Note II: This model is not in absolute scale. """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['radius'] = ['[A]', None, None] self.details['mass_dim'] = ['', None, None] self.details['co_length'] = ['[A]', None, None] self.details['background'] = ['', None, None] ## fittable parameters self.fixed = [] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
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'
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CLamellarPCrystalModel.__init__, (self,)) CLamellarPCrystalModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "LamellarPCrystalModel" ## Model description self.description = """ [Lamellar ParaCrystal Model] Parameter Definitions: scale = scale factor, background = incoherent background thickness = lamellar thickness, sld_layer = layer scattering length density , sld_solvent = solvent scattering length density. Nlayers = no. of lamellar layers spacing = spacing between layers pd_spacing = polydispersity of spacing Note: This model can be used for large multilamellar vesicles. """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['thickness'] = ['[A]', None, None] self.details['Nlayers'] = ['', None, None] self.details['spacing'] = ['[A]', None, None] self.details['pd_spacing'] = ['', None, None] self.details['sld_layer'] = ['[1/A^(2)]', None, None] self.details['sld_solvent'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] ## fittable parameters self.fixed = ['thickness.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
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'
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CMassSurfaceFractal.__init__, (self,)) CMassSurfaceFractal.__init__(self) self.is_multifunc = False ## Name of the model self.name = "MassSurfaceFractal" ## Model description self.description = """ The scattering intensity I(x) = scale*P(x) + background, p(x)= {[1+(x^2*a)]^(Dm/2) * [1+(x^2*b)]^(6-Ds-Dm)/2}^(-1) a = Rg^2/(3*Dm/2) b = rg^2/(3*(6-Ds-Dm)/2) scale = scale factor * N*Volume^2*contrast^2 mass_dim = Dm (mass fractal dimension) surface_dim = Ds cluster_rg = Rg primary_rg = rg background = background Ref: Schmidt, J Appl Cryst, eq(19), (1991), 24, 414-435 : Hurd, Schaefer, Martin, Phys Rev A, eq(2),(1987),35, 2361-2364 Note that 0 < Ds< 6 and 0 < Dm < 6. """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['mass_dim'] = ['', None, None] self.details['surface_dim'] = ['', None, None] self.details['cluster_rg'] = ['[A]', None, None] self.details['primary_rg'] = ['[A]', None, None] self.details['background'] = ['', None, None] ## fittable parameters self.fixed = [] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
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'
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CMultiShellModel.__init__, (self,)) CMultiShellModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "MultiShellModel" ## Model description self.description = """ MultiShell (Sphere) Model (or Multilamellar Vesicles): Model parameters; scale : scale factor core_radius : Core radius of the multishell s_thickness: shell thickness w_thickness: water thickness core_sld: core scattering length density shell_sld: shell scattering length density n_pairs:number of pairs of water/shell background: incoherent background """ ## Parameter details [units, min, max] self.details = {} self.details['scale'] = ['', None, None] self.details['core_radius'] = ['[A]', None, None] self.details['s_thickness'] = ['[A]', None, None] self.details['w_thickness'] = ['[A]', None, None] self.details['core_sld'] = ['[1/A^(2)]', None, None] self.details['shell_sld'] = ['[1/A^(2)]', None, None] self.details['n_pairs'] = ['', None, None] self.details['background'] = ['[1/cm]', None, None] ## fittable parameters self.fixed = ['core_radius.width', 's_thickness.width', 'w_thickness.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CFractalModel.__init__, (self,)) CFractalModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "FractalModel" ## Model description self.description = """ The scattering intensity I(x) = P(|x|)*S(|x|) + background, where p(x)= scale * V * delta^(2)* F(x*radius)^(2) F(x) = 3*[sin(x)-x cos(x)]/x**3 where delta = sldBlock -sldSolv. scale = scale factor * Volume fraction radius = Block radius fractal_dim = Fractal dimension cor_length = Correlation Length sldBlock = SDL block sldSolv = SDL solvent background = background """ ## Parameter details [units, min, max] self.details = {} self.details['radius'] = ['[A]', None, None] self.details['scale'] = ['', None, None] self.details['fractal_dim'] = ['', None, None] self.details['cor_length'] = ['[A]', None, None] self.details['sldBlock'] = ['[1/A^(2)]', None, None] self.details['sldSolv'] = ['[1/A^(2)]', 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 = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
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'
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CBinaryHSModel.__init__, (self,)) CBinaryHSModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "BinaryHSModel" ## Model description self.description = """ Model parameters: l_radius : large radius of binary hard sphere s_radius : small radius of binary hard sphere vol_frac_ls : volume fraction of large spheres vol_frac_ss : volume fraction of small spheres ls_sld: large sphere scattering length density ss_sld: small sphere scattering length density solvent_sld: solvent scattering length density background: incoherent background """ ## Parameter details [units, min, max] self.details = {} self.details['l_radius'] = ['[A]', None, None] self.details['s_radius'] = ['[A]', None, None] self.details['vol_frac_ls'] = ['', None, None] self.details['vol_frac_ss'] = ['', None, None] self.details['ls_sld'] = ['[1/A^(2)]', None, None] self.details['ss_sld'] = ['[1/A^(2)]', None, None] self.details['solvent_sld'] = ['[1/A^(2)]', None, None] self.details['background'] = ['[1/cm]', None, None] ## fittable parameters self.fixed = ['l_radius.width', 's_radius.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None
def __init__(self, multfactor=1): """ Initialization """ self.__dict__ = {} # Initialize BaseComponent first, then sphere BaseComponent.__init__(self) #apply(CFuzzySphereModel.__init__, (self,)) CFuzzySphereModel.__init__(self) self.is_multifunc = False ## Name of the model self.name = "FuzzySphereModel" ## Model description self.description = """ scale: scale factor times volume fraction, or just volume fraction for absolute scale data radius: radius of the solid sphere fuzziness = the STD of the height of fuzzy interfacial thickness (ie., so-called interfacial roughness) sldSph: the SLD of the sphere sldSolv: the SLD of the solvent background: incoherent background Note: By definition, this function works only when fuzziness << radius. """ ## Parameter details [units, min, max] self.details = {} self.details['radius'] = ['[A]', None, None] self.details['scale'] = ['', None, None] self.details['fuzziness'] = ['[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] ## fittable parameters self.fixed = ['radius.width', 'fuzziness.width'] ## non-fittable parameters self.non_fittable = [] ## parameters with orientation self.orientation_params = [] ## parameters with magnetism self.magnetic_params = [] self.category = None self.multiplicity_info = None