Lv2_color.py
def hard_counts(E_bound,pi_data):
    """
    Will get an array of PI values from the data, where each entry = 1 count.
    So construct an array of ones of equal length, then where E < E_bound, set to 0.
    This will give an array where 0 = harder X-rays, 1 = softer X-rays, so when
    doing the binning, will get just soft counts.

    E_bound - boundary energy considered (in keV)
    pi_data - array of PI values
    """
    if E_bound < 0 or E_bound > 20:
        raise ValueError("Your E_bound is <0 keV or >20keV - check your input!")
#    if len(times) != len(pi_data):
#        raise ValueError("The time array and PI array are of different lengths. Investigate!")

    counts = np.ones(len(pi_data))
    PI_bound = E_bound*1000/10 #get the cut-off in terms of PI; cutoff is in keV!
    #we do assume that there will be NO bins in which you get ZERO counts

    np.place(counts,pi_data<PI_bound,0) #get the counts for hard photons

    return counts

    Will get an array of PI values from the data, where each entry = 1 count.
    So construct an array of ones of equal length, then where E < E_bound, set to 0.
    This will give an array where 0 = harder X-rays, 1 = softer X-rays, so when
    doing the binning, will get just soft counts.

    E_bound - boundary energy considered (in keV)
    pi_data - array of PI values
    
Will get an array of PI values from the data, where each entry = 1 count.
So construct an array of ones of equal length, then where E < E_bound, set to 0.
This will give an array where 0 = harder X-rays, 1 = softer X-rays, so when
doing the binning, will get just soft counts.

boundary energy considered (in keV)
pi_data - array of PI values
Will get an array of PI values from the data where each entry = 1 count . So construct an array of ones of equal length then where E < E_bound set to 0 . This will give an array where 0 = harder X - rays 1 = softer X - rays so when doing the binning will get just soft counts . boundary energy considered ( in keV ) pi_data - array of PI values
def hard_counts(E_bound,pi_data):
    if E_bound < 0 or E_bound > 20:
        raise ValueError("Your E_bound is <0 keV or >20keV - check your input!")
    counts = np.ones(len(pi_data))
    PI_bound = E_bound*1000/10 
    np.place(counts,pi_data<PI_bound,0) 
    return counts
def hard_counts ( E_bound , pi_data ) : if E_bound < 0 or E_bound > 20 : raise ValueError ( "Your E_bound is <0 keV or >20keV - check your input!" ) counts = np . ones ( len ( pi_data ) ) PI_bound = E_bound * 1000 / 10 np . place ( counts , pi_data < PI_bound , 0 ) return counts
Will get an array of PI values from the data, where each entry = 1 count.
Will get an array of PI values from the data where each entry = 1 count .
"""
    Will get an array of PI values from the data, where each entry = 1 count.
    So construct an array of ones of equal length, then where E < E_bound, set to 0.
    This will give an array where 0 = harder X-rays, 1 = softer X-rays, so when
    doing the binning, will get just soft counts.

    E_bound - boundary energy considered (in keV)
    pi_data - array of PI values
    """ #    if len(times) != len(pi_data): #        raise ValueError("The time array and PI array are of different lengths. Investigate!") #get the cut-off in terms of PI; cutoff is in keV! #we do assume that there will be NO bins in which you get ZERO counts #get the counts for hard photons
E_bound
pi_data