Skip to content

Fix: use sigma instead of FWHM in compute_gaussian_srf#10

Merged
danschef merged 1 commit into
GFZ:mainfrom
leleist:fix-srf-fwhm-sigma-scale
Jul 22, 2026
Merged

Fix: use sigma instead of FWHM in compute_gaussian_srf#10
danschef merged 1 commit into
GFZ:mainfrom
leleist:fix-srf-fwhm-sigma-scale

Conversation

@leleist

@leleist leleist commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #9

scipy.stats.norm(loc, scale) expects scale = 1-sigma, not FWHM. This PR
converts FWHM to sigma before constructing the Gaussian:

sigma = fwhm / 2.3548200450309493  # FWHM = 2*sqrt(2*ln2)*sigma
dist = stats.norm(cwl, sigma)

See linked issue for derivation and reproduction.

scipy.stats.norm(loc, scale) expects scale = 1-sigma, not FWHM.
FWHM = 2*sqrt(2*ln2)*sigma, so passing fwhm directly made the
resulting SRF too wide.

Fixes GFZ#9
@danschef
danschef merged commit 2e3f39b into GFZ:main Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gaussian SRF uses FWHM as scipy.stats.norm scale (sigma)

2 participants