Coverage mask#699
Conversation
# Conflicts: # docs/source/pipeline_canfar.md # pyproject.toml
|
Merged latest Conflicts resolved:
Nothing structural was touched. Full review to follow. |
Review of coverage-mask workGood overall — the division of labor between this PR (builds coverage from exposure polygons) and sp_validation (consumes/applies/validates masks) is clean, and using Note on scope: after merging Blocking
Non-blocking but worth fixing
TestsNo tests for any of the new modules. Same gap as #702. A small test at least for Side note on
|
|
I fixed some of the problems:
And added comments for the hard-coded MegaCAM/UNIONS stuff. For the rest I think claude can do a better job than me to fix. |
- Extract _expnum_from_path, _parse_header_to_wcs, _megacam_field_corners as module-level helpers. process_single_header (static, for multiprocessing) and the instance methods now share one implementation. - Remove dead get_wcs_from_header and get_megacam_field (duplicated logic that had already been inlined into process_single_header). - Fix re.search(r'(\d+)\.txt') missing its subject string. The new helper also replaces the hard-coded p[end-6:end] exposure-number extraction in run(), so exposure numbers of any length work. - Declare verbose in params_default so the contract is local instead of relying on cs_util.args.parse_options to inject it. Addresses review feedback on CosmoStat#699.
- Replace hsp_map + 0 with hsp_map.copy() (healsparse supports .copy since at least 1.x; more explicit intent). - Declare verbose in params_default; currently populated only by cs_util.args.parse_options auto-injection. - Fix typo: "Install te cs_util" -> "Install the cs_util". Addresses review feedback on CosmoStat#699.
- coverage_plotter, header_downloader: declare verbose explicitly in params_default. - coverage_plotter: comment acknowledging that FootprintPlotter._regions is a private cs_util attribute; refactor to public accessor when cs_util exposes one. - header_downloader: expand the vos:cfis/pitcairn comment to flag it as UNIONS/CFIS-specific and document override. - build_and_plot_coverage_maps.sh: explain the BUILD_NSIDE=131072 choice (matches UNIONS bit-mask pixel scale, ~0.1"), and note the CoverageMapBuilder default of 2048 for lighter use. Addresses review feedback on CosmoStat#699.
|
Thanks @martinkilbinger — your three fixes close out the blocking items (the bogus Addressed on this branch:
Left as-is (with comment):
Non-blocking gap to track (not in this PR):
From my side the PR is ready for a final review / merge. LMK if you want me to touch anything else. |
Code ReviewOverviewThis PR adds a full coverage-mask pipeline for UNIONS/CFIS: five new utility classes ( Critical Issues1. Broken
coverage_pipeline = "shapepipe.coverage_run:run_pipeline"but 2. Missing
Significant Issues3. Debug print("MKDEBUG stat file ", stat_file, " does not exist")This is unconditional and will pollute stdout in production. The nearby 4. Both are added to [project.optional-dependencies]
coverage = ["healsparse", "skyproj"]
5. Accessing private attribute The comment acknowledges this is fragile — any rename in Minor Issues6. args = [(p, verbose) for p in todo]Shadows the method's 7. Global matplotlib state mutation (
8. Hardcoded fallback The RA wraparound fallback is silently UNIONS-specific. Add a comment explaining it, or make it a configurable parameter. 9. Edge artifact in n = np.where(n >= 0, n, 0)Invalid neighbours (boundary pixels, index = -1) are replaced with pixel 0, causing boundary pixels to over-weight their own value in the median. This could bias coverage depths at survey edges. Worth documenting the choice, or using masked arrays. 10. Misleading error message on missing plot dependency ( print("Install the cs_util package for plotting support.")The 11. No tests None of the five new classes have unit tests. Given these tools produce the survey footprint mask — which feeds downstream science — even minimal tests (mock file I/O for Small Nits
SummaryMust-fix before merge: the broken |
Summary
Added library files and classes to create healsparse coverage mask files.
The following steps can be performed:
Wait for #702 .
Closes #700 .
Reviewer Checklist
developbranch