CosmoStat / CosmoStat/shapepipe

ngmix PSF fitter: drop the galaxy prior, adopt a metadetect-style dedicated PSF fit

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

Nobody has claimed this yet.

Dominant language
Python
Stars
18
Forks
14
Avg merge
8h 40m
Merged PRs (30d)
10

Description

Longer-term follow-up to #749. The ngmix module fits the PSF with model="gauss" but using the galaxy shape prior, so the PSF fit is partly prior-driven (the #749 concern). The acute problem is mitigated by giving the PSF fit a proper weight map, and the prior — in Axel's words — "is not ideal but not completely wrong," so this is not a merge blocker. The clean fix is a dedicated PSF fitter that doesn't borrow the galaxy prior at all.

Axel's suggestion (#749 comment):

The prior is not ideal to fit the PSF but it is not completely wrong either. I would put that as a lower priority given that it still works and simplify things. Otherwise you can define a better PSF fitter like they do in metadetect here.

What metadetect does there (get_gauss_psf_runner): a gauss Fitter with no prior, paired with a SimplePSFGuesser(guess_from_moms=True) that initializes from the PSF's own adaptive moments — distinct from the galaxy fitter (get_gauss_obj_runner), which is the one that carries the prior. The PSF and galaxy fits are deliberately separate, and the PSF fit never sees the galaxy prior.

Improvement: give the ngmix module its own PSF fitter on the same pattern — model="gauss", no galaxy prior, a moments-based guesser — replacing the current shared-prior setup.

Priority: low (post-ngmix-v2.0; not blocking the merge).

— 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

Inspect the ngmix module's current shared fitter setup, then compare it with metadetect's get_gauss_psf_runner in fitting.py. Done means the PSF uses its own gauss fitter with no galaxy prior and a moments-based guesser, while the galaxy fitter remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.