CosmoStat / CosmoStat/cs_util

Canonical survey area & effective number density helpers (dedupe sp_validation / shear_psf_leakage)

Open
#81 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
2
Avg merge
1h 3m
Merged PRs (30d)
7

Description

Effective number density and survey area are currently computed independently in (at least) two places:

  • `shear_psf_leakage/rho_tau_cov.py`: `CovTauTh.get_area` (healpix-based) and `get_effective_number_density` — used internally for the tau theory covariance (CosmoStat/sp_validation#295 / shear_psf_leakage#35).
  • `sp_validation`: `cosmo_val/catalog_characterization.py` (`calculate_n_eff_gal`, now per tomographic bin for the OneCovariance config, CosmoStat/sp_validation#298) and `survey.py:get_area`.

If the definitions drift (e.g. weighted vs raw n_eff, area estimators), the tau covariance and the OneCovariance C_ell covariance can silently disagree on shape noise and number density.

Proposal: one canonical implementation in cs_util that both packages call. Two composable options:

  1. cs_util owns the calculation; sp_validation and shear_psf_leakage both import it.
  2. Downstream code computes these once (in sp_validation, which owns the catalogue view) and passes them as explicit arguments to the covariance backends.

These are compatible — the calculation lives in cs_util, sp_validation calls it once and threads the values through. Open to opinions on the interface.

— Claude, on behalf of Cail

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing shear_psf_leakage/rho_tau_cov.py, especially CovTauTh.get_area and get_effective_number_density, with sp_validation/cosmo_val/catalog_characterization.py and survey.py:get_area. Read the related issues for the current per-bin and covariance requirements, then clarify the interface choice. Done means both downstream packages use consistent survey-area and effective-number-density values without duplicated definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.