Skip to content

PSF classes should have a "flux" attribute #254

Closed

Description

@hamogu

We currently offer one class as a PSF, the GaussianPSF. The fitted parameters are sigma, amplitude and (x,y) position. In the end, we don't care about the amplitude, only about the total flux (given by the integral and depending on amplitude and sigma).
I have a feeling that there must be an analytic expression for this, but I'm right now a little confused by the fact that the docs https://github.com/astropy/photutils/blob/master/photutils/psf.py#L210 and the code https://github.com/astropy/photutils/blob/master/photutils/psf.py#L261 use a different normalisation and neither of them is 2/sqrt(pi) as I expected it to be http://en.wikipedia.org/wiki/Error_function.

@larrybradley @adonath : You two did the most recent changes to code and docs...

Activity

  1. hamogu commented on Mar 4, 2015

    @hamogu
    MemberAuthor

    Note that the value of psf/psf.max() also depends on x_0, y_0. If the center of the PSF shifts, then the pixel boundaries will fall differently and thus the evaluated numbers in the PSF will change, which will cause psf.max() to be different. Is that intentional? It might be right, I just cannot wrap my head around it right now.

  2. adonath commented on Mar 4, 2015

    @adonath
    Member

    If I remember correctly, the parameter used to be the total integrated flux (that's how I implemented it). I just noticed that @larrybradley changed the definition of the parameter in #218 to the peak amplitude, maybe because I called it amplitude in the docs? (Which was a misnomer...sorry) I think it should be changed back. @larrybradley What do you think?

    Concerning the normalization factor: The factor 2/sqrt(2) is already included in the error function of scipy. The defintion of the 2D Gaussian using the error function needs a normalization factor of 1/4, because the error function is normalized to one by definition, but only gives the one sided integral. For the full integral you need an additional factor of 1/2 in the 1d case and a factor 1/2**2 = 1/4 in the 2d case. Does that make sense?

  3. larrybradley commented on Mar 5, 2015

    @larrybradley
    Member

    @adonath, yes I completely agree that it should be changed back (when I was doing #218 I mentioned that flux seemed better than amplitude, but nonetheless I continued your PR before the 0.1 release).

  4. added a commit that references this issue on Feb 5, 2016
    6502527
  5. added a commit that references this issue on Feb 19, 2016
    ff2aaaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    psfphotutils.psf subpackage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions