As a result of DM-5323, which implements RFC-155, background estimation in Python is now done using different routines in meas_algorithms:
- There is a new task
SubtractBackgroundTask
, with full documentation and a working example. - The existing function
getBackground
(which fit a background) is replaced bySubtractBackgroundTask.fitBackground
. Changes fromgetBackground
are:-
getBackground
could returnNone
if the fit failed; in that situationfitBackround
will raiseRuntimeError
instead of returningNone
- The argument
image
was renamed tomaskedImage
, for clarity - The config is not passed as an argument
- The debug display code uses different keys and is updated to use
afw.display
-
- The existing function
estimateBackground
(which subtract a background from an exposure) is replaced bySubtractBackgroundTask.run
. Changes fromestimateBackground
are:- You may pass in a background model (an lsst.afw.math.BackgroundList)
- It returns a struct containing the updated background model
- The config is not passed as an argument
- The debug display code displays the unsubtracted image and uses different keys and is updated to use
afw.display
- The task’s config
SubtractBackgroundConfig
replaces the old oldBackgroundConfig
, with one small change:- The field
algorithm
may no longer beNone
; you must use the string"NONE"
, instead
- The field