DM-45990: Create initial_pvi background lumpiness metric#1114
Open
enourbakhsh wants to merge 3 commits intomainfrom
Open
DM-45990: Create initial_pvi background lumpiness metric#1114enourbakhsh wants to merge 3 commits intomainfrom
enourbakhsh wants to merge 3 commits intomainfrom
Conversation
38bd2ad to
7c0f29f
Compare
204d9c0 to
941cc32
Compare
mrawls
approved these changes
May 7, 2025
Contributor
mrawls
left a comment
There was a problem hiding this comment.
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
enourbakhsh
commented
Jul 13, 2025
Comment on lines
-109
to
+122
| 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) | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
Needed to update this to support the background.getImage() call in the task.
enourbakhsh
commented
Jul 13, 2025
Comment on lines
-25
to
+40
| 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 |
Contributor
Author
There was a problem hiding this comment.
Simply organized the imports here.
9038e09 to
3490618
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.