geospace-code / pymap3d

pure-Python (Numpy optional) 3D coordinate conversions for geospace ecef enu eci
https://geospace-code.github.io/pymap3d
BSD 2-Clause "Simplified" License
391 stars 85 forks source link

[Bug]: ECI conversions give wrong result for sub-second dates (juliandate issue) #84

Closed Pokornz closed 11 months ago

Pokornz commented 1 year ago

What happened?

When trying to convert to/from ECI coordinates with dates that don't have whole seconds (i.e. milliseconds are not zero), the sub-second information is ignored in the Julian date conversion: https://github.com/geospace-code/pymap3d/blob/main/src/pymap3d/sidereal.py#L87 When used to for ex. convert satellite trajectories, the resulting trajectory has stair-like shape. image

Relevant log output

No response

Pokornz commented 1 year ago

It can be pretty much fixed by adding the microseconds C = (((time.second + time.microsecond / 1e6) / 60.0 + time.minute) / 60.0 + time.hour) / 24.0 image

Pokornz commented 1 year ago

I accidentally closed the issue. I have now submitted a pull request. It is my first time contributing to a code base, so any feedback is welcome. @scivision does this change brake anything/ is there a reason why sub-second information is not used?

scivision commented 11 months ago

fixed by #85