WIP: Data Noise Handling Future PSF Photometry API #755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is set up for the discussion of the forward-looking additions to PSF photometry and should not be merged until after the discussion is finished. In this case the issue is the 'data noise' (previously the 'noise_model'; the name of the block has been changed to avoid potential confusion with 'psf_model') aspect of the block diagram. This API documentation complements that in #721 where the documentation for those blocks implemented, with solid APIs unlikely to change in future releases. Please see #766 for an overview of the fitting process and a revised block diagram.
The structure of the blocks input and output parameters is described in detail in the documentation, but the main issues are summarised below:
weight
keyword infitter
data
(array-like) and returnsuncertainty
(array-like)aperture
In particular discussion on
noise_calc
should be a simplecallable
function or a more internal routine of some kindNone
allows for the simple effective unit-weighting of all data values and some secondary keyword, as yet unimplemented, to indicate that uncertainty values have been passed in with the data values and to ignore the computation of uncertainty values) is acceptable, and what such keywords should beweight
keyword offitter
functions (i.e., isweight = 1/uncertainty
, areuncertainty
values standard deviations or variance, etc)aperture
fitting. Current implementation requires the update ofaperture_photometry
to accept theuncertainty
argument (instead of its currenterror
keyword) to correctly handleNDData
arrays via@support_nddata
. Nominally a relatively minor and cosmetic keyword update, is it acceptable to force an API change on another part ofphotutils
or must uncertainties be handled in a different way in the PSF fitting routines to avoid this conflict?is appreciated to finalise the API call.
Please provide any feedback on the API for this PSF photometry fitting routine block you may have, such that the implementation meets all of the requirements of all users and is as clear as possible going forward. A simple example for this block, maintaining "do nothing" backwards-compatibility can be found in
IterativelySubtractedPSFPhotometry
. It should be noted that the code provided above does not include examples of keyword overloading for uncertainty passing, simply accepting thecallable
function to compute uncertainties based on data values. The changes made to supportNDData
inaperture_photometry
can be seen here. Please also provide simpler formatting or grammatical changes to improve the readability and professional look of the document. The function's primary goal is to allow for the inclusion of realistic uncertainty weights in the fitting routine within the PSF fitting process, allowing for the in-situ calculation of such uncertainties or the passing of pre-determined uncertainties.