Lv2_phase.py
def pulse_profile(f_pulse,times,counts,shift,no_phase_bins):
    """
    Calculating the pulse profile for the observation. Goes from 0 to 2!
    Thoughts on 1/14/2020: I wonder if the count rate is calculated from times[-1]-times[0]?
    If so, this is WRONG! I should be using the total from the GTIs!

    f_pulse - the frequency of the pulse
    times - the array of time values
    counts - the array of counts values
    shift - how much to shift the pulse by in the phase axis.
    It only affects how it is presented.
    no_phase_bins - number of phase bins desired
    """
    period = 1/f_pulse
    phases = foldAt(times,period,T0=shift*period)

    index_sort = np.argsort(phases)
    phases = list(phases[index_sort]) + list(phases[index_sort]+1)
    counts = list(counts[index_sort])*2

    phase_bins = np.linspace(0,2,no_phase_bins*2+1)
    summed_profile, bin_edges, binnumber = stats.binned_statistic(phases,counts,statistic='mean',bins=phase_bins)

    return phases, phase_bins, summed_profile

    Calculating the pulse profile for the observation. Goes from 0 to 2!
    Thoughts on 1/14/2020: I wonder if the count rate is calculated from times[-1]-times[0]?
    If so, this is WRONG! I should be using the total from the GTIs!

    f_pulse - the frequency of the pulse
    times - the array of time values
    counts - the array of counts values
    shift - how much to shift the pulse by in the phase axis.
    It only affects how it is presented.
    no_phase_bins - number of phase bins desired
    
Calculating the pulse profile for the observation. Goes from 0 to 2.
Thoughts on 1/14/2020: I wonder if the count rate is calculated from times[-1]-times[0].
If so, this is WRONG. I should be using the total from the GTIs!

the frequency of the pulse
times - the array of time values
counts - the array of counts values
shift - how much to shift the pulse by in the phase axis.
It only affects how it is presented.
no_phase_bins - number of phase bins desired
Calculating the pulse profile for the observation . Goes from 0 to 2 . Thoughts on 1 / 14 / 2020 : I wonder if the count rate is calculated from times [ - 1 ] - times [ 0 ] . If so this is WRONG . I should be using the total from the GTIs! the frequency of the pulse times - the array of time values counts - the array of counts values shift - how much to shift the pulse by in the phase axis . It only affects how it is presented . no_phase_bins - number of phase bins desired
def pulse_profile(f_pulse,times,counts,shift,no_phase_bins):
    period = 1/f_pulse
    phases = foldAt(times,period,T0=shift*period)
    index_sort = np.argsort(phases)
    phases = list(phases[index_sort]) + list(phases[index_sort]+1)
    counts = list(counts[index_sort])*2
    phase_bins = np.linspace(0,2,no_phase_bins*2+1)
    summed_profile, bin_edges, binnumber = stats.binned_statistic(phases,counts,statistic='mean',bins=phase_bins)
    return phases, phase_bins, summed_profile
def pulse_profile ( f_pulse , times , counts , shift , no_phase_bins ) : period = 1 / f_pulse phases = foldAt ( times , period , T0 = shift * period ) index_sort = np . argsort ( phases ) phases = list ( phases [ index_sort ] ) + list ( phases [ index_sort ] + 1 ) counts = list ( counts [ index_sort ] ) * 2 phase_bins = np . linspace ( 0 , 2 , no_phase_bins * 2 + 1 ) summed_profile , bin_edges , binnumber = stats . binned_statistic ( phases , counts , statistic = 'mean' , bins = phase_bins ) return phases , phase_bins , summed_profile
Calculating the pulse profile for the observation.
Calculating the pulse profile for the observation .
"""
    Calculating the pulse profile for the observation. Goes from 0 to 2!
    Thoughts on 1/14/2020: I wonder if the count rate is calculated from times[-1]-times[0]?
    If so, this is WRONG! I should be using the total from the GTIs!

    f_pulse - the frequency of the pulse
    times - the array of time values
    counts - the array of counts values
    shift - how much to shift the pulse by in the phase axis.
    It only affects how it is presented.
    no_phase_bins - number of phase bins desired
    """
f_pulse
times
counts
shift
no_phase_bins