ISISComputingGroup/ibex_bluesky_core
Gaussian guess - guess negative Gaussian if peak 'looks' negative.
Open
#299 opened on Dec 16, 2025
good first issue
Repository metrics
- Stars
- (4 stars)
- PR merge metrics
- (PR metrics pending)
Description
If average([y value at minimum x], [y value at maximum x]) > (min(y) + max(y))/2, guess a negative Gaussian instead of a positive one.
Acceptance criteria
- For a Guassian with tails higher than midpoint of y-values, negative Gaussian is guessed
- For a Gaussian with tails lower than midpoint of y-values, positive Gaussian is guessed
Notes
- Relevant code is here: https://github.com/ISISComputingGroup/ibex_bluesky_core/blob/5de624a00d4236d36f0d2e606afea9c22892e842/src/ibex_bluesky_core/fitting.py#L159
- When guessing a negative Gaussian:
- We still want to guess the centre & width using centre-of-mass - but this will now be centre-of-mass of inverted data. The easiest way to do this will be to guess the centre & width using
cen, width = _guess_cen_and_width(x, -y). - Background guess is
max(y) - Amplitude guess is
min(y) - max(y)
- We still want to guess the centre & width using centre-of-mass - but this will now be centre-of-mass of inverted data. The easiest way to do this will be to guess the centre & width using