Skip to content
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

DM-40781: Add check for nans when computing grid psf quantities in property maps #834

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions python/lsst/pipe/tasks/healSparseMappingProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,18 @@ def compute_approx_psf_size_and_shape(ccd_row, ra, dec, nx=20, ny=20, orderx=2,
("psf_e2", "f8"),
("psf_area", "f8")])

cheb_size = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_size, ctrl)
# Protect against nans which can come in at the edges and masked regions.
good = np.isfinite(psf_size)
x = x[good]
y = y[good]

cheb_size = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_size[good], ctrl)
psf_array["psf_size"] = cheb_size.evaluate(pixel_x, pixel_y)
cheb_e1 = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_e1, ctrl)
cheb_e1 = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_e1[good], ctrl)
psf_array["psf_e1"] = cheb_e1.evaluate(pixel_x, pixel_y)
cheb_e2 = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_e2, ctrl)
cheb_e2 = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_e2[good], ctrl)
psf_array["psf_e2"] = cheb_e2.evaluate(pixel_x, pixel_y)
cheb_area = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_area, ctrl)
cheb_area = ChebyshevBoundedField.fit(lsst.geom.Box2I(bbox), x, y, psf_area[good], ctrl)
psf_array["psf_area"] = cheb_area.evaluate(pixel_x, pixel_y)

return psf_array
Expand Down