API for the jaxqualin.fit
module
QNMFitVaryingStartingTime
A class for fitting the postmerger waveform with a varying starting time.
Attributes:
Name | Type | Description |
---|---|---|
t0_arr |
ndarray
|
array of starting times for fitting. |
h |
waveform
|
waveform object to be fitted. |
var_M_a |
bool
|
fit for the mass and spin of the black hole. |
Warning |
bool
|
Not tested yet. |
Schwarzschild |
bool
|
whether to fit for Schwarzschild black hole, i.e. real waveform. |
N_free |
int
|
number of frequency-free QNMs to include in the model. These
modes are completely free, i.e. their mode numbers are not fixed
like those in |
qnm_fixed_list |
List[mode]
|
list of fixed-frequency QNMs included in the model. |
qnm_free_list |
List[mode_free]
|
list of free-frequency QNMs of fixed mode numbers to
include in the model, only used for fitting |
N_free |
int
|
number of free QNMs. |
run_string_prefix |
str
|
prefix of the run name for dumping the |
nonconvergence_cut |
bool
|
whether to cut the nonconverged fits. |
nonconvergence_indx |
List[int]
|
indices of the nonconverged fits. |
initial_num |
int
|
number of initial guesses to use for the first starting time for frequency-free fits. |
include_mirror |
bool
|
whether to include the mirror modes, for fitting waveforms with both waveform polarizations. |
mirror_ratio_list |
List[float]
|
list of ratios between prograde and mirror mode amplitudes. |
iota |
float
|
inclination angle of the source. |
psi |
float
|
polarization angle of the source. |
save_results |
bool
|
whether to save the results. |
params0 |
ndarray
|
initial guess for the fit parameters, at least for the
earliest |
max_nfev |
int
|
maximum number of function evaluations for the fit. |
sequential_guess |
bool
|
whether to use the previous fit as the initial guess for the next fit. |
load_pickle |
bool
|
whether to load the |
fit_save_prefix |
str
|
prefix of the path to save the |
A_bound |
float
|
maximum value of the amplitude. |
jcf |
CurveFit
|
|
fit_kwargs |
Dict[str, Any]
|
keyword arguments for the |
initial_dict |
Dict[str, Any]
|
key word arguments for |
A_guess_relative |
bool
|
whether to multiply the initial guess of the amplitude by the peak strain of the waveform. |
set_seed |
int
|
random seed for generating the initial guesses. |
weighted |
bool
|
whether to perform a weighted fit. |
double_skip |
bool
|
whether to skip the next |
skip_i_init |
int
|
number of |
result_full |
QNMFitVaryingStartingTimeResult
|
|
Methods:
Name | Description |
---|---|
get_mirror_ratio_list |
get |
initial_guesses |
generate initial guesses for the first |
make_nan_result |
generate a |
with `nan` values. do_fits |
perform the fits. |
__init__(h, t0_arr, N_free=0, qnm_fixed_list=[], qnm_free_list=[], var_M_a=False, Schwarzschild=False, run_string_prefix='Default', params0=None, max_nfev=200000, sequential_guess=True, load_pickle=True, fit_save_prefix=FIT_SAVE_PATH, nonconvergence_cut=False, A_bound=np.inf, jcf=None, fit_kwargs={}, initial_num=1, random_initial=False, initial_dict={}, A_guess_relative=True, set_seed=1234, weighted=False, double_skip=True, include_mirror=False, iota=None, psi=None, mirror_ignore_phase=True, skip_i_init=1, save_results=True)
Initialize the QNMFitVaryingStartingTime
object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
h |
waveform
|
waveform object to be fitted. |
required |
t0_arr |
ndarray
|
array of starting times for fitting. |
required |
N_free |
int
|
number of frequency-free QNMs to include in the model.
These modes are completely free, i.e. their mode numbers are not
fixed like those in |
0
|
qnm_fixed_list |
List[mode]
|
list of fixed-frequency QNMs included in the model. |
[]
|
qnm_free_list |
List[mode_free]
|
list of free-frequency QNMs of fixed mode numbers
to include in the model, only used for fitting |
[]
|
var_M_a |
bool
|
fit for the mass and spin of the black hole. Warning: Not tested yet. |
False
|
Schwarzschild |
bool
|
whether to fit for Schwarzschild black hole, i.e. real waveform. |
False
|
run_string_prefix |
str
|
prefix of the run name for dumping the
|
'Default'
|
params0 |
Optional[ndarray]
|
initial guess for the fit parameters, at least for the
earliest |
None
|
max_nfev |
int
|
maximum number of function evaluations for the fit. |
200000
|
sequential_guess |
bool
|
whether to use the previous fit as the initial guess for the next fit. |
True
|
load_pickle |
bool
|
whether to load the |
True
|
fit_save_prefix |
str
|
prefix of the path to save the |
FIT_SAVE_PATH
|
nonconvergence_cut |
bool
|
whether to cut the nonconverged fits. |
False
|
A_bound |
float
|
maximum value of the amplitude. |
inf
|
jcf |
Optional[CurveFit]
|
|
None
|
fit_kwargs |
Dict
|
keyword arguments for the |
{}
|
initial_num |
int
|
number of initial guesses to use for the first starting time for frequency-free fits. |
1
|
random_initial |
bool
|
whether to generate random initial guesses for the first starting time for frequency-free fits. |
False
|
initial_dict |
Dict
|
key word arguments for |
{}
|
A_guess_relative |
bool
|
whether to multiply the initial guess of the amplitude by the peak strain of the waveform. |
True
|
set_seed |
int
|
random seed for generating the initial guesses. |
1234
|
weighted |
bool
|
whether to perform a weighted fit. |
False
|
double_skip |
bool
|
whether to skip the next |
True
|
include_mirror |
bool
|
whether to include the mirror modes, for fitting waveforms with both waveform polarizations. |
False
|
iota |
Optional[float]
|
inclination angle of the source. |
None
|
psi |
Optional[float]
|
polarization angle of the source. |
None
|
mirror_ignore_phase |
bool
|
whether to ignore the phase difference between the prograde and mirror modes. |
True
|
skip_i_init |
int
|
number of |
1
|
save_results |
bool
|
whether to save the results. |
True
|
do_fits(jcf=None, return_jcf=False)
Perform the fits.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jcf |
Optional[CurveFit]
|
|
None
|
return_jcf |
bool
|
whether to return the |
False
|
get_mirror_ratio_list()
Get the ratios between the prograde and mirror modes from iota
and psi
.
Returns:
Type | Description |
---|---|
List[float]
|
list of ratios between prograde and mirror mode amplitudes. |
initial_guesses(jcf=None)
Generate initial guesses for the first t0
fit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
jcf |
Optional[CurveFit]
|
|
None
|
Returns:
Name | Type | Description |
---|---|---|
best_guess_index |
int
|
index of the best initial guess. |
qnm_fit_list |
List[QNMFit]
|
list of |
guess_list |
List[ndarray]
|
list of initial guess parameters used. |
make_nan_result()
Generate a QNMFitVaryingStartingTimeResult
object with nan
values.