Eclipsing Binaries and Asteroseismology

Logo

Precise fundamental stellar parameters in the golden age of time-domain astronomy

  • Home
  • Registration
  • La Palma
  • Programme
  • Photos
  • Iterative pre-whitening examples

    KIC 7760680

    In this notebook, we’ll run the full Iterative pre-whitening (IPW) analysis of the Slowly Puslating B-type stars KIC 7760680 and then do some asteroseismolog with the results.

    We’ll just load up the data, and start the IPW, using a running window of $2~{\rm d^{-1}}$, and we’ll extract the frequencies in order of highest SNR.

    For this notebook, you’ll need to download: kic7760680_lc.dat

    %matplotlib notebook
    
    import numpy as np
    import matplotlib.pyplot as plt
    
    from pythia.utils.resampling import run_mean_smooth
    from pythia.timeseries.periodograms import LS_periodogram
    from pythia.timeseries.iterative_prewhitening import run_ipw
    
    import matplotlib
    matplotlib.use('nbagg')
    
    plt.rcParams.update({
        "text.usetex": True,
            "font.family": "sans-serif",
        "font.sans-serif": ["Helvetica"]})
    plt.rcParams.update({
        "pgf.rcfonts": False,
        "pgf.texsystem": "pdflatex",
        "pgf.preamble": "\n".join([
             r"\usepackage{amsmath}",
             r"\usepackage[utf8x]{inputenc}",
             r"\usepackage[T1]{fontenc}",
             r"\usepackage{cmbright}",
        ]),
    })
    
    plt.rcParams['xtick.labelsize']=18
    plt.rcParams['ytick.labelsize']=18
    
    times, flux = np.loadtxt('kic7760680_lc.dat').T
    
    fig, ax = plt.subplots(1,1,figsize=(6.69,6.69),num=1)
    ax.plot(times, flux, 'k,')
    ax.set_xlabel(r'${\rm BJD-2454800}$',fontsize=18)
    ax.set_ylabel(r'${\rm Flux~[ppm]}$',fontsize=18)
    fig.tight_layout()
    
    
    <IPython.core.display.Javascript object>
    

    nu, amp = LS_periodogram(times,flux-np.mean(flux))
    
    fig,ax = plt.subplots(1,1,figsize=(6.6957,6.6957),num=2)
    ax.plot(nu,amp,'k-')
    ax.set_xlabel(r'$\nu\,\,{\rm [d^{-1}]}$',fontsize=14)
    ax.set_ylabel(r'${\rm Amplitude\,\,[ppm]}$',fontsize=14)
    ax.set_xlim(0.,24.4)
    fig.tight_layout()
    
    <IPython.core.display.Javascript object>
    

    As we can see from the light curve, there’s a lot of beating going on. Seeing this, we know to expect at least a few closely separated frequencies!

    yerr = 800* np.ones_like(times)
    residuals, model, offsets, \
    frequencies, amplitudes, \
    phases, stop_criteria, noise_level = run_ipw(times,flux-np.mean(flux), yerr, snr_stop_criteria=5.6, 
                                                 order_by_snr=True, use_snr_window=True, snr_window=2.,maxiter=50)
    
    
    print('The IPW analysis has found {:d} significant frequencies'.format(len(frequencies)))
    
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -1.672e+06]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -7260872.297874538 -> -1671924.995068082
    
    
    
    
    
    optimizing logp for variables: [offset, phase, amp, nu]
    
    100.00% [44/44 00:00<00:00 logp = -1.670e+06]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -1671924.995068082 -> -1669778.3902996588
    optimizing logp for variables: [phase]
    
    100.00% [18/18 00:00<00:00 logp = -1.019e+06]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -2629240.008119801 -> -1019200.5716668499
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [69/69 00:00<00:00 logp = -1.018e+06]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -1019200.5716668499 -> -1018167.7931593189
    optimizing logp for variables: [phase]
    
    100.00% [8/8 00:00<00:00 logp = -7.221e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -723758.8379458919 -> -722092.2408319736
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [32/32 00:00<00:00 logp = -7.206e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -722092.2408319736 -> -720551.8804129795
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [11/11 00:00<00:00 logp = -6.406e+05]
    message: Optimization terminated successfully.
    logp: -958031.940446697 -> -640644.2495088229
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [28/28 00:00<00:00 logp = -6.405e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -640644.2495088229 -> -640520.0918446616
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [8/8 00:00<00:00 logp = -5.906e+05]
    message: Optimization terminated successfully.
    logp: -605741.4034953549 -> -590615.5222008128
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [35/35 00:00<00:00 logp = -5.906e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -590615.5222008128 -> -590552.0340929527
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.681e+05]
    message: Optimization terminated successfully.
    logp: -571015.6509549952 -> -568117.00210612
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [58/58 00:00<00:00 logp = -5.681e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -568117.00210612 -> -568113.7957271716
    optimizing logp for variables: [phase]
    
    100.00% [97/97 00:00<00:00 logp = -5.626e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -581728.0508242999 -> -562631.1501428802
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [36/36 00:00<00:00 logp = -5.626e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -562631.1501428802 -> -562613.5319931646
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.529e+05]
    message: Optimization terminated successfully.
    logp: -591080.3080560573 -> -552869.2502105074
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [65/65 00:00<00:00 logp = -5.529e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -552869.2502105074 -> -552864.4883334044
    optimizing logp for variables: [phase]
    
    100.00% [11/11 00:00<00:00 logp = -5.453e+05]
    message: Optimization terminated successfully.
    logp: -574176.1049680853 -> -545344.6181616096
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [31/31 00:00<00:00 logp = -5.453e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -545344.6181616096 -> -545341.8825149833
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [68/68 00:00<00:00 logp = -5.397e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -551697.2039249521 -> -539678.2315184359
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [140/140 00:00<00:00 logp = -5.397e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -539678.2315184359 -> -539667.7769316561
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.352e+05]
    message: Optimization terminated successfully.
    logp: -536157.6588214439 -> -535178.816316071
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [13/13 00:00<00:00 logp = -5.352e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -535178.816316071 -> -535176.3976091627
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [62/62 00:00<00:00 logp = -5.320e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -531981.9290107794 -> -531950.8195021802
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [67/67 00:00<00:00 logp = -5.319e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -531950.8195021802 -> -531948.6369258434
    optimizing logp for variables: [phase]
    
    100.00% [40/40 00:00<00:00 logp = -5.304e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -535749.1678351221 -> -530443.8373405773
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [55/55 00:00<00:00 logp = -5.304e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -530443.8373405773 -> -530439.3096556187
    optimizing logp for variables: [phase]
    
    100.00% [63/63 00:00<00:00 logp = -5.273e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -539618.8533539425 -> -527343.1585583071
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [16/16 00:00<00:00 logp = -5.273e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -527343.1585583071 -> -527334.720826523
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [67/67 00:00<00:00 logp = -5.248e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -524864.6590234798 -> -524831.1614565888
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [53/53 00:00<00:00 logp = -5.248e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -524831.1614565888 -> -524824.910636929
    optimizing logp for variables: [phase]
    
    100.00% [37/37 00:00<00:00 logp = -5.230e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -529912.9764688503 -> -522989.3774587142
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [17/17 00:00<00:00 logp = -5.230e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -522989.3774587142 -> -522989.37704301847
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.213e+05]
    message: Optimization terminated successfully.
    logp: -525572.1178072355 -> -521328.5319760245
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [41/41 00:00<00:00 logp = -5.213e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -521328.5319760245 -> -521326.9703316791
    optimizing logp for variables: [phase]
    
    100.00% [69/69 00:00<00:00 logp = -5.201e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -523361.03233033686 -> -520147.68883544963
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [12/12 00:00<00:00 logp = -5.201e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -520147.68883544963 -> -520147.03418733197
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [11/11 00:00<00:00 logp = -5.197e+05]
    message: Optimization terminated successfully.
    logp: -521422.6360401556 -> -519656.7720431299
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [87/87 00:00<00:00 logp = -5.197e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -519656.7720431299 -> -519656.40367761656
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.192e+05]
    message: Optimization terminated successfully.
    logp: -520613.3820687486 -> -519175.70606816746
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [51/51 00:00<00:00 logp = -5.192e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -519175.70606816746 -> -519175.3883600899
    optimizing logp for variables: [phase]
    
    100.00% [108/108 00:00<00:00 logp = -5.192e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -519204.8353657633 -> -519168.0966461797
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [43/43 00:00<00:00 logp = -5.192e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -519168.0966461797 -> -519168.08674573875
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.179e+05]
    message: Optimization terminated successfully.
    logp: -518118.3801198888 -> -517851.65730466094
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [52/52 00:00<00:00 logp = -5.179e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -517851.65730466094 -> -517851.6339798285
    optimizing logp for variables: [phase]
    
    100.00% [77/77 00:00<00:00 logp = -5.176e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -518484.61235120887 -> -517631.8212742009
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [212/212 00:00<00:00 logp = -5.176e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -517631.8212742009 -> -517631.59872658044
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.172e+05]
    message: Optimization terminated successfully.
    logp: -517273.40419324674 -> -517192.11390627845
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [29/29 00:00<00:00 logp = -5.172e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -517192.11390627845 -> -517191.06140850164
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [81/81 00:00<00:00 logp = -5.166e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -517035.6355021807 -> -516586.81567514804
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [62/62 00:00<00:00 logp = -5.166e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -516586.81567514804 -> -516586.45960462035
    optimizing logp for variables: [phase]
    
    100.00% [51/51 00:00<00:00 logp = -5.164e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -516424.5252441514 -> -516361.393409179
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [16/16 00:00<00:00 logp = -5.164e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -516361.393409179 -> -516361.3930323308
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [91/91 00:00<00:00 logp = -5.153e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -515776.8866790071 -> -515343.7037343121
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [47/47 00:00<00:00 logp = -5.153e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -515343.7037343121 -> -515343.6560935002
    optimizing logp for variables: [phase]
    
    100.00% [93/93 00:00<00:00 logp = -5.148e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -517044.391617473 -> -514759.98684579146
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [58/58 00:00<00:00 logp = -5.148e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -514759.98684579146 -> -514759.54104600195
    optimizing logp for variables: [phase]
    
    100.00% [123/123 00:00<00:00 logp = -5.140e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -514434.37233195256 -> -514044.7458895987
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [97/97 00:00<00:00 logp = -5.140e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -514044.7458895987 -> -514044.32740441075
    optimizing logp for variables: [phase]
    
    100.00% [57/57 00:00<00:00 logp = -5.140e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -514043.44810267317 -> -514042.8704358363
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [64/64 00:00<00:00 logp = -5.140e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -514042.8704358363 -> -514042.83583737793
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.137e+05]
    message: Optimization terminated successfully.
    logp: -513749.8119974324 -> -513651.8968973149
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [84/84 00:00<00:00 logp = -5.137e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -513651.8968973149 -> -513651.2743893275
    optimizing logp for variables: [phase]
    
    100.00% [60/60 00:00<00:00 logp = -5.133e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -514047.72386729263 -> -513288.3009250919
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [52/52 00:00<00:00 logp = -5.133e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -513288.3009250919 -> -513287.7228334766
    optimizing logp for variables: [phase]
    
    100.00% [54/54 00:00<00:00 logp = -5.129e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -513988.9844317713 -> -512928.28090607986
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [12/12 00:00<00:00 logp = -5.129e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -512928.28090607986 -> -512928.2722676203
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [56/56 00:00<00:00 logp = -5.126e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -513785.8272544636 -> -512579.8532949145
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [63/63 00:00<00:00 logp = -5.126e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -512579.8532949145 -> -512579.8119443576
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.122e+05]
    message: Optimization terminated successfully.
    logp: -512428.3079829406 -> -512215.5121609659
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [69/69 00:00<00:00 logp = -5.122e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -512215.5121609659 -> -512215.4952955969
    optimizing logp for variables: [phase]
    
    100.00% [38/38 00:00<00:00 logp = -5.119e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -512207.16637691273 -> -511889.05531623296
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [92/92 00:00<00:00 logp = -5.119e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511889.05531623296 -> -511888.48904892907
    optimizing logp for variables: [phase]
    
    100.00% [41/41 00:00<00:00 logp = -5.116e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -512112.3546857303 -> -511568.66496960697
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [42/42 00:00<00:00 logp = -5.116e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511568.66496960697 -> -511567.73620783
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.114e+05]
    message: Optimization terminated successfully.
    logp: -511457.49260985904 -> -511445.25952037104
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [15/15 00:00<00:00 logp = -5.114e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511445.25952037104 -> -511445.2585780439
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [89/89 00:00<00:00 logp = -5.111e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -512250.380387578 -> -511141.9884818103
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [67/67 00:00<00:00 logp = -5.111e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511141.9884818103 -> -511141.7164506072
    optimizing logp for variables: [phase]
    
    100.00% [63/63 00:00<00:00 logp = -5.111e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511374.3262521018 -> -511063.90358172654
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [91/91 00:00<00:00 logp = -5.111e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511063.90358172654 -> -511063.8822380181
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.111e+05]
    message: Optimization terminated successfully.
    logp: -511064.1177674954 -> -511063.81056835456
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [133/133 00:00<00:00 logp = -5.111e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511063.81056835456 -> -511063.78682142793
    optimizing logp for variables: [phase]
    
    100.00% [73/73 00:00<00:00 logp = -5.108e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511882.6488191165 -> -510782.32669151307
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [32/32 00:00<00:00 logp = -5.108e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510782.32669151307 -> -510782.2792442193
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [61/61 00:00<00:00 logp = -5.108e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510782.83140882984 -> -510782.7372546079
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [55/55 00:00<00:00 logp = -5.108e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510782.7372546079 -> -510782.7117870476
    optimizing logp for variables: [phase]
    
    100.00% [42/42 00:00<00:00 logp = -5.107e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511122.05034001736 -> -510659.8563464732
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [54/54 00:00<00:00 logp = -5.107e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510659.8563464732 -> -510659.70424241974
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.106e+05]
    message: Optimization terminated successfully.
    logp: -510735.2233298169 -> -510634.8084649076
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [36/36 00:00<00:00 logp = -5.106e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510634.8084649076 -> -510634.805995267
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [92/92 00:00<00:00 logp = -5.104e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -511313.5410064599 -> -510392.06613647455
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [67/67 00:00<00:00 logp = -5.104e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510392.06613647455 -> -510391.9428184697
    optimizing logp for variables: [phase]
    
    100.00% [170/170 00:00<00:00 logp = -5.103e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510571.7359856426 -> -510331.2674107338
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [76/76 00:00<00:00 logp = -5.103e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510331.2674107338 -> -510331.2310220168
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.102e+05]
    message: Optimization terminated successfully.
    logp: -510450.11569274456 -> -510249.0526062218
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [70/70 00:00<00:00 logp = -5.102e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510249.0526062218 -> -510249.0137723321
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.100e+05]
    message: Optimization terminated successfully.
    logp: -510592.10278456827 -> -510046.60649154
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [99/99 00:00<00:00 logp = -5.100e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510046.60649154 -> -510046.5864177699
    optimizing logp for variables: [phase]
    
    100.00% [40/40 00:00<00:00 logp = -5.100e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510050.29543516156 -> -510048.93405236007
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [63/63 00:00<00:00 logp = -5.100e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510048.93405236007 -> -510048.8790001046
    optimizing logp for variables: [phase]
    
    100.00% [60/60 00:00<00:00 logp = -5.099e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510354.63424989174 -> -509857.1606534355
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [67/67 00:00<00:00 logp = -5.099e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509857.1606534355 -> -509856.93263329787
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.097e+05]
    message: Optimization terminated successfully.
    logp: -510011.01398432604 -> -509675.1643513321
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [40/40 00:00<00:00 logp = -5.097e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509675.1643513321 -> -509675.0981450564
    optimizing logp for variables: [phase]
    
    100.00% [57/57 00:00<00:00 logp = -5.096e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509641.6787881825 -> -509626.83599409665
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [91/91 00:00<00:00 logp = -5.096e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509626.83599409665 -> -509626.8053848676
    optimizing logp for variables: [phase]
    
    100.00% [120/120 00:00<00:00 logp = -5.095e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -510084.9790384732 -> -509451.23320439726
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [67/67 00:00<00:00 logp = -5.095e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509451.23320439726 -> -509451.20322444144
    optimizing logp for variables: [phase]
    
    100.00% [6/6 00:00<00:00 logp = -5.095e+05]
    message: Optimization terminated successfully.
    logp: -509453.85491656844 -> -509453.6109468318
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [74/74 00:00<00:00 logp = -5.095e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509453.6109468318 -> -509453.53818855784
    optimizing logp for variables: [phase]
    
    100.00% [51/51 00:00<00:00 logp = -5.094e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509385.3239745907 -> -509384.15889805905
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [41/41 00:00<00:00 logp = -5.094e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509384.15889805905 -> -509384.11117131135
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.093e+05]
    message: Optimization terminated successfully.
    logp: -509360.24805483094 -> -509345.02377522795
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [66/66 00:00<00:00 logp = -5.093e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509345.02377522795 -> -509344.9841655483
    optimizing logp for variables: [phase]
    
    100.00% [55/55 00:00<00:00 logp = -5.092e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509757.986391643 -> -509173.1046918616
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [43/43 00:00<00:00 logp = -5.092e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -509173.1046918616 -> -509173.01883557887
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [63/63 00:00<00:00 logp = -5.090e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508996.3599605416 -> -508995.7761225565
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [18/18 00:00<00:00 logp = -5.090e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508995.7761225565 -> -508995.69261358894
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.088e+05]
    message: Optimization terminated successfully.
    logp: -508830.32784519467 -> -508826.13145466027
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [26/26 00:00<00:00 logp = -5.088e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508826.13145466027 -> -508826.0622179953
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [77/77 00:00<00:00 logp = -5.087e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508802.3424802293 -> -508677.918627869
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [47/47 00:00<00:00 logp = -5.087e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508677.918627869 -> -508677.7527785795
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.085e+05]
    message: Optimization terminated successfully.
    logp: -508921.6506883218 -> -508520.7732920317
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [42/42 00:00<00:00 logp = -5.085e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508520.7732920317 -> -508520.40768329165
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.084e+05]
    message: Optimization terminated successfully.
    logp: -508581.7827284707 -> -508361.4415946816
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [85/85 00:00<00:00 logp = -5.084e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508361.4415946816 -> -508361.40933321166
    optimizing logp for variables: [phase]
    
    100.00% [56/56 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508335.87790587795 -> -508330.99641589524
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [82/82 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508330.99641589524 -> -508330.9947348484
    optimizing logp for variables: [phase]
    
    100.00% [98/98 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508335.4879742673 -> -508332.73908520077
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [158/158 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508332.73908520077 -> -508332.68009079923
    optimizing logp for variables: [phase]
    
    100.00% [61/61 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508500.1875762547 -> -508272.1543702127
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [202/202 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508272.1543702127 -> -508272.0945988618
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.083e+05]
    message: Optimization terminated successfully.
    logp: -508273.4185800326 -> -508252.3451059523
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [82/82 00:00<00:00 logp = -5.083e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508252.3451059523 -> -508252.33033159503
    optimizing logp for variables: [phase]
    
    100.00% [8/8 00:00<00:00 logp = -5.081e+05]
    message: Optimization terminated successfully.
    logp: -508159.3391776865 -> -508114.9900740204
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [54/54 00:00<00:00 logp = -5.081e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508114.9900740204 -> -508114.9195260901
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.081e+05]
    message: Optimization terminated successfully.
    logp: -508175.6198399719 -> -508078.57006876986
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [19/19 00:00<00:00 logp = -5.081e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508078.57006876986 -> -508078.56256841175
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.080e+05]
    message: Optimization terminated successfully.
    logp: -508035.73672408547 -> -508031.17922967894
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [14/14 00:00<00:00 logp = -5.080e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -508031.17922967894 -> -508031.16516776057
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.079e+05]
    message: Optimization terminated successfully.
    logp: -507906.30550660205 -> -507900.3354219609
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [59/59 00:00<00:00 logp = -5.079e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507900.3354219609 -> -507900.2464222675
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.078e+05]
    message: Optimization terminated successfully.
    logp: -508260.36854636756 -> -507776.37941026886
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [54/54 00:00<00:00 logp = -5.078e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507776.37941026886 -> -507776.37279664574
    optimizing logp for variables: [phase]
    
    100.00% [51/51 00:00<00:00 logp = -5.078e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507779.2201000002 -> -507778.31565239816
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [75/75 00:00<00:00 logp = -5.078e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507778.31565239816 -> -507778.28305254446
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.077e+05]
    message: Optimization terminated successfully.
    logp: -507740.0360123964 -> -507684.7876948826
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [95/95 00:00<00:00 logp = -5.077e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507684.7876948826 -> -507684.7446522728
    optimizing logp for variables: [phase]
    
    100.00% [8/8 00:00<00:00 logp = -5.076e+05]
    message: Optimization terminated successfully.
    logp: -507759.59849742893 -> -507574.20764546044
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [79/79 00:00<00:00 logp = -5.076e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507574.20764546044 -> -507574.1772920379
    optimizing logp for variables: [phase]
    
    100.00% [42/42 00:00<00:00 logp = -5.075e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507803.6490413723 -> -507476.72590856475
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [39/39 00:00<00:00 logp = -5.075e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507476.72590856475 -> -507476.67381141684
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [81/81 00:00<00:00 logp = -5.073e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507386.1499775583 -> -507315.9689056266
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [34/34 00:00<00:00 logp = -5.073e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507315.9689056266 -> -507315.82304703066
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [6/6 00:00<00:00 logp = -5.072e+05]
    message: Optimization terminated successfully.
    logp: -507300.98623557715 -> -507208.0614061468
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [58/58 00:00<00:00 logp = -5.072e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507208.0614061468 -> -507208.06098473765
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.072e+05]
    message: Optimization terminated successfully.
    logp: -507212.48579763004 -> -507210.4220948387
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [50/50 00:00<00:00 logp = -5.072e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507210.4220948387 -> -507210.36795540585
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.072e+05]
    message: Optimization terminated successfully.
    logp: -507211.00692108116 -> -507209.89080171095
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [44/44 00:00<00:00 logp = -5.072e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507209.89080171095 -> -507209.8103052392
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [48/48 00:00<00:00 logp = -5.071e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507091.3534788364 -> -507064.41298311466
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [53/53 00:00<00:00 logp = -5.071e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507064.41298311466 -> -507064.3397657846
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.070e+05]
    message: Optimization terminated successfully.
    logp: -507111.6533096424 -> -507033.434474187
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [64/64 00:00<00:00 logp = -5.070e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -507033.434474187 -> -507033.43130129046
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.069e+05]
    message: Optimization terminated successfully.
    logp: -507205.6590776238 -> -506937.7543488982
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [110/110 00:00<00:00 logp = -5.069e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506937.7543488982 -> -506937.75079640193
    optimizing logp for variables: [phase]
    
    100.00% [8/8 00:00<00:00 logp = -5.068e+05]
    message: Optimization terminated successfully.
    logp: -506874.5072530778 -> -506844.62025393895
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [69/69 00:00<00:00 logp = -5.068e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506844.62025393895 -> -506844.54813023185
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.067e+05]
    message: Optimization terminated successfully.
    logp: -506752.70680436346 -> -506747.18659971835
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [120/120 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506747.18659971835 -> -506747.10478835646
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.067e+05]
    message: Optimization terminated successfully.
    logp: -506752.45184305974 -> -506749.2127788833
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [100/100 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506749.2127788833 -> -506749.1762774094
    optimizing logp for variables: [phase]
    
    100.00% [9/9 00:00<00:00 logp = -5.067e+05]
    message: Optimization terminated successfully.
    logp: -506751.9643302484 -> -506748.244060406
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [71/71 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506748.244060406 -> -506748.20722366596
    optimizing logp for variables: [phase]
    
    100.00% [57/57 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506751.10588629026 -> -506747.26579913567
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [62/62 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506747.26579913567 -> -506747.2302525258
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.067e+05]
    message: Optimization terminated successfully.
    logp: -506723.3740781517 -> -506721.19721717533
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [72/72 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506721.19721717533 -> -506721.17631907796
    optimizing logp for variables: [phase]
    
    100.00% [76/76 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506725.0930142362 -> -506723.1983930584
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [94/94 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506723.1983930584 -> -506723.1355901276
    optimizing logp for variables: [phase]
    
    100.00% [10/10 00:00<00:00 logp = -5.067e+05]
    message: Optimization terminated successfully.
    logp: -506749.141672144 -> -506706.9764862107
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [69/69 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506706.9764862107 -> -506706.9697133725
    optimizing logp for variables: [phase]
    
    100.00% [55/55 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506710.1845118156 -> -506708.3699391904
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [69/69 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506708.3699391904 -> -506708.323334696
    optimizing logp for variables: [phase]
    
    100.00% [40/40 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506707.64142033533 -> -506707.61717448
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [121/121 00:00<00:00 logp = -5.067e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506707.61717448 -> -506707.5749639639
    optimizing logp for variables: [phase]
    
    100.00% [75/75 00:00<00:00 logp = -5.066e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506918.577906527 -> -506616.48858429096
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [76/76 00:00<00:00 logp = -5.066e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506616.48858429096 -> -506616.39559802687
    optimizing logp for variables: [phase]
    
    100.00% [51/51 00:00<00:00 logp = -5.065e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506541.2061881427 -> -506525.33558204485
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [14/14 00:00<00:00 logp = -5.065e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506525.33558204485 -> -506525.3213573686
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [64/64 00:00<00:00 logp = -5.064e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506418.9303625347 -> -506393.2835738321
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [14/14 00:00<00:00 logp = -5.064e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506393.2835738321 -> -506393.21160972444
    
    
    
    
    
    optimizing logp for variables: [phase]
    
    100.00% [7/7 00:00<00:00 logp = -5.064e+05]
    message: Optimization terminated successfully.
    logp: -506363.67549774254 -> -506360.9932385845
    
    
    
    
    
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [54/54 00:00<00:00 logp = -5.064e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506360.9932385845 -> -506360.98915080406
    optimizing logp for variables: [phase]
    
    100.00% [83/83 00:00<00:00 logp = -5.064e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506365.73195002874 -> -506363.11160979065
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [56/56 00:00<00:00 logp = -5.064e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506363.11160979065 -> -506363.0643565985
    optimizing logp for variables: [phase]
    
    100.00% [72/72 00:00<00:00 logp = -5.063e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506413.28659796255 -> -506337.57658372214
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [87/87 00:00<00:00 logp = -5.063e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506337.57658372214 -> -506337.5725079755
    optimizing logp for variables: [phase]
    
    100.00% [94/94 00:00<00:00 logp = -5.063e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506340.00100456487 -> -506339.7988265761
    optimizing logp for variables: [phase, amp, nu]
    
    100.00% [73/73 00:00<00:00 logp = -5.063e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -506339.7988265761 -> -506339.726062967
    
    
    Individually optimised sinusoids: 
    Sinusoid 0: Frequency: 0.8628822725042647 Amplitude: 9818.381377096632 Phase: -1.0716513814775581
    Sinusoid 1: Frequency: 0.8385268021180636 Amplitude: 5022.410009270108 Phase: 2.437522746730275
    Sinusoid 2: Frequency: 0.8948468890159779 Amplitude: 3399.1617631600175 Phase: 0.702795258261359
    Sinusoid 3: Frequency: 0.8143155075048418 Amplitude: 1762.4912040537752 Phase: -2.661475965230078
    Sinusoid 4: Frequency: 0.992192866002341 Amplitude: 1393.1909258560406 Phase: 0.07077037027691974
    Sinusoid 5: Frequency: 0.9133823678006227 Amplitude: 933.6402412096301 Phase: 0.26653910195770125
    Sinusoid 6: Frequency: 1.8083245974924762 Amplitude: 462.20694904554705 Phase: 3.033488919786429
    Sinusoid 7: Frequency: 0.931822457967053 Amplitude: 615.1443506142805 Phase: -2.235408297781298
    Sinusoid 8: Frequency: 0.9678532595198092 Amplitude: 540.5181517578595 Phase: -2.9236724987271296
    Sinusoid 9: Frequency: 0.7942523941279644 Amplitude: 469.36190182038274 Phase: -0.9980526184890653
    Sinusoid 10: Frequency: 0.8622397133163665 Amplitude: 417.4739718949169 Phase: 0.16191618500475677
    Sinusoid 11: Frequency: 0.7457590731211842 Amplitude: 354.1218263255444 Phase: 0.5346609553342329
    Sinusoid 12: Frequency: 1.725730069965856 Amplitude: 241.97661517430362 Phase: 3.067640006796455
    Sinusoid 13: Frequency: 0.8379802687116008 Amplitude: 346.9334537734843 Phase: -2.3336172331567804
    Sinusoid 14: Frequency: 0.8635939638558101 Amplitude: 311.93295738279045 Phase: 0.7492376708535696
    Sinusoid 15: Frequency: 0.850616849764597 Amplitude: 266.8900919652184 Phase: -2.9867013335064887
    Sinusoid 16: Frequency: 0.8263313277238173 Amplitude: 254.1181535013056 Phase: 2.478010395072566
    Sinusoid 17: Frequency: 1.0186537694822904 Amplitude: 214.03403132330828 Phase: -1.3147851491760356
    Sinusoid 18: Frequency: 1.7762502926004855 Amplitude: 138.08003458184564 Phase: -1.8730172267872514
    Sinusoid 19: Frequency: 1.7577406547039616 Amplitude: 136.71255210608535 Phase: -1.4616427942692682
    Sinusoid 20: Frequency: 3.678165487692879 Amplitude: 20.222608315792822 Phase: 3.1341482258190103
    Sinusoid 21: Frequency: 0.8772061689020307 Amplitude: 225.8405229485119 Phase: 0.1728041765271597
    Sinusoid 22: Frequency: 1.8550559016814976 Amplitude: 92.70415911112673 Phase: -2.139674692050392
    Sinusoid 23: Frequency: 1.7014269404572864 Amplitude: 130.69147806221233 Phase: 0.19536267202077587
    Sinusoid 24: Frequency: 0.969700361870023 Amplitude: 153.229315529401 Phase: 1.5175001957854657
    Sinusoid 25: Frequency: 1.7400648481829808 Amplitude: 93.59431791945627 Phase: 1.1642566181201417
    Sinusoid 26: Frequency: 0.02441525716631654 Amplitude: 198.68161353168858 Phase: 1.2972916570666286
    Sinusoid 27: Frequency: 0.8162000610445259 Amplitude: 150.25836358714727 Phase: -2.2613887887597754
    Sinusoid 28: Frequency: 0.031967672116955975 Amplitude: 167.07707456503036 Phase: -0.13509019821162888
    Sinusoid 29: Frequency: 5.367976538315179 Amplitude: 9.223231866617587 Phase: 0.07122493821474495
    Sinusoid 30: Frequency: 0.7531724171259668 Amplitude: 122.8043529884058 Phase: 0.11832169864687556
    Sinusoid 31: Frequency: 0.8149061435487177 Amplitude: 118.71136769386536 Phase: -0.9857292786924358
    Sinusoid 32: Frequency: 0.8617008823486654 Amplitude: 118.14259994646699 Phase: 2.6977162781133144
    Sinusoid 33: Frequency: 0.8029469042111956 Amplitude: 116.38879803258764 Phase: 3.0192454375529687
    Sinusoid 34: Frequency: 0.8046461820746298 Amplitude: 118.99709229142259 Phase: -0.1564250810012957
    Sinusoid 35: Frequency: 0.7091568860418029 Amplitude: 112.75573205180095 Phase: 1.6621812453262388
    Sinusoid 36: Frequency: 0.8511512470035688 Amplitude: 111.47407032591241 Phase: 2.043865073670563
    Sinusoid 37: Frequency: 1.7137463610371253 Amplitude: 68.95007056784613 Phase: 0.31068107299286724
    Sinusoid 38: Frequency: 0.8308898209241259 Amplitude: 108.53361394286358 Phase: -3.1055547258771274
    Sinusoid 39: Frequency: 1.809156008968551 Amplitude: 55.163676630802065 Phase: -2.67537813790751
    Sinusoid 40: Frequency: 3.496920968657891 Amplitude: 10.740028440424101 Phase: 0.9696999358259779
    Sinusoid 41: Frequency: 0.8394616826956487 Amplitude: 104.01701588414271 Phase: -2.3022377793655266
    Sinusoid 42: Frequency: 3.5019674532502876 Amplitude: 10.641777476952539 Phase: 0.4399887130559474
    Sinusoid 43: Frequency: 1.6658088972553589 Amplitude: 68.3220637455479 Phase: -2.1308927797582826
    Sinusoid 44: Frequency: 2.004403016525896 Amplitude: 31.973884099913818 Phase: -2.9074730035183847
    Sinusoid 45: Frequency: 0.7335829031328708 Amplitude: 96.90620591646112 Phase: -2.0827027348500073
    Sinusoid 46: Frequency: 1.8077264711156718 Amplitude: 48.78106713237115 Phase: -2.753340378283999
    Sinusoid 47: Frequency: 1.6772237643916803 Amplitude: 56.53475754852111 Phase: 2.4312237609999543
    Sinusoid 48: Frequency: 0.8275610667545857 Amplitude: 88.69741393538165 Phase: 2.5554034034362823
    Sinusoid 49: Frequency: 7.303685936973226 Amplitude: 6.481145194852294 Phase: 1.9716888588402963
    Sinusoid 50: Frequency: 0.8956424136412444 Amplitude: 85.66470883883667 Phase: 2.52342133453413
    Sinusoid 51: Frequency: 0.6736624934102525 Amplitude: 84.08443692388408 Phase: 2.1229739439967195
    Sinusoid 52: Frequency: 1.8063748648933786 Amplitude: 43.501755312154806 Phase: 1.1861665502201146
    Sinusoid 53: Frequency: 0.9142680384086775 Amplitude: 82.48007708760368 Phase: -3.1393989101505775
    Sinusoid 54: Frequency: 12.490494190419314 Amplitude: 5.552020460599701 Phase: -0.018857860949406592
    Sinusoid 55: Frequency: 1.6906883817609235 Amplitude: 51.00618730489362 Phase: 0.7630974821835892
    Sinusoid 56: Frequency: 1.8307114827264783 Amplitude: 39.25883466453569 Phase: 1.2597951841803354
    Sinusoid 57: Frequency: 0.8501370567212413 Amplitude: 81.61388388823555 Phase: -1.73236684703108
    Sinusoid 58: Frequency: 0.840276378507852 Amplitude: 83.02962334823538 Phase: 0.6856363351346391
    Sinusoid 59: Frequency: 0.7137857901390254 Amplitude: 81.18861619037298 Phase: 0.7859659592062552
    Sinusoid 60: Frequency: 0.9486077236971506 Amplitude: 75.8490125899559 Phase: 1.5791302321595737
    Sinusoid 61: Frequency: 0.8942008972198755 Amplitude: 78.1266726536545 Phase: 2.481682571625635
    Sinusoid 62: Frequency: 0.7463616114054358 Amplitude: 78.55477324641338 Phase: 1.8890616163095937
    Sinusoid 63: Frequency: 1.842005928452596 Amplitude: 34.857650212262 Phase: 0.2298129083964041
    Sinusoid 64: Frequency: 7.17998142616027 Amplitude: 5.799133279167572 Phase: -2.3105400621253582
    Sinusoid 65: Frequency: 1.6424035988656507 Amplitude: 47.41588599783491 Phase: -2.7307841176508973
    Sinusoid 66: Frequency: 1.8870216045073476 Amplitude: 28.413436727254314 Phase: -0.4326967026705848
    Sinusoid 67: Frequency: 0.806613431390932 Amplitude: 72.8227781852877 Phase: 0.05017916652475211
    Sinusoid 68: Frequency: 1.7703295955312643 Amplitude: 37.908934412737416 Phase: 2.5238096650071222
    Sinusoid 69: Frequency: 1.6891312732987986 Amplitude: 42.88847763395186 Phase: 0.9377943692009525
    Sinusoid 70: Frequency: 0.8374277120110131 Amplitude: 71.2612257951182 Phase: 0.412648932499647
    Sinusoid 71: Frequency: 0.8642849131389073 Amplitude: 69.39418555338281 Phase: -2.210573911940867
    Sinusoid 72: Frequency: 3.5601704757863466 Amplitude: 7.359679107555969 Phase: 1.513483617667818
    Sinusoid 73: Frequency: 0.9915281783312622 Amplitude: 59.374149196747354 Phase: 1.4300460919869045
    Sinusoid 74: Frequency: 0.7839686872911263 Amplitude: 65.58952097088529 Phase: 2.0370737775449195
    Sinusoid 75: Frequency: 0.9454204968599332 Amplitude: 61.53821958067088 Phase: 2.947220382735689
    Sinusoid 76: Frequency: 0.011293445902563922 Amplitude: 80.44229416845025 Phase: 1.2898197693107933
    Sinusoid 77: Frequency: 0.6827782996625603 Amplitude: 63.6525873373382 Phase: -0.3552119658085798
    Sinusoid 78: Frequency: 5.285823415086792 Amplitude: 5.579701817103982 Phase: 2.8259747329179605
    Sinusoid 79: Frequency: 9.193701683487957 Amplitude: 4.697955657288483 Phase: 2.526334134578365
    Sinusoid 80: Frequency: 0.1292824698882714 Amplitude: 74.99673511420123 Phase: 0.19277569017202575
    Sinusoid 81: Frequency: 1.7418320191260772 Amplitude: 34.08633881439787 Phase: 2.519081376579351
    Sinusoid 82: Frequency: 0.7193647261284017 Amplitude: 60.96680488616166 Phase: 2.615861860936124
    Sinusoid 83: Frequency: 0.6751658949843297 Amplitude: 60.26578722816501 Phase: 1.2013365770735627
    Sinusoid 84: Frequency: 0.7947799626348998 Amplitude: 61.46403569810982 Phase: 0.3889321442681975
    Sinusoid 85: Frequency: 3.6774827925062974 Amplitude: 6.45287353574303 Phase: -1.782919850268259
    Sinusoid 86: Frequency: 3.6226059605798717 Amplitude: 6.536260818429911 Phase: -2.8571436325985182
    Sinusoid 87: Frequency: 3.566091163934289 Amplitude: 6.590341153983397 Phase: -2.251076894771897
    Sinusoid 88: Frequency: 1.7897051087574272 Amplitude: 30.369875659448013 Phase: 0.32325532521384437
    Sinusoid 89: Frequency: 6.2239650310889525 Amplitude: 5.067245759780874 Phase: -1.88890903318219
    Sinusoid 90: Frequency: 1.8814515405197783 Amplitude: 23.545664862350772 Phase: 2.7135445874010773
    Sinusoid 91: Frequency: 4.423028442001987 Amplitude: 5.778234505175793 Phase: 2.4633867234785556
    Sinusoid 92: Frequency: 3.7491588298910643 Amplitude: 6.067838268617444 Phase: 0.4538432357956184
    Sinusoid 93: Frequency: 0.8601331940043023 Amplitude: 58.484320366273046 Phase: 3.003210400520848
    Sinusoid 94: Frequency: 0.7607829333362941 Amplitude: 59.53348208627628 Phase: 0.2105122820931909
    Sinusoid 95: Frequency: 0.013733979521601474 Amplitude: 72.89236126330873 Phase: 1.0639464991848142
    Sinusoid 96: Frequency: 1.7091237066210125 Amplitude: 33.553225956958826 Phase: 0.3222323652471837
    Sinusoid 97: Frequency: 4.498243241892678 Amplitude: 5.578347629225047 Phase: -2.7947071266964
    Sinusoid 98: Frequency: 1.7719611642794475 Amplitude: 29.931287881552354 Phase: 2.9088085263456156
    Sinusoid 99: Frequency: 6.963052254616765 Amplitude: 4.594814512300109 Phase: 1.3389678494629043
    
    
    optimizing logp for variables: [phase]
    
    100.00% [232/232 01:12<00:00 logp = -5.058e+05]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -8194911.028871567 -> -505818.72877608833
    optimizing logp for variables: [offset, phase, amp, nu]
    
    100.00% [16/16 00:07<00:00 logp = -inf]
    message: Desired error not necessarily achieved due to precision loss.
    logp: -505818.72877608833 -> -505818.72877608833
    
    
    The IPW analysis has found 100 significant frequencies
    

    Now that it’s run, let’s take a look at the model, the residual signal, and the frequencies that we found.

    print(' C + A*sin( 2*pi*f*(t-t0)+phi )')
    
    outstr = '{} -- C: {:.6f} -- A: {:.6f} -- f: {:.6f} -- phi: {:.6f} -- SNR: {:.6f}'
    for ii,freq in enumerate(frequencies):
        print(outstr.format(ii, offsets[ii], amplitudes[ii], freq, phases[ii],stop_criteria[ii]))
    
    
     C + A*sin( 2*pi*f*(t-t0)+phi )
    0 -- C: 0.000000 -- A: 9818.381377 -- f: 0.862882 -- phi: -1.073965 -- SNR: 1585.793934
    1 -- C: 0.000000 -- A: 5022.410009 -- f: 0.838527 -- phi: 2.428918 -- SNR: 805.292687
    2 -- C: 0.000000 -- A: 3399.161763 -- f: 0.894847 -- phi: 0.698282 -- SNR: 554.693038
    3 -- C: 0.000000 -- A: 1762.491204 -- f: 0.814316 -- phi: -2.681743 -- SNR: 281.002004
    4 -- C: 0.000000 -- A: 1393.190926 -- f: 0.992193 -- phi: 0.075233 -- SNR: 250.318927
    5 -- C: 0.000000 -- A: 933.640241 -- f: 0.913382 -- phi: 0.275413 -- SNR: 153.762764
    6 -- C: 0.000000 -- A: 462.206949 -- f: 1.808325 -- phi: 3.038388 -- SNR: 155.166545
    7 -- C: 0.000000 -- A: 615.144351 -- f: 0.931822 -- phi: -2.244735 -- SNR: 102.503897
    8 -- C: 0.000000 -- A: 540.518152 -- f: 0.967853 -- phi: -2.904781 -- SNR: 93.913067
    9 -- C: 0.000000 -- A: 469.361902 -- f: 0.794252 -- phi: -1.047650 -- SNR: 74.821052
    10 -- C: 0.000000 -- A: 417.473972 -- f: 0.862240 -- phi: 0.135279 -- SNR: 67.424043
    11 -- C: 0.000000 -- A: 354.121826 -- f: 0.745759 -- phi: 0.496428 -- SNR: 56.509619
    12 -- C: 0.000000 -- A: 241.976615 -- f: 1.725730 -- phi: 3.064024 -- SNR: 69.815498
    13 -- C: 0.000000 -- A: 346.933454 -- f: 0.837980 -- phi: -2.330092 -- SNR: 55.618737
    14 -- C: 0.000000 -- A: 311.932957 -- f: 0.863594 -- phi: 0.734302 -- SNR: 50.407712
    15 -- C: 0.000000 -- A: 266.890092 -- f: 0.850617 -- phi: -2.996589 -- SNR: 42.975793
    16 -- C: 0.000000 -- A: 254.118154 -- f: 0.826331 -- phi: 2.457949 -- SNR: 40.629702
    17 -- C: 0.000000 -- A: 214.034031 -- f: 1.018654 -- phi: -1.335601 -- SNR: 40.428393
    18 -- C: 0.000000 -- A: 138.080035 -- f: 1.776250 -- phi: -1.833431 -- SNR: 43.580183
    19 -- C: 0.000000 -- A: 136.712552 -- f: 1.757741 -- phi: -1.472913 -- SNR: 41.613703
    20 -- C: 0.000000 -- A: 20.222608 -- f: 3.678165 -- phi: 3.124638 -- SNR: 33.013216
    21 -- C: 0.000000 -- A: 225.840523 -- f: 0.877206 -- phi: 0.138064 -- SNR: 36.564691
    22 -- C: 0.000000 -- A: 92.704159 -- f: 1.855056 -- phi: -2.121227 -- SNR: 34.497592
    23 -- C: 0.000000 -- A: 130.691478 -- f: 1.701427 -- phi: 0.214414 -- SNR: 36.444399
    24 -- C: 0.000000 -- A: 153.229316 -- f: 0.969700 -- phi: 1.501736 -- SNR: 26.659142
    25 -- C: 0.000000 -- A: 93.594318 -- f: 1.740065 -- phi: 1.159948 -- SNR: 27.687226
    26 -- C: 0.000000 -- A: 198.681614 -- f: 0.024415 -- phi: 1.292182 -- SNR: 25.735210
    27 -- C: 0.000000 -- A: 150.258364 -- f: 0.816200 -- phi: -2.229325 -- SNR: 23.964556
    28 -- C: 0.000000 -- A: 167.077075 -- f: 0.031968 -- phi: -0.140278 -- SNR: 21.686165
    29 -- C: 0.000000 -- A: 9.223232 -- f: 5.367977 -- phi: 0.045060 -- SNR: 18.797155
    30 -- C: 0.000000 -- A: 122.804353 -- f: 0.753172 -- phi: 0.165122 -- SNR: 19.544208
    31 -- C: 0.000000 -- A: 118.711368 -- f: 0.814906 -- phi: -1.009365 -- SNR: 18.929159
    32 -- C: 0.000000 -- A: 118.142600 -- f: 0.861701 -- phi: 2.697260 -- SNR: 19.076670
    33 -- C: 0.000000 -- A: 116.388798 -- f: 0.802947 -- phi: 2.998235 -- SNR: 18.577579
    34 -- C: 0.000000 -- A: 118.997092 -- f: 0.804646 -- phi: -0.157060 -- SNR: 18.992628
    35 -- C: 0.000000 -- A: 112.755732 -- f: 0.709157 -- phi: 1.725806 -- SNR: 18.187971
    36 -- C: 0.000000 -- A: 111.474070 -- f: 0.851151 -- phi: 2.152432 -- SNR: 17.955891
    37 -- C: 0.000000 -- A: 68.950071 -- f: 1.713746 -- phi: 0.307083 -- SNR: 19.473555
    38 -- C: 0.000000 -- A: 108.533614 -- f: 0.830890 -- phi: -3.061788 -- SNR: 17.371115
    39 -- C: 0.000000 -- A: 55.163677 -- f: 1.809156 -- phi: -2.660938 -- SNR: 18.537651
    40 -- C: 0.000000 -- A: 10.740028 -- f: 3.496921 -- phi: 0.984318 -- SNR: 16.521364
    41 -- C: 0.000000 -- A: 104.017016 -- f: 0.839462 -- phi: -2.294749 -- SNR: 16.681954
    42 -- C: 0.000000 -- A: 10.641777 -- f: 3.501967 -- phi: 0.430617 -- SNR: 16.335530
    43 -- C: 0.000000 -- A: 68.322064 -- f: 1.665809 -- phi: -2.089624 -- SNR: 18.208573
    44 -- C: 0.000000 -- A: 31.973884 -- f: 2.004403 -- phi: -2.931668 -- SNR: 16.075918
    45 -- C: 0.000000 -- A: 96.906206 -- f: 0.733583 -- phi: -2.065870 -- SNR: 15.522469
    46 -- C: 0.000000 -- A: 48.781067 -- f: 1.807726 -- phi: -2.790884 -- SNR: 16.364280
    47 -- C: 0.000000 -- A: 56.534758 -- f: 1.677224 -- phi: 2.430376 -- SNR: 15.285380
    48 -- C: 0.000000 -- A: 88.697414 -- f: 0.827561 -- phi: 2.566068 -- SNR: 14.177624
    49 -- C: 0.000000 -- A: 6.481145 -- f: 7.303686 -- phi: 1.957252 -- SNR: 14.728511
    50 -- C: 0.000000 -- A: 85.664709 -- f: 0.895642 -- phi: 2.505219 -- SNR: 13.984589
    51 -- C: 0.000000 -- A: 84.084437 -- f: 0.673662 -- phi: 2.143283 -- SNR: 13.624847
    52 -- C: 0.000000 -- A: 43.501755 -- f: 1.806375 -- phi: 1.139053 -- SNR: 14.572210
    53 -- C: 0.000000 -- A: 82.480077 -- f: 0.914268 -- phi: 3.129082 -- SNR: 13.583522
    54 -- C: 0.000000 -- A: 5.552020 -- f: 12.490494 -- phi: -0.007934 -- SNR: 14.721185
    55 -- C: 0.000000 -- A: 51.006187 -- f: 1.690688 -- phi: 0.780279 -- SNR: 13.991165
    56 -- C: 0.000000 -- A: 39.258835 -- f: 1.830711 -- phi: 1.281286 -- SNR: 13.815269
    57 -- C: 0.000000 -- A: 81.613884 -- f: 0.850137 -- phi: -1.694002 -- SNR: 13.138400
    58 -- C: 0.000000 -- A: 83.029623 -- f: 0.840276 -- phi: 0.684662 -- SNR: 13.320886
    59 -- C: 0.000000 -- A: 81.188616 -- f: 0.713786 -- phi: 0.773795 -- SNR: 13.064406
    60 -- C: 0.000000 -- A: 75.849013 -- f: 0.948608 -- phi: 1.527991 -- SNR: 12.852116
    61 -- C: 0.000000 -- A: 78.126673 -- f: 0.894201 -- phi: 2.453637 -- SNR: 12.746357
    62 -- C: 0.000000 -- A: 78.554773 -- f: 0.746362 -- phi: 1.883552 -- SNR: 12.530071
    63 -- C: 0.000000 -- A: 34.857650 -- f: 1.842006 -- phi: 0.252634 -- SNR: 12.535040
    64 -- C: 0.000000 -- A: 5.799133 -- f: 7.179981 -- phi: -2.284245 -- SNR: 13.041908
    65 -- C: 0.000000 -- A: 47.415886 -- f: 1.642404 -- phi: -2.736154 -- SNR: 12.337014
    66 -- C: 0.000000 -- A: 28.413437 -- f: 1.887022 -- phi: -0.405927 -- SNR: 11.703112
    67 -- C: 0.000000 -- A: 72.822778 -- f: 0.806613 -- phi: 0.080031 -- SNR: 11.623257
    68 -- C: 0.000000 -- A: 37.908934 -- f: 1.770330 -- phi: 2.481085 -- SNR: 11.859855
    69 -- C: 0.000000 -- A: 42.888478 -- f: 1.689131 -- phi: 0.940662 -- SNR: 11.763464
    70 -- C: 0.000000 -- A: 71.261226 -- f: 0.837428 -- phi: 0.505650 -- SNR: 11.423463
    71 -- C: 0.000000 -- A: 69.394186 -- f: 0.864285 -- phi: -2.177713 -- SNR: 11.216718
    72 -- C: 0.000000 -- A: 7.359679 -- f: 3.560170 -- phi: 1.460974 -- SNR: 11.574213
    73 -- C: 0.000000 -- A: 59.374149 -- f: 0.991528 -- phi: 1.455186 -- SNR: 10.661574
    74 -- C: 0.000000 -- A: 65.589521 -- f: 0.783969 -- phi: 2.004946 -- SNR: 10.433500
    75 -- C: 0.000000 -- A: 61.538220 -- f: 0.945420 -- phi: 2.930114 -- SNR: 10.392900
    76 -- C: 0.000000 -- A: 80.442294 -- f: 0.011293 -- phi: 1.273991 -- SNR: 10.411507
    77 -- C: 0.000000 -- A: 63.652587 -- f: 0.682778 -- phi: -0.334606 -- SNR: 10.291364
    78 -- C: 0.000000 -- A: 5.579702 -- f: 5.285823 -- phi: 2.838152 -- SNR: 11.286015
    79 -- C: 0.000000 -- A: 4.697956 -- f: 9.193702 -- phi: 2.514107 -- SNR: 11.607491
    80 -- C: 0.000000 -- A: 74.996735 -- f: 0.129282 -- phi: 0.172337 -- SNR: 10.094386
    81 -- C: 0.000000 -- A: 34.086339 -- f: 1.741832 -- phi: 2.531069 -- SNR: 10.108127
    82 -- C: 0.000000 -- A: 60.966805 -- f: 0.719365 -- phi: 2.592525 -- SNR: 9.790210
    83 -- C: 0.000000 -- A: 60.265787 -- f: 0.675166 -- phi: 1.198081 -- SNR: 9.766477
    84 -- C: 0.000000 -- A: 61.464036 -- f: 0.794780 -- phi: 0.411177 -- SNR: 9.794374
    85 -- C: 0.000000 -- A: 6.452874 -- f: 3.677483 -- phi: -1.774423 -- SNR: 10.529775
    86 -- C: 0.000000 -- A: 6.536261 -- f: 3.622606 -- phi: -2.872335 -- SNR: 10.420905
    87 -- C: 0.000000 -- A: 6.590341 -- f: 3.566091 -- phi: -2.250681 -- SNR: 10.369513
    88 -- C: 0.000000 -- A: 30.369876 -- f: 1.789705 -- phi: 0.314379 -- SNR: 9.842815
    89 -- C: 0.000000 -- A: 5.067246 -- f: 6.223965 -- phi: -1.884927 -- SNR: 10.746702
    90 -- C: 0.000000 -- A: 23.545665 -- f: 1.881452 -- phi: 2.710976 -- SNR: 9.580228
    91 -- C: 0.000000 -- A: 5.778235 -- f: 4.423028 -- phi: 2.478388 -- SNR: 10.369001
    92 -- C: 0.000000 -- A: 6.067838 -- f: 3.749159 -- phi: 0.436574 -- SNR: 10.215060
    93 -- C: 0.000000 -- A: 58.484320 -- f: 0.860133 -- phi: 3.007740 -- SNR: 9.439776
    94 -- C: 0.000000 -- A: 59.533482 -- f: 0.760783 -- phi: 0.202830 -- SNR: 9.477771
    95 -- C: 0.000000 -- A: 72.892361 -- f: 0.013734 -- phi: 1.061672 -- SNR: 9.441853
    96 -- C: 0.000000 -- A: 33.553226 -- f: 1.709124 -- phi: 0.311777 -- SNR: 9.454356
    97 -- C: 0.000000 -- A: 5.578348 -- f: 4.498243 -- phi: -2.786970 -- SNR: 10.143586
    98 -- C: 0.000000 -- A: 29.931288 -- f: 1.771961 -- phi: 2.914255 -- SNR: 9.384988
    99 -- C: 0.000000 -- A: 4.594815 -- f: 6.963052 -- phi: 1.341859 -- SNR: 10.364932
    
    # np.savetxt('test.out',np.array([offsets,frequencies,amplitudes,phases]).T)
    
    nu_, amp_ = LS_periodogram(times, residuals)
    fig,ax = plt.subplots(1,1,figsize=(6.6957,6.6957), num=3)
    
    #     ax.axvline(freq, linestyle='--',color='red',alpha=0.4)
    #     ax.axhline(amplitudes[ii], linestyle='--',color='red',alpha=0.4)
    
    ax.plot(nu, amp,'-',color='grey')
    ax.plot(nu_,amp_,'k-')
    ax.set_xlabel(r'$\nu\,\,{\rm [d^{-1}]}$',fontsize=18)
    ax.set_ylabel(r'${\rm Amplitude\,\,[ppm]}$',fontsize=18)
    ax.set_xlim(0., 4)
    ax.set_ylim(0., 3400)
    fig.tight_layout()
    
    <IPython.core.display.Javascript object>
    

    You might notice that we extracted 50significant frequenices, but that we were still at an SNR~10. We certainly could have continued, but for the sake of the example, let’s stop here.

    Clearly, there’s a lot of sifnificant signal left, but let’s see what we can do with what we’ve found.

    fig,ax = plt.subplots(1,1,figsize=(6.6957,6.6957), num=4)
    for ii, freq_ in enumerate(frequencies):
        ax.plot([1./freq_,1./freq_], [1, amplitudes[ii]], color='black')
    
    ax.set_yscale('log')
    ax.set_xlim(0.8,1.6)
    ax.set_ylabel(r'${\rm Amplitude~[ppm]}$',fontsize=14)
    ax.set_xlabel(r'${\rm Period~[d]}$',fontsize=14)
    
    
    <IPython.core.display.Javascript object>
    

    Text(0.5, 0, '${\\rm Period~[d]}$')
    

    According to asymptotic theory, we know that g-mode pulsations of constant ${(\ell, m)}$ and successive $n$ are expected to have an equidistant spacing in period.

    However, effects like rotation and the presence of a chemical gradient can perturb g modes from having a constant period spacing.

    %matplotlib notebook
    from ipywidgets import interact
    
    
    def sort_on_x(x,y):
        zipped = list(zip(x,y))
        zipped.sort(key=lambda x:x[0])
        x,y = list(zip(*zipped))
        return np.array(x), np.array(y)
    
    
    # plt.rcParams['backend'] = 'TkAgg'
    
    periods = 1./frequencies
    amplitudes_ = amplitudes[ ((periods>0.9) & (periods<1.7))]
    periods_ = periods[ ((periods>0.9) & (periods<1.7))]
    
    periods_, amplitudes_ = sort_on_x(periods_, amplitudes_)
    
    
    fig,axes = plt.subplots(2,1,figsize=(6.6957*1.4,6.6957*0.7), num=5)
    
    for ii, per in enumerate(periods_):
        axes[0].plot([per, per], [1., amplitudes_[ii]], color='black')
    
    axes[0].set_yscale('log')
    axes[0].set_xlim(0.9,1.6)
    axes[0].set_ylabel(r'${\rm Amplitude~[ppm]}$',fontsize=14)
    axes[0].set_xlabel(r'${\rm Period~[d]}$',fontsize=14)
    
    axes[1].set_xlabel(r'${\rm Period~[d]}$',fontsize=15)
    axes[1].set_ylabel(r'${\rm \Delta P~[s]}$',fontsize=15)
    
    fig.tight_layout()
    
    selected_periods, selected_amplitudes, delta_p, p_ = [], [], [], []
    
    def onclick(event):
    
        global selected_periods 
        global selected_amplitudes
        if (event.button == 1):
            x_ = event.xdata
            y_ = event.ydata 
            dists = np.sqrt( (x_ - periods_)**2 )
            idf = np.argmin( dists )
            selected_periods.append(periods_[idf])
            selected_amplitudes.append(amplitudes_[idf])
         
        if (event.button != 1):
            xd = event.xdata
            yd = event.ydata 
            dists = np.sqrt( (xd - selected_periods)**2 )
            idr = np.argmin( dists )
            del selected_periods[idr]
            del selected_amplitudes[idr]
        
        for ii, per in enumerate(periods_):
            axes[0].plot([per, per], [1., amplitudes_[ii]], color='black')
        
        for ii, sp in enumerate(selected_periods):
            axes[0].plot([sp, sp], [1, selected_amplitudes[ii]], 'r-')
    
        if len(selected_periods)>1:
            global delta_p
            delta_p = []
            axes[1].clear()
            for ii, pi in enumerate(sorted(selected_periods[1:])):
                delta_p.append( 86400. * (pi - sorted(selected_periods)[ii] ) )
            axes[1].plot( sorted(selected_periods)[:-1], delta_p, 'r-o')
            axes[1].set_xlim(0.9, 1.6)
        
        fig.canvas.draw_idle()
        
    # Create an hard reference to the callback not to be cleared by the garbage collector
    ka = fig.canvas.mpl_connect('button_press_event', onclick)
    
    <IPython.core.display.Javascript object>
    

    selected_periods
    
    [0.9816878216709778,
     1.007868564938503,
     1.0332144776741674,
     1.054176531583098,
     1.0731658069088497,
     1.094831732309381,
     1.1175096122864707,
     1.1399828631525313,
     1.158906645628251,
     1.175617436072121,
     1.1933455205783132]