Skip to content

Eac/standardize x cent and pixel match scale - #23

Merged
eacharles merged 2 commits into
mainfrom
eac/standardize-x-cent-and-pixel-match-scale
Oct 6, 2026
Merged

eacharles merged 2 commits into
mainfrom
eac/standardize-x-cent-and-pixel-match-scale

Conversation

@eacharles

Copy link
Copy Markdown
Contributor

No description provided.

…for WcsMatch

x_cent / y_cent in ObjectStatsTable and ClusterStatsTable are now stored
in x_cell_coadd coordinates (origin at inner left edge of cell, matching
the x_cell_coadd column in the source catalogs) instead of x_cell
coordinates (origin at the outer edge including the buffer).  The shift
is cell_data.buf pixels (10 for WCS, 25 for shear).  RA, Dec, and x_pix
are computed before the conversion so they remain correct.  _reconstructCells
adds cell.buf back when loading saved centroids to restore the internal
x_cell convention.

CellData now properly propagates pixel_match_scale through all four
counts-map strategy methods (_emptyCountsMaps, _singleCatalogCountsMap,
_getFootprints, _associateSourcesToFootprints), so WcsMatch works
correctly for any pixel_match_scale value.  Three now-redundant overrides
are removed from ShearCellData; only _getFootprints is kept (buf=0 vs
buf=self.buf is the meaningful difference).  A new test
testWCSMatchPixelMatchScale verifies the end-to-end behaviour with pms=2.

Generated with AI

Co-Authored-By: SLAC AI
… join tables

Adds central_only=True (default) to extractStats, extractShearStats, and
save, and the same flag plus an optional cell_size to buildJoinedObjectTable
and buildJoinedClusterTable.

When enabled, objects and clusters whose centroid in x_cell_coadd coordinates
falls outside [0, cell_size in either axis are excluded.  This removes edge
objects that straddle a cell boundary and would otherwise be double-counted
when multiple cells are concatenated.

The filtering in extractStats/extractShearStats uses the internal x_cent
values (x_cell convention) compared against [buf, buf+cell_size) to avoid
redundant coordinate conversion.  The join-table functions apply the equivalent
check on the stored x_cent (x_cell_coadd convention, so threshold is 0 for
the lower bound and cell_size for the upper bound).

New unit tests cover: lower-bound filtering for objects and clusters, and
upper-bound filtering via cell_size.

Generated with AI

Co-Authored-By: SLAC AI
EOF
)
@eacharles
eacharles merged commit 8f6325e into main Oct 6, 2026
4 checks passed
@eacharles
eacharles deleted the eac/standardize-x-cent-and-pixel-match-scale branch October 14, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant