'Get a time slice.
Parameters
item : array-like or slice
The slice of time points to use.
Returns
dip : instance of Dipole
The sliced dipole.'

def __getitem__(self, item):

    if isinstance(item, int):
        item = [item]
    selected_times = self.times[item].copy()
    selected_pos = self.pos[item, :].copy()
    selected_amplitude = self.amplitude[item].copy()
    selected_ori = self.ori[item, :].copy()
    selected_gof = self.gof[item].copy()
    selected_name = self.name
    selected_conf = dict()
    for key in self.conf.keys():
        selected_conf[key] = self.conf[key][item]
    selected_khi2 = (self.khi2[item] if (self.khi2 is not None) else None)
    selected_nfree = (self.nfree[item] if (self.nfree is not None) else None)
    return Dipole(selected_times, selected_pos, selected_amplitude, selected_ori, selected_gof, selected_name, selected_conf, selected_khi2, selected_nfree)
