Lv3_calc_deadtime.py
def exposure(obsid,bary,par_list):
    """
    Get the on-source, exposure time

    obsid - Observation ID of the object of interest (10-digit str)
    bary - Whether the data is barycentered. True/False
    par_list - A list of parameters we'd like to extract from the FITS file
    (e.g., from eventcl, PI_FAST, TIME, PI,)
    """
    datadict = Lv0_call_eventcl.get_eventcl(obsid,bary,par_list)
    times = datadict['TIME']
    gtis = Lv1_data_gtis.raw_gtis(obsid,bary)
    gti_exposure = 0
    count = 0
    for i in range(len(gtis)): #for each GTI interval
        gti_lowerbound = gtis[i][0] #the lower bound of the current GTI interval
        gti_upperbound = gtis[i][1] #the upper bound of the current GTI interval
        count += len(times[(times>=gti_lowerbound)&(times<=gti_upperbound)])
        gti_exposure += (gti_upperbound-gti_lowerbound)

    return count,gti_exposure

    Get the on-source, exposure time

    obsid - Observation ID of the object of interest (10-digit str)
    bary - Whether the data is barycentered. True/False
    par_list - A list of parameters we'd like to extract from the FITS file
    (e.g., from eventcl, PI_FAST, TIME, PI,)
    
Get the on-source, exposure time
obsid - Observation ID of the object of interest (10-digit str)
bary - Whether the data is barycentered. True/False
par_list - A list of parameters we'd like to extract from the FITS file
Get the on - source exposure time obsid - Observation ID of the object of interest ( 10 - digit str ) bary - Whether the data is barycentered . True / False par_list - A list of parameters we ' d like to extract from the FITS file
def exposure(obsid,bary,par_list):
    datadict = Lv0_call_eventcl.get_eventcl(obsid,bary,par_list)
    times = datadict['TIME']
    gtis = Lv1_data_gtis.raw_gtis(obsid,bary)
    gti_exposure = 0
    count = 0
    for i in range(len(gtis)): 
        gti_lowerbound = gtis[i][0] 
        gti_upperbound = gtis[i][1] 
        count += len(times[(times>=gti_lowerbound)&(times<=gti_upperbound)])
        gti_exposure += (gti_upperbound-gti_lowerbound)
    return count,gti_exposure
def exposure ( obsid , bary , par_list ) : datadict = Lv0_call_eventcl . get_eventcl ( obsid , bary , par_list ) times = datadict [ 'TIME' ] gtis = Lv1_data_gtis . raw_gtis ( obsid , bary ) gti_exposure = 0 count = 0 for i in range ( len ( gtis ) ) : gti_lowerbound = gtis [ i ] [ 0 ] gti_upperbound = gtis [ i ] [ 1 ] count += len ( times [ ( times >= gti_lowerbound ) & ( times <= gti_upperbound ) ] ) gti_exposure += ( gti_upperbound - gti_lowerbound ) return count , gti_exposure
Get the on-source, exposure time
obsid - Observation ID of the object of interest (10-digit str)
bary - Whether the data is barycentered.
Get the on - source exposure time obsid - Observation ID of the object of interest ( 10 - digit str ) bary - Whether the data is barycentered .
"""
    Get the on-source, exposure time

    obsid - Observation ID of the object of interest (10-digit str)
    bary - Whether the data is barycentered. True/False
    par_list - A list of parameters we'd like to extract from the FITS file
    (e.g., from eventcl, PI_FAST, TIME, PI,)
    """ #for each GTI interval #the lower bound of the current GTI interval #the upper bound of the current GTI interval
obsid
bary
par_list