Repository navigation
Pixel scale from the WCS: ngmix prior and PSF star preselection - #927
Merged
Merged
Conversation
pixel_scale_from_wcs skips merge_headers' TILE_ID entry and iterates the object ndarrays split_exp writes, averaging both axes of every CCD WCS. With that fallback working, the tile template drops its PIXEL_SCALE = 0.186 pin; PIXEL_SCALE remains an optional override. The fit_priors record drops the resolved [LINT] and records the key as absent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 0.3-1.5 arcsec preselection bounds were FWHM_IMAGE cuts at a fixed 0.187 arcsec/px; they are now FWHM_WORLD cuts in degrees, which SExtractor computes from each CCD's WCS. The mode window stays in pixels (FWHM_IMAGE mode +- 0.2). Diagnostics report arcsec via FWHM_WORLD*3600 and the mode and cuts in pixels, as applied; the stars/deg^2 statistic, which needed a hardcoded scale, is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
star_selection_box states that the mode-centred box moves with the preselection (#928), and psfex_autoselect's excluded reason no longer contradicts psfex_candidate_vetting. CENTROID_SOURCE and METACAL_PSF are pinned absent under the [NGMIX_RUNNER] section tag, as is BKG_SUB, so a committed template that sets them fails the decision check. pixel_scale_from_wcs carries its fit_priors tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 2026
Contributor
Author
|
can we use the correct per-CCD pixel scale? |
The centroid prior is one pixel wide; that pixel is now sqrt|det J| of the object's per-epoch WCS Jacobians (already built for the fit), averaged over its epochs, instead of one mean over every CCD in the merged headers. The prior is still built from the object's position-seeded RNG before the fit, so only its width moves. pixel_scale_from_wcs, the PIXEL_SCALE option and the unused get_noise go: nothing else read a global scale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ELqMATt4MWS8TiVFrSLFA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Yes, and it now goes finer than per CCD. Each object's centroid-prior width is Claude Opus 5.5 on behalf of Cail |
martinkilbinger
approved these changes
Oct 2, 2026
cailmdaley
added a commit
that referenced
this pull request
Oct 2, 2026
The sextractor, match_catalogue, tile.smk, workflow README and params pin conflicts are develop's squashed #933 against the same content here, so they keep this branch's side: add_seg_vignet before match_catalogue, the full-table relabel, the NUMBER guard and SExtractor's VIGNET centring. ngmix: #927 replaces the PIXEL_SCALE option with each object's own pixel scale from its epochs' Jacobians; develop's side is taken, and the masked-pixels tests stop passing a pixel scale to Ngmix. #927's centroid prior test sets the defect-fill attributes and epoch_cuts that process reads on this branch. The regenerated params pins are unchanged; the noisefill pin is develop's params_pin.json byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017JQtu8oaZQEAqzbxZbPpWs
cailmdaley
added a commit
that referenced
this pull request
Oct 2, 2026
Follow #933: the tile VIGNET's -1e30 markers come from SExtractor alone; the catalogue converter and its neighbour-marking decision are gone, and the off-tile split tests cut SExtractor-style stamps from a segmentation map directly. Follow #927: no PIXEL_SCALE option; the centroid prior uses each object's own pixel scale. Tests that build Ngmix or drive process() carry the epoch-cut settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JkM3cmXPuuSrNAf7vJde9e
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.
Closes #134.
The pixel scale now comes from the image astrometry everywhere in the committed pipeline. No 0.186 or 0.187 is left in
workflow/config/cfis/or in the code paths it runs, and ngmix has noPIXEL_SCALEoption.sqrt|det J|of the per-epoch WCS Jacobians already built for the fit, averaged over the object's epochs. The prior is still built from the object's position-seeded RNG before the fit, so only its width changes.pixel_scale_from_wcsand its scan of the merged headers are removed. That scan raisedAttributeErroron real headers, and thePIXEL_SCALE = 0.186pin had been hiding it.FWHM_IMAGE > 0.3 / 0.187. They are nowFWHM_WORLDbounds in degrees, which SExtractor computes from the local WCS at each object. The ±0.2 px mode window is unchanged, since it is already in pixels. Diagnostics report arcsec viaFWHM_WORLD*3600, and thestars/deg^2stat, which was built from 0.187, is removed.fit_priorsdescribes the per-object width and pinsNGMIX_RUNNER.PIXEL_SCALE = absent.star_selection_boxpins the angular bounds.CENTROID_SOURCE,METACAL_PSFandBKG_SUBare also pinned absent, so a template that sets one fails the decision check (seen to fail).On real data (exposure 2114045p, 40 CCDs):
sqrt|det J|runs from 0.1827″ to 0.1871″ (−1.5% to +0.8%, rms 0.5%). Within one CCD it varies by up to 1.3%, as much as between CCDs, so per position is the right granularity.Tests.
test_process_centroid_prior_is_each_objects_own_pixel_scaleruns theprocessloop on objects with rotated and flipped epochs. It checks each prior width, and that the prior draws from the object's untouched position-seeded RNG.test_stamp_pixel_scale_reads_a_rotated_flipped_wcschecks the scale from a rotated, flipped TAN WCS.test_star_selection_preselects_on_angular_fwhmruns the committed.setoolson synthetic stars and galaxies with per-object scales between 0.185 and 0.188.tests/unitandtests/modulein the dev container: 804 passed, 1 skipped.astra validatepasses. A cross-family review (GPT) found no correctness defects in the change.Claude Opus 5.5 on behalf of Cail
🤖 Generated with Claude Code