next up previous
Next: Defining Parameters Up: XIMGFIT v0.999 Manual Previous: Additional Notes

Adding Models

Adding a new model should be fairly straightforward. Briefly, copy one of the current models in the models/ directory and use that as a template (you may have to change the permissions, e.g., chmod +rw mymod.py, but that should not be necessary with current versions). The new model file must also be in the models/ directory, and the name following ``class'' must be the same as the name of the file (minus the .py extension). The function Eval returns the model as a function of x,y and the functions PDeriv1...PDerivN return the partial derivative with respect to each parameter. Finally, add the name of the model to the ones already listed at the top of ximgfit.py. In order to edit ximgfit.py, you may have to execute co -l ximgfit.py first (this is a version control function). An optional step is to add a guess function for filling in model parameters. N.B., indentation is significant so follow the indentation of the current models as closely as possible. Please stick to the convension of naming centroid parameters ``xc'' and ``yc'' and any overall normalization parameter ``norm''. In doing so, the ``pos'' and ``counts'' commands will automatically return useful information. For models with more than a few parameters, it is more efficient (by something like 10-20%) to define a single function to return all derivative images for free and untied parameters. This is not as simple and hence is an optional step. To take advantage of this capability, follow the example in the Gaussian, Exponential and King models.



Subsections
next up previous
Next: Defining Parameters Up: XIMGFIT v0.999 Manual Previous: Additional Notes
Andrew Ptak 2001-10-11