Closed keflavich closed 3 days ago
Hello @keflavich! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:
@keflavich To exclude negative peaks you should bound the flux
parameter on the input psf_model
, e.g, psf_model.flux.min = 0
.
I've considered automatically excluding negative flux results, but I've only seen that occur with IterativePSFPhotometry
where something has gone wrong (i.e., the source doesn't really exist). I wasn't sure whether removing them is the correct choice, since it gives the user an indication that something went wrong -- also because the user can bound the flux parameter themselves if they only want positive flux.
In https://github.com/astropy/photutils/pull/1778, I do automatically exclude fit (x, y) positions that out-of-bound during the IterativePSFPhtometry
iterations because it will crash without it. The (x, y) model parameters could also be bound in the input psf_model
to the image shape.
Thanks. That makes sense as a way to prevent the fit from ever going negative.
I am seeing this show up even with "basic" PSFPhotometry. I think it has to do with a structured background.
Solves #1799 by making negative peaks excludable.
It's difficult to impossible for a user to do this now, since the construction of the list of fits for IterativePSFPhotometry is done within
make_model_image
.