예제 #1
0
    def __init__(self, name):
        """Define the generator.

        Note that a ProfileGenerator needs a name passed in the initializer.
        This makes it so the generator can be referenced by name when it is
        part of a FitContribution.

        Here we create the Parameters for the calculation.

        A       --  The amplitude
        x0      --  The center
        sigma   --  The width

        """
        # This initializes various parts of the generator
        ProfileGenerator.__init__(self, name)

        # Here we create new Parameters using the '_newParameter' method of
        # ProfileGenerator. The signature is
        # _newParameter(name, value).
        # See the API for full details.
        self._newParameter('A', 1.0)
        self._newParameter('x0', 0.0)
        self._newParameter('sigma', 1.0)
        return
예제 #2
0
파일: gens.py 프로젝트: xpdAcq/pdffitx
    def __init__(self, name):
        """Define the generator.

        Note that a ProfileGenerator needs a name passed in the initializer.
        This makes it so the generator can be referenced by name when it is
        part of a FitContribution.

        Here we create the Parameters for the calculation.

        A       --  The amplitude
        x0      --  The center
        sigma   --  The width

        """
        # This initializes various parts of the generator
        ProfileGenerator.__init__(self, name)

        # Here we create new Parameters using the '_newParameter' method of
        # ProfileGenerator. The signature is
        # _newParameter(name, value).
        # See the API for full details.
        self._newParameter('A', 1.0)
        self._newParameter('x0', 0.0)
        self._newParameter('sigma', 1.0)
        return
예제 #3
0
 def __init__(self, name, *init_params):
     ProfileGenerator.__init__(self, name)
     self._newParameter("wl", init_params[0])
     self._newParameter("amp", init_params[1])
     self._newParameter("dec", init_params[2])
     self._newParameter("x0", init_params[3])
     return
예제 #4
0
 def __init__(self, name):
     ProfileGenerator.__init__(self, name)
     self._newParameter("wavelength", 10.0)
     self._newParameter("center", 2.0)
     self._newParameter("cos_coef", .1)
     self._newParameter("sin_coef", .1)
     self._newParameter("left_std", 5.)
     self._newParameter("right_std", 5.0)
     return
예제 #5
0
    def __init__(self, name):
        """Define our generator.

        In this example we will keep count of how many times the calculation
        gets performed. The 'count' attribute will be used to store the count.

        """
        ProfileGenerator.__init__(self, name)
        # Count the calls
        self.count = 0
        return
예제 #6
0
    def __init__(self, name):
        """Define our generator.

        In this example we will keep count of how many times the calculation
        gets performed. The 'count' attribute will be used to store the count.

        """
        ProfileGenerator.__init__(self, name)
        # Count the calls
        self.count = 0
        return
예제 #7
0
    def __init__(self, name = "pdf"):
        """Initialize the generator."""
        ProfileGenerator.__init__(self, name)

        self._phase = None
        self.stru = None
        self.meta = {}
        self._lastr = None
        self._calc = None

        self._pool = None

        return
예제 #8
0
    def __init__(self, name="pdf"):
        """Initialize the generator."""
        ProfileGenerator.__init__(self, name)

        self._phase = None
        self.stru = None
        self.meta = {}
        self._lastr = numpy.empty(0)
        self._calc = None

        self._pool = None

        return
예제 #9
0
    def __init__(self, name="pdf"):
        """Initialize the generator."""
        ProfileGenerator.__init__(self, name)

        self._pdfprofile = None
        # self.xscale = 1.0
        # self.yscale = 1.0
        self.meta = {'xscale':1.0,
                     'yscale':1.0}
        self._lastr = None

        self._setCalculator()
        return
예제 #10
0
    def __init__(self, name, model):
        """Initialize the generator.

        name    --  A name for the SASGenerator
        model   --  SASModel object this adapts.

        """
        ProfileGenerator.__init__(self, name)

        self._model = model

        # Wrap normal parameters
        for parname in model.params:
            par = SASParameter(parname, model)
            self.addParameter(par)

        # Wrap dispersion parameters
        for parname in model.dispersion:
            name = parname + "_width"
            parname += ".width"
            par = SASParameter(name, model, parname)
            self.addParameter(par)

        return
예제 #11
0
    def __init__(self, name, model):
        """Initialize the generator.

        name    --  A name for the SASGenerator
        model   --  SASModel object this adapts.

        """
        ProfileGenerator.__init__(self, name)

        self._model = model

        # Wrap normal parameters
        for parname in model.params:
            par = SASParameter(parname, model)
            self.addParameter(par)

        # Wrap dispersion parameters
        for parname in model.dispersion:
            name = parname + "_width"
            parname += ".width"
            par = SASParameter(name, model, parname)
            self.addParameter(par)

        return
예제 #12
0
 def __init__(self, name):
     ProfileGenerator.__init__(self, name)
     self._newParameter("wavelength", 20.0)
     self._newParameter("cos_coef", .1)
     self._newParameter("sin_coef", .1)
     return