-
Notifications
You must be signed in to change notification settings - Fork 20
DM-45990: Create initial_pvi background lumpiness metric #1114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
38bd2ad
to
7c0f29f
Compare
204d9c0
to
941cc32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase into a single commit. I suggest you add a line to the update_background_stats
docstring that makes it clear this method adds two entries to summary
: skyBg
and skyBgNormRange
, and (bonus level) a one-sentence description of what each one is. Otherwise it feels like stealth undocumented things that would warrant a "Returns" docstring if it weren't just updating summary
in place.
b97240b
to
f692e2f
Compare
e27d623
to
f008192
Compare
35570a7
to
9038e09
Compare
bctrl = afwMath.BackgroundControl(afwMath.Interpolate.NATURAL_SPLINE) | ||
bctrl.setNxSample(int(exposure.getMaskedImage().getWidth()/bgGridSize) + 1) | ||
bctrl.setNySample(int(exposure.getMaskedImage().getHeight()/bgGridSize) + 1) | ||
nx = int(exposure.getMaskedImage().getWidth()/bgGridSize) + 1 | ||
ny = int(exposure.getMaskedImage().getHeight()/bgGridSize) + 1 | ||
bctrl = afwMath.BackgroundControl(nx, ny) | ||
interpStyle = afwMath.Interpolate.AKIMA_SPLINE | ||
undersampleStyle = afwMath.REDUCE_INTERP_ORDER | ||
approxStyle = afwMath.ApproximateControl.UNKNOWN | ||
approxOrderX = 0 | ||
approxOrderY = 0 | ||
approxWeighting = False | ||
backobj = afwMath.makeBackground(exposure.getMaskedImage().getImage(), bctrl) | ||
background = afwMath.BackgroundList() | ||
background.append(backobj) | ||
background.append( | ||
(backobj, interpStyle, undersampleStyle, approxStyle, approxOrderX, approxOrderY, approxWeighting) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed to update this to support the background.getImage()
call in the task.
import numpy as np | ||
from scipy.stats import median_abs_deviation as sigmaMad | ||
import astropy.units as units | ||
from astropy.time import Time | ||
from astropy.coordinates import AltAz, SkyCoord, EarthLocation | ||
from lsst.daf.base import DateTime | ||
|
||
import lsst.pipe.base as pipeBase | ||
import lsst.pex.config as pexConfig | ||
import lsst.afw.math as afwMath | ||
import astropy.units as units | ||
import lsst.afw.image as afwImage | ||
import lsst.afw.math as afwMath | ||
import lsst.geom as geom | ||
import lsst.ip.isr as ipIsr | ||
import lsst.pex.config as pexConfig | ||
import lsst.pipe.base as pipeBase | ||
import numpy as np | ||
from astropy.coordinates import AltAz, EarthLocation, SkyCoord | ||
from astropy.time import Time | ||
from lsst.daf.base import DateTime | ||
from lsst.meas.algorithms import ScienceSourceSelectorTask | ||
from lsst.utils.timer import timeMethod | ||
import lsst.ip.isr as ipIsr | ||
from scipy.stats import median_abs_deviation as sigmaMad | ||
from skimage.util import view_as_windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply organized the imports here.
9038e09
to
3490618
Compare
No description provided.