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-41303: Ensure that we skip empty maps that should not be appended. #853

Merged
merged 1 commit into from
Oct 24, 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
35 changes: 20 additions & 15 deletions python/lsst/pipe/tasks/healSparseMapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,29 @@ def run(self, sky_map, tract, band, coadd_dict, input_map_dict, visit_summary_di
patch_info = tract_info[patch]

input_map = input_map_dict[patch].get()

# Initialize the tract maps as soon as we have the first input
# map for getting nside information.
if not tract_maps_initialized:
# We use the first input map nside information to initialize
# the tract maps
nside_coverage = self._compute_nside_coverage_tract(tract_info)
nside = input_map.nside_sparse

do_compute_approx_psf = False
# Initialize the tract maps
for property_map in self.property_maps:
property_map.initialize_tract_maps(nside_coverage, nside)
if property_map.requires_psf:
do_compute_approx_psf = True

tract_maps_initialized = True

if input_map.valid_pixels.size == 0:
self.log.warning("No valid pixels for band %s, tract %d, patch %d; skipping.",
band, tract, patch)
continue

coadd_photo_calib = coadd_dict[patch].get(component="photoCalib")
coadd_inputs = coadd_dict[patch].get(component="coaddInputs")

Expand All @@ -568,21 +588,6 @@ def run(self, sky_map, tract, band, coadd_dict, input_map_dict, visit_summary_di
patch_poly_map = patch_poly.get_map_like(input_map)
input_map = hsp.and_intersection([input_map, patch_poly_map])

if not tract_maps_initialized:
# We use the first input map nside information to initialize
# the tract maps
nside_coverage = self._compute_nside_coverage_tract(tract_info)
nside = input_map.nside_sparse

do_compute_approx_psf = False
# Initialize the tract maps
for property_map in self.property_maps:
property_map.initialize_tract_maps(nside_coverage, nside)
if property_map.requires_psf:
do_compute_approx_psf = True

tract_maps_initialized = True

valid_pixels, vpix_ra, vpix_dec = input_map.valid_pixels_pos(return_pixels=True)

# Check if there are no valid pixels for the inner (unique) patch region
Expand Down