photutils icon indicating copy to clipboard operation
photutils copied to clipboard

Reject negative fluxes?

Open keflavich opened this issue 7 months ago • 3 comments

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]

keflavich avatar Jun 29 '24 23:06 keflavich