photutils icon indicating copy to clipboard operation
photutils copied to clipboard

Expansion of the NDData uncertainty handling in EPSFStar objects to allow for various uncertainty functions to be passed and used within EPSFBuilder

Open Onoddil opened this issue 5 years ago • 0 comments

I have a super barebones PR (#739) in which I looked at adding something like this previously, but with the updates to astropy's uncertainty handling subsequently (and me having less time to work on photutils in the future) I may as well raise this issue (although close mine if this is duplicating a previous issue, of course) more generally:

Currently when creating an ePSF via EPSFBuilder, the only uncertainty currently accepted is a regular "weight" array, checking for data.uncertainty_uncertainty_type == 'weights', although I am unsure of how one would create such an nddata uncertainty array (is it via UnknownUncertainty only or have I missed a weight uncertainty nddata object?) myself. It would be good if more uncertainty types could be handled, to allow for, say, the removal/downweighting of bad individual pixels in the fitting of sources to the PSF during the iteration process of EPSFBuilder from more uncertainty arrays in datasets.

However, this could easily be extended to include multiple types (see this comment for an example of how to handle conversion of uncertainty types in astropy >3.1), all of which could be converted to "weight" -- standard deviation would go as 1/std, variance converts as 1/sqrt(var), etc. -- and would, again, fix the issue in #734 where if uncertainties are passed EPSFBuilder can potentially handle those as weights and assign higher importance to worse data.

Onoddil avatar Nov 21 '19 16:11 Onoddil