Guess
decaying_exp_guess(x_data, y_data)
Robust initial guess for decaying exponential even if the full decay isn't captured.
Source code in sqil_core/fit/_guess.py
decaying_oscillations_bounds(x_data, y_data, guess)
Generate realistic bounds for decaying oscillation parameters.
Source code in sqil_core/fit/_guess.py
decaying_oscillations_guess(x_data, y_data, num_init=10)
Generate robust initial guesses for decaying oscillation parameters.
Source code in sqil_core/fit/_guess.py
estimate_peak(x_data, y_data)
Estimates the key properties of a peak or dip in 1D data.
This function analyzes a one-dimensional dataset to identify whether the dominant feature is a peak or dip and then estimates the following parameters: - The position of the peak/dip (x0) - The full width at half maximum (FWHM) - The peak/dip height - The baseline value (y0) - A flag indicating if it is a peak (True) or a dip (False)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x_data
|
ndarray
|
Array of x-values. |
required |
y_data
|
ndarray
|
Array of y-values corresponding to |
required |
Returns:
Name | Type | Description |
---|---|---|
x0 |
float
|
The x-position of the peak or dip. |
fwhm |
float
|
Estimated full width at half maximum. |
peak_height |
float
|
Height (or depth) of the peak or dip relative to the baseline. |
y0 |
float
|
Baseline level from which the peak/dip is measured. |
is_peak |
bool
|
True if the feature is a peak; False if it is a dip. |
Notes
- The function uses the median of
y_data
to determine whether the dominant feature is a peak or a dip. - FWHM is estimated using the positions where the signal crosses the half-max level.
- If fewer than two crossings are found, a fallback FWHM is estimated as 1/10th of the x-range.
Source code in sqil_core/fit/_guess.py
gaussian_bounds(x_data, y_data, guess)
Guess gaussian fit bounds.
Source code in sqil_core/fit/_guess.py
gaussian_guess(x_data, y_data)
Guess gaussian fit parameters.
Source code in sqil_core/fit/_guess.py
lorentzian_bounds(x_data, y_data, guess)
Guess lorentzian fit bounds.
Source code in sqil_core/fit/_guess.py
lorentzian_guess(x_data, y_data)
Guess lorentzian fit parameters.
Source code in sqil_core/fit/_guess.py
oscillations_bounds(x_data, y_data, guess)
Generate realistic bounds for oscillation parameters.
Source code in sqil_core/fit/_guess.py
oscillations_guess(x_data, y_data, num_init=10)
Generate robust initial guesses for oscillation parameters.