Skip to content

gaussianfit.py needs improvement #1

Open
@pavoljuhas

Description

@pavoljuhas

The gaussianfit.py extension e13ed35 is currently not very usable, for example the gaussianfit function does not return any result. I suggest the following improvements:

  • replace header with CMI-related one as in diffpy/diffpy.srreal@302745e
  • convert gaussianfit function to a class that would accept the same arguments
  • the class should automatically pick meaningful starting values for x0, sig from the maximum and FWHM in the y-array
  • the class should have attributes A, sig, x0, recipe, results, x, y, dy, yg, where
    • A, sig, x0 are properties forwarded to recipe.NAME
    • x, y, dy are read-only input data, yg the Gauss curve evaluated for the current A, sig, x0
  • the class should have methods:
    • plot - replacement for plotResults()
    • refine() - call scipy leastsq for the current recipe state
  • remove the "gau.dat" file and the if name == "main" block.
  • write a few-line example in the class docstring that generates Gauss curve with some noise and executes the gaussfit class.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions