sys_mapping

User guide

  • Overview
    • Galaxy clustering and the role of systematics
    • Notation and conventions
    • The observed galaxy overdensity
    • Systematic template maps
    • Contamination model
    • Gaussian log-likelihood (Eq. 17)
    • Skew-normal log-likelihood (Eq. 18)
    • Template PCA rotation (Appendix A)
    • Noise debiasing (Eq. 21)
    • Two-point function correction (Eq. 15–16)
    • Model selection (Eq. 19)
    • Per-galaxy systematic weights
    • Summary of the workflow
    • Analysis execution pipeline
      • Motivation — method-first execution
      • Execution phases
      • The orchestration script
      • Skip-if-done mechanism
      • Partial results JSON
      • Incremental RST updates (sentinel protocol)
      • Figure color scheme
  • Installation
    • Requirements
    • From PyPI
    • Create the environment
    • Install in editable mode
    • Run the test suite
    • Build the documentation
  • Quickstart
    • Methods overview
    • Step 1 — Generate systematic template maps
    • Step 2 — Simulate the galaxy field and inject contamination
    • Step 3 — Compute the observed overdensity
    • Step 4 — PCA rotation of templates
    • Step 5 — Run all decontamination methods
      • Comparing parameter recovery
    • Step 6 — MCMC diagnostics: extract MAP estimates
    • Step 7 — Likelihood ratio test
    • Step 8 — Two-point function correction
    • Expected output summary
    • Results on 100 mock realisations

Methods & references

  • Methods Reference
    • Core contamination model
    • Gaussian and skew-normal likelihood
    • MCMC inference
    • Template PCA rotation
    • Noise debiasing
    • Two-point function correction
    • Likelihood ratio test (model selection)
    • Pseudo-\(C_\ell\) power spectrum
    • Block bootstrap covariance
    • Jack-knife covariance
    • ElasticNet regression
    • Iterative Systematics Decontamination (ISD)
    • Null tests and SNR ranking
    • Mock catalog generation
    • HEALPix map utilities
    • Two-point function measurement
    • Method comparison table
  • Bibliography
    • Ross et al. 2011
    • Ho et al. 2012
    • Elsner, Leistedt & Peiris 2016
    • Leistedt & Peiris 2014
    • Elsner, Leistedt & Peiris 2017
    • Weaverdyck & Huterer 2021
    • Rezaie et al. 2020
    • Alonso et al. 2019 — NaMaster
    • Berlfein, Mandelbaum & Schafer 2024
    • Rodríguez-Monroy et al. 2025
    • Cornish et al. 2026
    • Tanidis et al. 2026

Validation & tests

  • Testing
    • Running the tests
    • Test modules
    • Test design philosophy
    • Continuous integration
    • Systematic test matrix
    • Timing scaling tests
    • Adding new tests
    • Real-template integration tests
      • Template set
      • Mock configuration and injected parameters
      • Method results
      • Model selection and diagnostics
      • Running the real-template tests
  • Analysis of 100 mocks
    • Run configuration
    • Mock generation
    • Systematic templates
    • Parameter recovery — all six methods
    • Likelihood ratio test: additive vs. combined model
    • Multiplicative parameter recovery (MCMC-comb)
    • Scatter parameter recovery
    • Output files
  • Model test matrix
    • Configuration
      • Template set
      • Methods
    • Tier 1 — single contamination type
      • Additive-only contamination (\(b_i = 0\))
      • Multiplicative-only contamination (\(a_i = 0\))
    • Tier 2 — mixed additive + multiplicative
    • Compute time
      • Accuracy vs. compute time trade-off
    • Histograms
    • Reproducing the results
  • End-to-end validation
    • Simulation Setup
      • True amplitudes (seed 42)
    • Contamination Scenarios
    • Methods Under Test
    • Galaxy Maps
    • Overdensity Distributions
    • Scatter Plots: Recovered vs. True Field
    • Weight Maps
    • Recovery Metrics
      • No contamination (none)
      • Additive contamination (additive)
      • Multiplicative contamination (multiplicative)
      • Combined contamination (combined)
      • Cross-scenario summary
    • Amplitude Recovery
    • Null Tests
    • Template SNR Ranking
    • Interpretation and Recommendations
  • Progressive Template Contamination Study
    • Motivation
    • Experimental design
    • Template localisation — S/N per template
    • LRT model selection
    • Detection performance
    • Summary table
    • Reproduction
  • Real-template single-mock validation
    • Mock configuration
    • Method recovery
    • Results (5 mocks, NSIDE = 64)
    • Model selection and diagnostics
    • Running the validation
    • Outcome
  • Simulation tests: GLASS and Uchuu mocks with LSDR10 systematics
    • Mock catalogs
      • GLASS full-sky mock
      • Uchuu lightcone mock
      • Redshift distributions
    • Systematic template maps
    • Contamination injection
      • Contamination scenarios and levels
    • w(θ) recovery results
      • GLASS mock — all 9 configurations
      • Uchuu mock — all 9 configurations
      • GLASS vs Uchuu at medium contamination
    • Recovery metric summary
      • Heatmap of recovery bias
      • Bias vs contamination amplitude
    • Contamination parameter recovery
    • Discussion
    • How to reproduce
    • References

Application to real data: Legacy Survey DR10

  • Running the real-data pipeline
    • Input data
      • BGS VLIM samples
      • Systematic templates
    • Running the pipeline
      • Full run with real templates (recommended)
      • Regenerate figures without re-running MCMC
      • Key command-line options
    • Output files
  • Results: systematic weights
    • Run configuration
    • Sample overview
      • Goodness-of-fit comparison
    • Systematics are detected: Likelihood Ratio Test
    • Fractional systematic uncertainty on \(w(\theta)\)
    • Is LS10 BGS (\(r < 19.5\)) systematics-limited?
    • Cross-sample comparison (NSIDE 64)
    • Per-sample results — all 9 samples
      • log M* ≥ 9.0, z < 0.08 (N = 523 486)
      • log M* ≥ 9.5, z < 0.12 (N = 1 432 502)
      • log M* ≥ 10.0, z < 0.18 (N = 2 759 238)
      • log M* ≥ 10.25, z < 0.22 (N = 3 308 841)
      • log M* ≥ 10.5, z < 0.26 (N = 3 263 228)
      • log M* ≥ 10.75, z < 0.31 (N = 2 802 710)
      • log M* ≥ 11.0, z < 0.35 (N = 1 619 838)
      • log M* ≥ 11.25, z < 0.35 (N = 541 855)
      • log M* ≥ 11.5, z < 0.35 (N = 120 882)
    • MAP parameters — 11-template analysis (NSIDE 64)
      • Additive MAP parameters \(\hat{a}_i\) (MCMC-add, NSIDE 64)
      • Multiplicative MAP parameters \(\hat{b}_i\) (MCMC-comb, NSIDE 64)
    • Outcome
  • LS10 systematic-correction recommendations
    • Decision framework
    • Recommended weight and resolution per sample
    • σ̂_comb goodness-of-fit across resolutions
    • Systematic uncertainty budget
    • Per-sample angular correction profiles
      • M* ≥ 9.0 (z < 0.08, N = 523,486)
      • M* ≥ 9.5 (z < 0.12, N = 1,432,502)
      • M* ≥ 10.0 (z < 0.18, N = 2,759,238)
      • M* ≥ 10.25 (z < 0.22, N = 3,308,841)
      • M* ≥ 10.5 (z < 0.26, N = 3,263,228)
      • M* ≥ 10.75 (z < 0.31, N = 2,802,710)
      • M* ≥ 11.0 (z < 0.35, N = 1,619,838)
      • M* ≥ 11.25 (z < 0.35, N = 541,855)
      • M* ≥ 11.5 (z < 0.35, N = 120,882)
    • Caveats and limitations
  • BGS VLIM log M* ≥ 9.0, z < 0.08 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 9.5, z < 0.12 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 10.0, z < 0.18 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 10.25, z < 0.22 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 10.5, z < 0.26 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 10.75, z < 0.31 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 11.0, z < 0.35 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 11.25, z < 0.35 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict
  • BGS VLIM log M* ≥ 11.5, z < 0.35 — detailed systematic analysis
    • Sample statistics
    • Goodness-of-fit: \(\hat{\sigma}\) by method and resolution
    • Likelihood Ratio Test (additive vs combined model)
    • Template amplitude ranking — additive model (MCMC-add, NSIDE 64)
    • Template amplitude ranking — multiplicative model (MCMC-comb, NSIDE 64)
    • Per-galaxy weight statistics (NSIDE 64)
    • Systematic weight maps
    • Systematic weight distributions
    • Angular clustering w(θ) before and after correction
    • Cosmological analysis verdict

API reference

  • sys_mapping.contamination
    • n_free_params()
    • pack_params()
    • unpack_params()
    • apply_contamination()
    • invert_contamination()
    • compute_two_point_correction()
  • sys_mapping.likelihood
    • make_log_likelihood()
  • sys_mapping.maps
    • Synthetic template families
    • Real observational templates
      • systematic_power_spectrum()
      • generate_systematic_map()
      • generate_systematic_maps()
      • pixelize_catalog()
      • compute_overdensity()
      • assign_template_values()
      • load_real_template()
      • load_real_templates()
  • sys_mapping.inference
    • GPU / vectorised mode
    • make_log_prob()
    • run_mcmc()
    • get_mle_params()
    • get_param_variance_from_chain()
    • get_param_covariance_from_chain()
  • sys_mapping.correction
    • debias_params()
    • rotate_templates()
    • transform_params_from_rotated()
    • correct_two_point_function()
    • correct_power_spectrum_harmonic()
  • sys_mapping.model_selection
    • LikelihoodRatioResult
      • LikelihoodRatioResult.lambda_lr
      • LikelihoodRatioResult.n_dof
      • LikelihoodRatioResult.p_value
      • LikelihoodRatioResult.reject_null
      • LikelihoodRatioResult.null_model
      • LikelihoodRatioResult.alt_model
    • likelihood_ratio_test()
  • sys_mapping.bootstrap
    • block_bootstrap_variance()
    • jackknife_covariance()
  • sys_mapping.utils
    • compute_covariance_matrix()
    • compute_amplitude_bias()
    • measure_two_point_function()
    • measure_two_point_function_corrfunc()
    • measure_kk_correlation_treecorr()
    • measure_kk_correlation_corrfunc()
  • sys_mapping.power_spectrum
    • measure_pseudo_cl()
    • subtract_template_cl()
    • harmonic_bias()
    • mode_projection_bias()
  • sys_mapping.regression
    • elasticnet_contamination_fit()
    • iterative_systematics_decontamination()
    • method_comparison()
    • run_decontamination()
  • sys_mapping.diagnostics
    • null_test_cross_correlations()
    • snr_template_ranking()
    • footprint_mask_diagnostics()
  • sys_mapping.mocks
    • Contamination scenarios
    • Galaxy field model
    • MockCatalog
      • MockCatalog.scenario
      • MockCatalog.nside
      • MockCatalog.templates
      • MockCatalog.delta_true
      • MockCatalog.delta_obs
      • MockCatalog.mask
      • MockCatalog.a_true
      • MockCatalog.b_true
      • MockCatalog.n_mean
      • MockCatalog.sigma
      • MockCatalog.seed
      • MockCatalog.n_sys
      • MockCatalog.n_gal
      • MockCatalog.n_rand
      • MockCatalog.n_pix
      • MockCatalog.n_good_pix
    • generate_lognormal_field()
    • make_galactic_mask()
    • make_mock_catalog()
    • make_mock_suite()
  • sys_mapping.glass_mocks
    • Workflow
    • MockCatalogDict
      • MockCatalogDict.ra
      • MockCatalogDict.dec
      • MockCatalogDict.z
      • MockCatalogDict.ra_rand
      • MockCatalogDict.dec_rand
      • MockCatalogDict.n_total
      • MockCatalogDict.nside
      • MockCatalogDict.seed
    • measure_nz()
    • generate_glass_fullsky_mock()
  • sys_mapping.simulation
    • Contamination injection strategy
    • ContaminationConfig
      • ContaminationConfig.level
      • ContaminationConfig.scenario
      • ContaminationConfig.a_true
      • ContaminationConfig.b_true
      • ContaminationConfig.level
      • ContaminationConfig.scenario
      • ContaminationConfig.a_true
      • ContaminationConfig.b_true
      • ContaminationConfig.n_sys
      • ContaminationConfig.to_header_dict()
    • make_contamination_grid()
    • load_uchuu_mock()
    • load_systematic_maps()
    • apply_footprint_mask()
    • inject_systematics()
    • save_simulation_catalog()
    • load_simulation_catalog()
    • run_wtheta_recovery()

Development

  • Changelog
    • 0.9.5 (2026-05-29)
    • 0.2.4 (2026-05-11)
    • 0.2.3 (2026-05-06)
    • 0.2.2 (2026-05-06)
    • 0.2.1 (2026-05-06)
    • 0.2.0 (2026-05-05)
    • 0.1.0 (2026-04-23)
sys_mapping
  • Search


© Copyright .

Built with Sphinx using a theme provided by Read the Docs.