|
LSSTApplications
11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
|
Using the Background class; the code's in estimateBackground.py.
The basic strategy is
Start by importing needed packages
We'll do the simplest case first. Start by creating a BackgroundControl object that's used to configure the algorithm that's used to estimate the background levels.
We can ask for the resulting heavily-binned image (but only after casting the base class Background to one that includes such an image, a BackgroundMI)
or subtract this background estimate from the input image, interpolating our estimated values using a NATURAL_SPLINE
We actually have a lot more control over the whole process than that. We'll start by building a StatisticsControl object, and telling it our desires:
We then build the BackgroundControl object, passing it sctrl and also my desired statistic.
Making the Background is the same as before
We can get the statistics image, and its variance:
Finally, we can interpolate in a number of ways, e.g.
If we wish to use an approximation to the background (instead of interpolating the values) we proceed slightly differently. First we need an object to specify our interpolation strategy:
We can get an Image or MaskedImage from approx with
1.8.5