def selecttime(time):
    
    """Returns the beginning and end time of the observation as well as the offset"""
    
    num = len(time) # length of the time array
    begt, endt = [time[0], time[num-1]] # defines the beginning and end time of the observation
    offset = time-time[0] # finds the offset of the observation and defines the times of the observation from this (i.e start from
    # 0 - begining of observation - and finished on the final elpased time of the Chandra observations).
  
    return begt, endt, offset