Lv3_orbitephem_visual.py
def ephemeris(x,y,yerr,eventfile,T0,Porb,nbins):
    """
    Plotting the light curve (usually), along with the ephemeris visually
    """

    ##### Figure 1 shows the folded profile ; using stingray.pulse.par's fold_events
    phase,prof,prof_err = folding(eventfile,Porb,nbins)

    ##### Figure 2 will superpose the light curve and the ephemeris
    plt.figure()
    plt.errorbar(x,y,yerr=yerr,color='r',fmt='x')
    plt.xlabel('Time (MJD)',fontsize=12)
    plt.ylim([np.min(y),1.1*np.max(y)])
    plt.ylabel('Rate (counts/s)',fontsize=12)

    intervals = np.arange(T0,x[-1]+Porb/86400,Porb/86400) #defining EACH orbital cycle, starting with T0
    for i in range(0,len(intervals)-1):
        subintervals = np.linspace(intervals[i],intervals[i+1],nbins+1)
        plt.axvline(x=intervals[i],color='k')
        plt.axvline(x=intervals[i+1],color='k')
        plt.errorbar(subintervals,prof[:nbins+1]*(0.5*np.max(y)/np.mean(prof)),yerr=prof_err[:nbins+1]*(0.5*np.max(y)/np.mean(prof)),color='b',drawstyle='steps-mid',alpha=0.5)

        for j in range(len(subintervals)):
            plt.axvline(x=subintervals[j],alpha=0.5,lw=0.5,color='k')

    plt.show()

    Plotting the light curve (usually), along with the ephemeris visually
    
Plotting the light curve (usually), along with the ephemeris visually
Plotting the light curve ( usually ) along with the ephemeris visually
def ephemeris(x,y,yerr,eventfile,T0,Porb,nbins):
    phase,prof,prof_err = folding(eventfile,Porb,nbins)
    plt.figure()
    plt.errorbar(x,y,yerr=yerr,color='r',fmt='x')
    plt.xlabel('Time (MJD)',fontsize=12)
    plt.ylim([np.min(y),1.1*np.max(y)])
    plt.ylabel('Rate (counts/s)',fontsize=12)
    intervals = np.arange(T0,x[-1]+Porb/86400,Porb/86400) 
    for i in range(0,len(intervals)-1):
        subintervals = np.linspace(intervals[i],intervals[i+1],nbins+1)
        plt.axvline(x=intervals[i],color='k')
        plt.axvline(x=intervals[i+1],color='k')
        plt.errorbar(subintervals,prof[:nbins+1]*(0.5*np.max(y)/np.mean(prof)),yerr=prof_err[:nbins+1]*(0.5*np.max(y)/np.mean(prof)),color='b',drawstyle='steps-mid',alpha=0.5)
        for j in range(len(subintervals)):
            plt.axvline(x=subintervals[j],alpha=0.5,lw=0.5,color='k')
    plt.show()
def ephemeris ( x , y , yerr , eventfile , T0 , Porb , nbins ) : phase , prof , prof_err = folding ( eventfile , Porb , nbins ) plt . figure ( ) plt . errorbar ( x , y , yerr = yerr , color = 'r' , fmt = 'x' ) plt . xlabel ( 'Time (MJD)' , fontsize = 12 ) plt . ylim ( [ np . min ( y ) , 1.1 * np . max ( y ) ] ) plt . ylabel ( 'Rate (counts/s)' , fontsize = 12 ) intervals = np . arange ( T0 , x [ - 1 ] + Porb / 86400 , Porb / 86400 ) for i in range ( 0 , len ( intervals ) - 1 ) : subintervals = np . linspace ( intervals [ i ] , intervals [ i + 1 ] , nbins + 1 ) plt . axvline ( x = intervals [ i ] , color = 'k' ) plt . axvline ( x = intervals [ i + 1 ] , color = 'k' ) plt . errorbar ( subintervals , prof [ : nbins + 1 ] * ( 0.5 * np . max ( y ) / np . mean ( prof ) ) , yerr = prof_err [ : nbins + 1 ] * ( 0.5 * np . max ( y ) / np . mean ( prof ) ) , color = 'b' , drawstyle = 'steps-mid' , alpha = 0.5 ) for j in range ( len ( subintervals ) ) : plt . axvline ( x = subintervals [ j ] , alpha = 0.5 , lw = 0.5 , color = 'k' ) plt . show ( )
Plotting the light curve (usually), along with the ephemeris visually
Plotting the light curve ( usually ) along with the ephemeris visually
"""
    Plotting the light curve (usually), along with the ephemeris visually
    """ ##### Figure 1 shows the folded profile ; using stingray.pulse.par's fold_events ##### Figure 2 will superpose the light curve and the ephemeris #defining EACH orbital cycle, starting with T0
x
y
yerr
eventfile
T0
Porb
nbins