measure_shear_correlation
Compute xi+ and xi- cosmic-shear correlation functions per tomographic bin pair from a shear catalogue, with c-term removal, m-bias correction, and optional B-mode null test.
Instructions
Measure xi+(theta) and xi-(theta) per tomographic bin pair from a shear catalogue (optional B-mode test).
Use to turn fetch_shear_catalog output into your own cosmic-shear
data vector. Weighted treecorr GG correlation with per-bin additive
c-term removal and multiplicative-bias correction xi / ((1+m_i)(1+m_j)).
Output CSV has the fetch_wl_datavector layout (bin1, bin2, angbin, x,
value, error) for xip and xim, so plot_shear_correlation and
compare_measured_with_published_xi read it directly. Errors are
shape noise (or jackknife with npatch) and do not include cosmic
variance; a few deg^2 subset gives a noisy, not unbiased-in-area,
estimate vs the 1006 deg^2 release. Sanity: theta*xi+ ~ 1e-4 x
(1-5) arcmin at 10 arcmin for z~0.5-1 pairs (Asgari+21 Fig. 1).
compute_bmodes=True adds *_mapsq_bmodes.csv (bin1, bin2, R_arcmin, mapsq,
mapsq_err, mxsq, mxsq_err, mapmx) and reports chi2(<M_x^2> = 0) per
pair and total (diagonal errors; shape noise only) - a B-mode null
test: PTE > ~0.05 means no detected B modes.
Heavy: with set_dispatch it runs catalogs.kernels.shear_correlation on the facility.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"catalog_fits": "<catalog_fits>",
"output_dir": "<output_dir>"
},
"name": "measure_shear_correlation"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nbins | No | Log-spaced theta bins (KiDS-1000 release: 9). | |
| npatch | No | Jackknife patches for errors (0 = shape-noise only; needs >~ 4 deg^2 for >= 10 patches). | |
| max_sep | No | Max separation [arcmin] (KiDS-1000 release: 300). | |
| min_sep | No | Min separation [arcmin] (KiDS-1000 release: 0.5). | |
| bin_slop | No | treecorr bin_slop (accuracy vs speed). | |
| remove_c | No | Subtract the weighted mean e1, e2 per bin (additive c-term). | |
| bin_pairs | No | Tomographic bin pairs, e.g. [[3,3],[4,5]] (default: all auto + cross pairs present). | |
| output_dir | Yes | Directory where output files are written. | |
| bmode_nbins | No | Fine log theta bins for the M_ap conversion. | |
| apply_m_bias | No | Divide by (1+m_i)(1+m_j) with the KiDS-1000 per-bin m (Asgari+21 Table 1). | |
| catalog_fits | Yes | Slim FITS from fetch_shear_catalog (shear catalogue input). | |
| compute_bmodes | No | Also compute aperture-mass E/B modes <M_ap^2>, <M_x^2> (treecorr calculateMapSq, Crittenden filter) and the chi2 of <M_x^2> against zero (B-mode null test). | |
| max_galaxies_per_bin | No | Random (seeded) subsample per tomographic bin to keep runtime sane. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| status | Yes | ||
| message | Yes | ||
| metadata | Yes |