Lv3_calc_deadtime.py
def deadtime(obsid,mpu_no,par_list):
    """
    Calculate the accumulated deadtime for a given observation ID

    obsid - Observation ID of the object of interest (10-digit str)
    mpu_no - Will be '7' for the combined file
    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_ufa.get_ufa(obsid,mpu_no,par_list) #Use ufa, to include all events that could
    #contribute to the deadtime; both the good events included in the pulse profile and the non-source
    #events filtered out of the profile
    times = datadict['TIME']
    deadtimes = datadict['DEADTIME']
    gtis = Lv1_data_gtis.raw_ufa_gtis(obsid,mpu_no)
    obs_deadtime = 0
    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
        deadtime_interval = sum(deadtimes[(times>=gti_lowerbound)&(times<=gti_upperbound)])
        count += len(times[(times>=gti_lowerbound)&(times<=gti_upperbound)])
        obs_deadtime += deadtime_interval
        gti_exposure += gti_upperbound-gti_lowerbound

    return obs_deadtime

    Calculate the accumulated deadtime for a given observation ID

    obsid - Observation ID of the object of interest (10-digit str)
    mpu_no - Will be '7' for the combined file
    par_list - A list of parameters we'd like to extract from the FITS file
    (e.g., from eventcl, PI_FAST, TIME, PI,)
    
Calculate the accumulated deadtime for a given observation ID
obsid - Observation ID of the object of interest (10-digit str)
mpu_no - Will be '7' for the combined file
par_list - A list of parameters we'd like to extract from the FITS file
Calculate the accumulated deadtime for a given observation ID obsid - Observation ID of the object of interest ( 10 - digit str ) mpu_no - Will be ' 7 ' for the combined file par_list - A list of parameters we ' d like to extract from the FITS file
def deadtime(obsid,mpu_no,par_list):
    datadict = Lv0_call_ufa.get_ufa(obsid,mpu_no,par_list) 
    times = datadict['TIME']
    deadtimes = datadict['DEADTIME']
    gtis = Lv1_data_gtis.raw_ufa_gtis(obsid,mpu_no)
    obs_deadtime = 0
    gti_exposure = 0
    count = 0
    for i in range(len(gtis)): 
        gti_lowerbound = gtis[i][0] 
        gti_upperbound = gtis[i][1] 
        deadtime_interval = sum(deadtimes[(times>=gti_lowerbound)&(times<=gti_upperbound)])
        count += len(times[(times>=gti_lowerbound)&(times<=gti_upperbound)])
        obs_deadtime += deadtime_interval
        gti_exposure += gti_upperbound-gti_lowerbound
    return obs_deadtime
def deadtime ( obsid , mpu_no , par_list ) : datadict = Lv0_call_ufa . get_ufa ( obsid , mpu_no , par_list ) times = datadict [ 'TIME' ] deadtimes = datadict [ 'DEADTIME' ] gtis = Lv1_data_gtis . raw_ufa_gtis ( obsid , mpu_no ) obs_deadtime = 0 gti_exposure = 0 count = 0 for i in range ( len ( gtis ) ) : gti_lowerbound = gtis [ i ] [ 0 ] gti_upperbound = gtis [ i ] [ 1 ] deadtime_interval = sum ( deadtimes [ ( times >= gti_lowerbound ) & ( times <= gti_upperbound ) ] ) count += len ( times [ ( times >= gti_lowerbound ) & ( times <= gti_upperbound ) ] ) obs_deadtime += deadtime_interval gti_exposure += gti_upperbound - gti_lowerbound return obs_deadtime
Calculate the accumulated deadtime for a given observation ID
obsid - Observation ID of the object of interest (10-digit str)
mpu_no - Will be '7' for the combined file
par_list - A list of parameters we'd like to extract from the FITS file
(e.g., from eventcl, PI_FAST, TIME, PI,)
Calculate the accumulated deadtime for a given observation ID obsid - Observation ID of the object of interest ( 10 - digit str ) mpu_no - Will be ' 7 ' for the combined file par_list - A list of parameters we ' d like to extract from the FITS file ( e . g . from eventcl PI_FAST TIME PI )
"""
    Calculate the accumulated deadtime for a given observation ID

    obsid - Observation ID of the object of interest (10-digit str)
    mpu_no - Will be '7' for the combined file
    par_list - A list of parameters we'd like to extract from the FITS file
    (e.g., from eventcl, PI_FAST, TIME, PI,)
    """ #Use ufa, to include all events that could #contribute to the deadtime; both the good events included in the pulse profile and the non-source #events filtered out of the profile #for each GTI interval #the lower bound of the current GTI interval #the upper bound of the current GTI interval
obsid
mpu_no
par_list