test_timing.py
def fit_to_linear(eventfile,f_pulse,shift,T0):
    """
    Fitting the phases to a linear phase model

    eventfile - path to the event file.
    f_pulse - the frequency of the pulse
    shift - how much to shift the pulse by in the phase axis.
    T0 - some reference T0 time
    """
    raw_times = fits.open(eventfile)[1].data['TIME']
    times = raw_times - raw_times[0]

    phases = get_phases(eventfile,f_pulse,shift)
    popt,pcov = curve_fit(linear_f,times,phases,p0=[shift,f_pulse,T0],bounds=([0.3,0.2085,40],[0.5,0.2095,60]))

    return popt,np.sqrt(np.diag(pcov))

    Fitting the phases to a linear phase model

    eventfile - path to the event file.
    f_pulse - the frequency of the pulse
    shift - how much to shift the pulse by in the phase axis.
    T0 - some reference T0 time
    
Fitting the phases to a linear phase model
eventfile - path to the event file.
f_pulse - the frequency of the pulse
shift - how much to shift the pulse by in the phase axis.
T0 - some reference T0 time
Fitting the phases to a linear phase model eventfile - path to the event file . f_pulse - the frequency of the pulse shift - how much to shift the pulse by in the phase axis . T0 - some reference T0 time
def fit_to_linear(eventfile,f_pulse,shift,T0):
    raw_times = fits.open(eventfile)[1].data['TIME']
    times = raw_times - raw_times[0]
    phases = get_phases(eventfile,f_pulse,shift)
    popt,pcov = curve_fit(linear_f,times,phases,p0=[shift,f_pulse,T0],bounds=([0.3,0.2085,40],[0.5,0.2095,60]))
    return popt,np.sqrt(np.diag(pcov))
def fit_to_linear ( eventfile , f_pulse , shift , T0 ) : raw_times = fits . open ( eventfile ) [ 1 ] . data [ 'TIME' ] times = raw_times - raw_times [ 0 ] phases = get_phases ( eventfile , f_pulse , shift ) popt , pcov = curve_fit ( linear_f , times , phases , p0 = [ shift , f_pulse , T0 ] , bounds = ( [ 0.3 , 0.2085 , 40 ] , [ 0.5 , 0.2095 , 60 ] ) ) return popt , np . sqrt ( np . diag ( pcov ) )
Fitting the phases to a linear phase model
eventfile - path to the event file.
Fitting the phases to a linear phase model eventfile - path to the event file .
"""
    Fitting the phases to a linear phase model

    eventfile - path to the event file.
    f_pulse - the frequency of the pulse
    shift - how much to shift the pulse by in the phase axis.
    T0 - some reference T0 time
    """
eventfile
f_pulse
shift
T0