Esempio n. 1
0
    def __init__(self):      ##DO NOT CHANGE THIS LINE!!!
        """
        Initialization
        """
        Model1DPlugin.__init__(self, name=self.name) ##DO NOT CHANGE THIS LINE!!!
        
        ## EDIT PARAMETERS' NAMES AND VALUE
        ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS
        self.params = {}                ##DO NOT CHANGE THIS LINE!!!
        # Set the name same as the file name
        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['C'] = 1.0   ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                                                      
        self.params['A'] = 1.0       ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                 
        self.params['B'] = 0.0      ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                 
        self.params['D'] = 0.0      ## <-----   
        ## YOU CAN ALSO DELETE THIS LINE                 
        self.params['n'] = 1      ## <----- 
 
        ## DEFINE DEFAULT DETAILS
        self.set_details()      ##DO NOT DELETE OR CHANGE THIS LINE!!!
        
        ## YOU CAN MODIFY THE LINE BELLOW.MODIFY WORDS BETWEEN """   """  ONLY!!!!
        self.description = """
Esempio n. 2
0
    def __init__(self):  ##DO NOT CHANGE THIS LINE!!!
        """
        Initialization
        """
        Model1DPlugin.__init__(self,
                               name=self.name)  ##DO NOT CHANGE THIS LINE!!!

        ## EDIT PARAMETERS' NAMES AND VALUE
        ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS
        self.params = {}  ##DO NOT CHANGE THIS LINE!!!
        # Set the name same as the file name
        self.name = self.get_fname()  ##DO NOT CHANGE THIS LINE!!!
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['C'] = 1.0  ## <-----
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['A'] = 1.0  ## <-----
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['B'] = 0.0  ## <-----
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['D'] = 0.0  ## <-----
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['n'] = 1  ## <-----

        ## DEFINE DEFAULT DETAILS
        self.set_details()  ##DO NOT DELETE OR CHANGE THIS LINE!!!

        ## YOU CAN MODIFY THE LINE BELLOW.MODIFY WORDS BETWEEN """   """  ONLY!!!!
        self.description = """
Esempio n. 3
0
    def __init__(self):      ##DO NOT CHANGE THIS LINE!!!
        """
        Initialization
        """
        Model1DPlugin.__init__(self, name=self.name) ##DO NOT CHANGE THIS LINE!!!
        
        ## EDIT PARAMETERS' NAMES AND VALUE
        ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS
        self.params = {}                ##DO NOT CHANGE THIS LINE!!!
        # Set the name same as the file name
        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE
        self.params['scale'] = 1.0   ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                                                      
        self.params['A'] = 0.0       ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                 
        self.params['B'] = 10.0      ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                  
        self.params['C'] = 0.0       ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                
        self.params['D'] = 0.0     ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                   
        self.params['E'] = 0.0     ## <-----   
        ## YOU CAN MODIFY THELINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
        ## YOU CAN ALSO DELETE THIS LINE                  
        self.params['F'] = 0.0     ## <-----          

        ## STORING PARAMETERS  [UNIT, MINIMUM VALUE, MAXIMUM VALUE]
        self.details = {}    ##DO NOT CHANGE THIS LINE!!!
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBESR TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE      
        self.details['scale'] = ['',None, None]    ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBERS TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE     
        self.details['A'] = ['', None, None]        ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBERS TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE     
        self.details['B'] = ['', None, None]        ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBERS TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE     
        self.details['C'] = ['', None, None]        ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBERS TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE     
        self.details['D'] = ['', None, None]        ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBERS TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE     
        self.details['E'] = ['', None, None]        ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ',WORD BETWEEN
        ## ' ', TWO OTHER NUMBERS TO NEW VALUE OR YOU CAN ALSO DELETE TH LINE     
        self.details['F'] = ['', 0, 1e16]           ## <-----   
        ## YOU CAN MODIFY THE LINE BELLOW.MODIFY WORDS BETWEEN """   """  ONLY!!!!
        self.description = """
Esempio n. 4
0
 def __init__(self):      ##DO NOT CHANGE THIS LINE!!!
     """
     Initialization
     """
     Model1DPlugin.__init__(self, name=self.name) ##DO NOT CHANGE THIS LINE!!!
     
     ## HERE WE DEFINE THE PARAM NAME AND ITS INITIAL VALUE 
     ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER                                                      
     self.params['A'] = 0.1       ## <-----                
     self.params['B'] = 10.0      ## <-----                 
     self.params['C'] = 0.0       ## <-----                
     self.params['D'] = 0.0       ## <-----                    
     self.params['E'] = 0.0       ## <-----                  
     self.params['F'] = 0.0       ## <-----   
     # Set the name same as the file name
     self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
     ## YOU CAN MODIFY THE LINE BELLOW.MODIFY WORDS BETWEEN """   """  ONLY!!!!
     self.description = """
         a + b * x + c * math.pow(x,2) + d * math.pow(x,3) \n
          + e * math.pow(x,4) + f * math.pow(x,5)  
     """                        ## <-----   
     ## DEFINE DEFAULT DETAILS
     self.set_details()      ##DO NOT DELETE OR CHANGE THIS LINE!!!
Esempio n. 5
0
    def __init__(self):  ##DO NOT CHANGE THIS LINE!!!
        """
        Initialization
        """
        Model1DPlugin.__init__(self,
                               name=self.name)  ##DO NOT CHANGE THIS LINE!!!

        ## HERE WE DEFINE THE PARAM NAME AND ITS INITIAL VALUE
        ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER
        self.params['A'] = 0.1  ## <-----
        self.params['B'] = 10.0  ## <-----
        self.params['C'] = 0.0  ## <-----
        self.params['D'] = 0.0  ## <-----
        self.params['E'] = 0.0  ## <-----
        self.params['F'] = 0.0  ## <-----
        # Set the name same as the file name
        self.name = self.get_fname()  ##DO NOT CHANGE THIS LINE!!!
        ## YOU CAN MODIFY THE LINE BELLOW.MODIFY WORDS BETWEEN """   """  ONLY!!!!
        self.description = """
            a + b * x + c * math.pow(x,2) + d * math.pow(x,3) \n
             + e * math.pow(x,4) + f * math.pow(x,5)  
        """                        ## <-----
        ## DEFINE DEFAULT DETAILS
        self.set_details()  ##DO NOT DELETE OR CHANGE THIS LINE!!!
Esempio n. 6
0
    def __init__(self):
        Model1DPlugin.__init__(self, name=self.name)
        """
        :param p_model1: a form factor, P(Q)
        :param p_model2: another form factor, P(Q)
        """
        p_model1 = P1()
        p_model2 = P2()
        ## Setting  model name model description
        self.description = ""
        self.fill_description(p_model1, p_model2)
        # Set the name same as the file name
        self.name = self.get_fname()  ##DO NOT CHANGE THIS LINE!!!
        ## Define parameters
        self.params = {}

        ## Parameter details [units, min, max]
        self.details = {}
        ## Magnetic Panrameters
        self.magnetic_params = []

        # non-fittable parameters
        self.non_fittable = p_model1.non_fittable
        self.non_fittable += p_model2.non_fittable

        ##models
        self.p_model1 = p_model1
        self.p_model2 = p_model2

        ## dispersion
        self._set_dispersion()
        ## Define parameters
        self._set_params()
        ## New parameter:Scaling factor
        self.params['scale_factor'] = 0.5

        ## Parameter details [units, min, max]
        self._set_details()
        self.details['scale_factor'] = ['', None, None]

        #list of parameter that can be fitted
        self._set_fixed_params()
        ## parameters with orientation
        for item in self.p_model1.orientation_params:
            new_item = "p1_" + item
            if not new_item in self.orientation_params:
                self.orientation_params.append(new_item)

        for item in self.p_model2.orientation_params:
            new_item = "p2_" + item
            if not new_item in self.orientation_params:
                self.orientation_params.append(new_item)
        ## magnetic params
        for item in self.p_model1.magnetic_params:
            new_item = "p1_" + item
            if not new_item in self.magnetic_params:
                self.magnetic_params.append(new_item)

        for item in self.p_model2.magnetic_params:
            new_item = "p2_" + item
            if not new_item in self.magnetic_params:
                self.magnetic_params.append(new_item)
        # set multiplicity 1: muti_func Not supported.
        multiplicity1 = 1
        multiplicity2 = 1
        ## functional multiplicity of the model
        self.multiplicity1 = multiplicity1
        self.multiplicity2 = multiplicity2
        self.multiplicity_info = []
Esempio n. 7
0
    def __init__(self):
        Model1DPlugin.__init__(self, name=self.name)
        """
        :param p_model1: a form factor, P(Q)
        :param p_model2: another form factor, P(Q)
        """
        p_model1 = P1()
        p_model2 = P2()
        ## Setting  model name model description
        self.description = ""
        self.fill_description(p_model1, p_model2)
        # Set the name same as the file name
        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
        ## Define parameters
        self.params = {}

        ## Parameter details [units, min, max]
        self.details = {}
        ## Magnetic Panrameters
        self.magnetic_params = []
        
        # non-fittable parameters
        self.non_fittable = p_model1.non_fittable  
        self.non_fittable += p_model2.non_fittable  
            
        ##models 
        self.p_model1= p_model1
        self.p_model2= p_model2
        
       
        ## dispersion
        self._set_dispersion()
        ## Define parameters
        self._set_params()
        ## New parameter:Scaling factor
        self.params['scale_factor'] = 0.5
        
        ## Parameter details [units, min, max]
        self._set_details()
        self.details['scale_factor'] = ['',     None, None]

        
        #list of parameter that can be fitted
        self._set_fixed_params()  
        ## parameters with orientation
        for item in self.p_model1.orientation_params:
            new_item = "p1_" + item
            if not new_item in self.orientation_params:
                self.orientation_params.append(new_item)
            
        for item in self.p_model2.orientation_params:
            new_item = "p2_" + item
            if not new_item in self.orientation_params:
                self.orientation_params.append(new_item)
        ## magnetic params
        for item in self.p_model1.magnetic_params:
            new_item = "p1_" + item
            if not new_item in self.magnetic_params:
                self.magnetic_params.append(new_item)
            
        for item in self.p_model2.magnetic_params:
            new_item = "p2_" + item
            if not new_item in self.magnetic_params:
                self.magnetic_params.append(new_item)
        # set multiplicity 1: muti_func Not supported.
        multiplicity1 = 1
        multiplicity2 = 1
        ## functional multiplicity of the model
        self.multiplicity1 = multiplicity1  
        self.multiplicity2 = multiplicity2    
        self.multiplicity_info = []