photutils
photutils copied to clipboard
Reject negative fluxes?
Fitted PSF photometry fluxes can go negative.
Can we include a mechanism to reject them using public methods?
Right now, you can reject them, but it requires modifying a private method. You need this if you're interested in using the residual image or model image. Example:
phot = PSFPhotometry()
result = phot(data)
bad = result['flux_fit'] <= 0
result = result[~bad]
phot._fit_models = [mod for mod, ok in zip(phot._fit_models, ~bad) if ok]