next up previous
Next: Model Evaluation Function Up: Adding Models Previous: Adding Models

Defining Parameters

Of course, ximgfit needs to know about each parameter. This is done in the initialization routine __init__. When each parameter is defined, give it a short name and description, and then give defaults for the initial value, delta, minimum, maximum, and (optionally) units. E.g.,
        norm = Parameter(name="norm", desc="Normalization")
        norm.value = 1.0
        norm.min = 0.0
        norm.max = 10000.
        norm.delta = 0.1
        norm.units = "comp"
After all of the parameters have been entered, edit the final two lines of __init__ to list the parameters and their partial derivative functions (e.g., from the Gaussian model):
        self.params = [xc, yc, norm, sigmax, sigmay, theta]
        self.derivs = [self.PDeriv1, self.PDeriv2, self.PDeriv3,
                       self.PDeriv4, self.PDeriv5, self.PDeriv6]
PDeriv1 corresponds to the partial derivative with respect to xc, etc.



Andrew Ptak 2001-10-11