本文整理匯總了Python中pycbc.types.array.Array._getslice方法的典型用法代碼示例。如果您正苦於以下問題:Python Array._getslice方法的具體用法?Python Array._getslice怎麽用?Python Array._getslice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pycbc.types.array.Array
的用法示例。
在下文中一共展示了Array._getslice方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _getslice
# 需要導入模塊: from pycbc.types.array import Array [as 別名]
# 或者: from pycbc.types.array.Array import _getslice [as 別名]
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)
示例2: _getslice
# 需要導入模塊: from pycbc.types.array import Array [as 別名]
# 或者: from pycbc.types.array.Array import _getslice [as 別名]
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)