def set_start_interval(self, I0):
"""Set starting *squared* velocities interval.
Parameters
----------
I0: array, or float
(2, 0) array, the interval of starting squared path velocities.
Can also be a float.
Raises
------
AssertionError
If `I0` is a single, negative float. Or if `I0[0] > I0[1]`.
"""
I0 = np.r_[I0].astype(float)
if I0.shape[0] == 1:
I0 = np.array([I0[0], I0[0]])
elif I0.shape[0] > 2:
raise ValueError('Input I0 has wrong dimension: {}'.format(I0.shape))
assert I0[1] >= I0[0], "Illegal input: non-increase end-points."
assert I0[0] >= 0, "Illegal input: negative lower end-point."
self.I0 = I0
评论列表
文章目录