Skip to content

Commit 000a418

Browse files
authored
Merge pull request #12 from esa/kepler_equation
kepler equation
2 parents 152df44 + 6944691 commit 000a418

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

dsgp4/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '1.0.0'
1+
__version__ = '1.0.1'
22

33
import torch
44
torch.set_default_dtype(torch.float64)

dsgp4/sgp4.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ def sgp4(satellite, tsince):
130130
tem5 = (u - aynl * coseo1 + axnl * sineo1 - eo1) / tem5
131131
tem5=torch.where(tem5>=0.95, 0.95, tem5)
132132
tem5=torch.where(tem5<=-0.95, -0.95, tem5)
133+
#we need to break if abs value of tem5 is less than 1e-12:
133134
eo1 = eo1 + tem5
135+
if torch.all(torch.abs(tem5) < 1e-12):
136+
break
134137

135138
# short period preliminary quantities
136139
ecose = axnl*coseo1 + aynl*sineo1

dsgp4/sgp4_batched.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def sgp4_batched(satellite_batch, tsince):
139139
tem5=torch.where(tem5>=0.95, 0.95, tem5)
140140
tem5=torch.where(tem5<=-0.95, -0.95, tem5)
141141
eo1 = eo1 + tem5
142+
if torch.all(torch.abs(tem5) < 1e-12):
143+
break
142144

143145
# short period preliminary quantities
144146
ecose = axnl*coseo1 + aynl*sineo1

0 commit comments

Comments
 (0)