mirror of
https://github.com/vale981/fibre_walk_project_code
synced 2025-03-04 09:21:38 -05:00
also discard uncertain peaks
This commit is contained in:
parent
17abcf5ce9
commit
03c125582d
2 changed files with 10 additions and 1 deletions
|
@ -1 +0,0 @@
|
|||
hiro@Phillips.106575:1718131872
|
1
scripts/experiments/.#007_generate_fake_analysis_data.py
Normal file
1
scripts/experiments/.#007_generate_fake_analysis_data.py
Normal file
|
@ -0,0 +1 @@
|
|||
hiro@Phillips.106575:1718131872
|
|
@ -183,12 +183,17 @@ def find_peaks(
|
|||
)
|
||||
|
||||
|
||||
def refine_peaks(peaks: RingdownPeakData, params: RingdownParams):
|
||||
def refine_peaks(
|
||||
peaks: RingdownPeakData, params: RingdownParams, uncertainty_threshold: float = 0.1
|
||||
):
|
||||
"""
|
||||
Refine the peak positions and frequencies by fitting Lorentzians.
|
||||
|
||||
:param peaks: The peak data.
|
||||
:param params: The ringdown parameters.
|
||||
:param uncertainty_threshold: The maximum allowed uncertainty in
|
||||
the mode frequencies in units of
|
||||
:any:`ringdown_params.fΩ_guess`.
|
||||
"""
|
||||
|
||||
peaks = dataclasses.replace(peaks)
|
||||
|
@ -224,6 +229,10 @@ def refine_peaks(peaks: RingdownPeakData, params: RingdownParams):
|
|||
)
|
||||
perr = np.sqrt(np.diag(pcov))
|
||||
|
||||
if perr[1] > uncertainty_threshold * params.fΩ_guess:
|
||||
deleted_peaks.append(i)
|
||||
continue
|
||||
|
||||
new_freqs.append(popt[1])
|
||||
Δfreqs.append(perr[1])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue