sp_validation.dashboard.correlations

Position–shear and scale-dependent leakage products for the dashboard.

One catalogue pass builds the TreeCorr catalogues once and runs the catalogue-paper correlation tests, all on the same k-means jackknife patches (computed once from the galaxy positions and saved):

stars

Galaxy γ_t, γ_× around PSF validation stars (valid HSM, one entry per star after merging per-exposure detections within --dedup-arcsec), for all stars and in star-magnitude tertiles. No random subtraction.

lambda

PSF-model ellipticity (λ₁) and star-minus-model residual (λ₃) of the PSF validation stars, tangential and cross, around galaxy positions (a random subsample of --lens-fraction), minus the same around footprint randoms.

tiles

Galaxy γ_t, γ_× around the centres of the tiles in the catalogue.

gaia

Galaxy γ_t, γ_× around Gaia DR3 stars (G < 20, RUWE < 1.4) inside the footprint, in G bins, minus the same around footprint randoms.

alpha

Scale-dependent leakage α(θ) = τ₀(θ)/ρ₀(θ) for all galaxies and in galaxy-magnitude tertiles; ρ₀ from the PSF model at the stars, τ₀ the galaxy–PSF-model correlation, both as in sp_validation.rho_tau.

Galaxy shapes are the calibrated e1, e2 with w_des; in the α magnitude bins they are rescaled to the bin’s own shear response. Each measurement writes <name>_<version>.npz with θ, the correlations, their jackknife errors and joint covariance, pair counts and a JSON provenance.

Usage (inside the container):

python -m sp_validation.dashboard.correlations \
    --catalogue-dir run-r425/catalogue --version SP_v2.0.0 \
    --out-dir catpaper/products --gaia gaia_dr3_G20_ruwe1p4_unions20k.fits
log(message)[source]
in_region(ra, dec, region)[source]
tile_name(tile_id)[source]

XXX.YYY from a TILE_ID written as a float string (51.34).

tile_centres(tile_ids)[source]

RA, Dec (deg) of the CFIS tile centres for unique TILE_ID values.

merge_detections(ra, dec, radius_arcsec)[source]

Group detections closer than radius_arcsec (friends of friends).

Returns the group label of each detection and the number of groups.

group_mean(labels, n_groups, values)[source]
unique_stars(stars, radius_arcsec)[source]

One position and magnitude per star from its per-exposure detections.

read_galaxies(path, region, chunk=5000000)[source]

Galaxy columns (float64) and the set of tile IDs, streamed in chunks.

read_stars(path, region)[source]
footprint_pixels(path)[source]

Occupied pixels (RING) and nside of an occupied-mask-nside*.npz.

in_footprint(ra, dec, nside, pixels)[source]
footprint_randoms(n, nside, pixels, region, rng, depth=6)[source]

Points uniform over the footprint pixels, to 1/2**depth of a pixel.

catalog(ra, dec, centres, **fields)[source]
save(out, name, version, results, provenance)[source]

Write one measurement: results maps a label to a measure dict.

quantile_edges(values, n)[source]

Edges of n equal-count bins; the last edge just above the maximum.

alpha_measurement(gal, stars, centres, n_bins, threads, r_selection)[source]

τ₀ per magnitude bin, ρ₀, and α = τ₀/ρ₀ with a joint jackknife covariance.

main(argv=None)[source]