Example #1
0
 def _getslice(self, index):
     if index.step is not None:
         new_delta_f = self._delta_f * index.step
     else:
         new_delta_f = self._delta_f
     return FrequencySeries(Array._getslice(self, index),
                            delta_f=new_delta_f,
                            epoch=self._epoch,
                            copy=False)
Example #2
0
 def _getslice(self, index):
     if index.step is not None:
         new_delta_f = self._delta_f * index.step
     else:
         new_delta_f = self._delta_f
     return FrequencySeries(Array._getslice(self, index),
                            delta_f=new_delta_f,
                            epoch=self._epoch,
                            copy=False)
Example #3
0
    def _getslice(self, index):
        # Set the new epoch---note that index.start may also be None
        if index.start is None:
            new_epoch = self._epoch
        else:
            if index.start < 0:
                raise ValueError(('Negative start index ({})'
                                  ' not supported').format(index.start))
            new_epoch = self._epoch + index.start * self._delta_t

        if index.step is not None:
            new_delta_t = self._delta_t * index.step
        else:
            new_delta_t = self._delta_t

        return TimeSeries(Array._getslice(self, index), new_delta_t,
                          new_epoch, copy=False)
Example #4
0
    def _getslice(self, index):
        # Set the new epoch---note that index.start may also be None
        if self._epoch is None:
            new_epoch = None
        elif index.start is None:
            new_epoch = self._epoch
        else:
            if index.start < 0:
                raise ValueError('Negative start index not supported')
            new_epoch = self._epoch + index.start * self._delta_t

        if index.step is not None:
            new_delta_t = self._delta_t * index.step
        else:
            new_delta_t = self._delta_t
        
        return TimeSeries(Array._getslice(self, index), new_delta_t,
                          new_epoch, copy=False)