Check if mu is zero in OsculatingElements.__init__() (#259)
Raises a ValueError instead of having a mysterious numpy divide by zero warning later on Be more specific and address the case of negative mu_km_s
This commit is contained in:
parent
29022d041b
commit
e80df46a59
|
@ -53,6 +53,10 @@ class OsculatingElements(object):
|
|||
|
||||
"""
|
||||
def __init__(self, position, velocity, time, mu_km_s):
|
||||
if mu_km_s <= 0:
|
||||
raise ValueError('`mu_km_s` (the standard gravitational parameter '
|
||||
'in km^3/s^2) must be positive and non-zero')
|
||||
|
||||
self._pos_vec = position.km
|
||||
self._vel_vec = velocity.km_per_s
|
||||
self.time = time
|
||||
|
|
Loading…
Reference in New Issue