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

Reduce rounding error in POD reader adjust clock drift #80

Closed
carloshorn opened this issue Aug 27, 2020 · 0 comments · Fixed by #84
Closed

Reduce rounding error in POD reader adjust clock drift #80

carloshorn opened this issue Aug 27, 2020 · 0 comments · Fixed by #84

Comments

@carloshorn
Copy link
Collaborator

The following lines introduce a larger rounding error than necessary:

pygac/pygac/pod_reader.py

Lines 436 to 437 in 5c59f2b

self.times = (self.utcs +
offsets.astype('timedelta64[s]')).astype(datetime.datetime)

Here, self.utcs is an array of type 'datetime64[ms]', and offset is an array of floating point numbers giving seconds, which requires a conversion to a time delta. However, the conversion to 'timedelta64[s]' strips of the fraction of seconds. In order to stay at the same precision level, the conversion to a time delta should be changed to (1000*offsets).astype('timedelta64[ms]').

This was referenced Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant