def _calculate_file_offset_map(self):
    ifof = np.array([data_file.total_particles['FOF'] for data_file in self.data_files])
    isub = np.array([data_file.total_offset for data_file in self.data_files])
    subend = isub.cumsum()
    fofend = ifof.cumsum()
    istart = (np.digitize((fofend - ifof), (subend - isub)) - 1)
    iend = np.clip(np.digitize(fofend, subend), 0, (ifof.size - 2))
    for (i, data_file) in enumerate(self.data_files):
        data_file.offset_files = self.data_files[istart[i]:(iend[i] + 1)]
def _calculate_file_offset_map(self):
    ifof = np.array([data_file.total_particles['FOF'] for data_file in self.data_files])
    isub = np.array([data_file.total_offset for data_file in self.data_files])
    subend = isub.cumsum()
    fofend = ifof.cumsum()
    istart = (np.digitize((fofend - ifof), (subend - isub)) - 1)
    iend = np.clip(np.digitize(fofend, subend), 0, (ifof.size - 2))
    for (i, data_file) in enumerate(self.data_files):
        data_file.offset_files = self.data_files[istart[i]:(iend[i] + 1)]