(ANSWERED) Convert epochyr and epoch days to the epoch param for sgp4init #640
-
Hello, I am trying to determine how the Satrec fields epochyr and epochdays are converted from epoch ("days since 1949 December 31 00:00 UT") and how to do it backwards. I am using: epoch = ((2000 + old_satrec.epochyr) * 365 + old_satrec.epochdays) - ((1949 * 365) + 1) But I think this has a lot of mistakes as at least it does not take into account leap years. I know this is a well known function (computing days between dates) but is there a simple solution in the Skyfield world? I am new to it but I did search the forums with no luck. And I could look at the source of sg4init but .... (FYI the ultimate goal is to duplicate a Satrec while changing the RAAN. Duplicate because Satrec objects cannot be modified). Jose Rodriguez |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'd recommend using |
Beta Was this translation helpful? Give feedback.
I'd recommend using
jdsatepoch
andjdsatepochF
instead, which added together produce a simple Julian date. By subtracting the JD of 1949 December 31, I think you’ll get the number you want.