Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is check_sgp4 used? #207

Open
hornig opened this issue Oct 13, 2020 · 2 comments
Open

Where is check_sgp4 used? #207

hornig opened this issue Oct 13, 2020 · 2 comments

Comments

@hornig
Copy link
Collaborator

hornig commented Oct 13, 2020

import sys
import os.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
from sgp4.earth_gravity import wgs72
from sgp4.io import twoline2rv
from kep_determination.sgp4 import *
def update_epoch(yr, mth, day, hr, mts, sec):
'''
Adds one second to the given time.
Args:
self: class variables
yr: year
mth: month
day: date
hr: hour
mts: minutes
sec: seconds
Returns:
updated timestamp epoch in a tuple with value as (year, month, day,
hour, minute, second)
'''
sec += 1
if(sec >= 60):
sec = 0
mts += 1
if(mts >= 60):
mts = 0
hr += 1
if(hr >= 24):
hr = 0
day += 1
daysInMonth = np.array([31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31])
if(yr % 4 == 0):
daysInMonth[1] = 29
if(day > daysInMonth[mth-1]):
day = 1
mth += 1
if(mth > 12):
mth = 1
yr += 1
return yr, mth, day, hr, mts, sec
if __name__ == "__main__":
line1 = "1 88888U 80275.98708465 .00073094 13844-3 66816-4 0 8"
line2 = "2 88888 72.8435 115.9689 0086731 52.6988 110.5714 16.05824518 105"
s = twoline2rv(line1,line2,wgs72)
i = 0
yr,mth,day,hr,mts,sec = 2018,7,21,19,28,41
while(i < 1):
pos,vel = s.propagate(yr,mth,day,hr,mts,sec)
data = [pos[0], pos[1], pos[2], vel[0], vel[1], vel[2]]
data = [float("{0:.5f}".format(i)) for i in data]
print(str(i) + " - " + str(hr) + ":" + str(mts) + ":" + str(sec) + " - " + str(data))
yr, mth, day, hr, mts, sec = update_epoch(yr, mth, day, hr, mts, sec)
i = i + 1

I could not find it. at least to test .py used it (or I oversaw it). And it is not its own test. because pytest is not included and the filename does not have correct "test_" start or "test" ending.

@micksharma
Copy link

Hi @hornig ,
I want to work on this issue ?

@hornig
Copy link
Collaborator Author

hornig commented Mar 25, 2021

Hi @hornig ,
I want to work on this issue ?

yes, everyone can. just do it and if you have a solution commit a Pull-Request.
no need to ask here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants