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

Issue with reading data dated to 31 Mar from IAGA-2002 files (Mac OS) #103

Closed
teraita opened this issue May 20, 2021 · 5 comments
Closed

Comments

@teraita
Copy link
Contributor

teraita commented May 20, 2021

When reading the data to the 1min values there is issue with handling of the data of 31 March. The file is not read correctly between 03-05UT. When manipulating the date information in filename, and data row (detestr and doy) in IAGA-2002 format to respond 31 Jan the file works. Might be some issue with epoch/ stream lengths?

Problem sees to hit only to period 03-05UT:
SOD20190331_03-05UT

SOD20190331

Same data file, date information manipulated:
SOD20190131

When merging XYZ and F of the date and calculating deltaF the values are corrupted, so it this not only visualisation problem in MagPy.

Is this only Mac related issue?

Please, request data samples, if needed.

@leonro
Copy link
Collaborator

leonro commented Jun 21, 2021 via email

@teraita
Copy link
Contributor Author

teraita commented Jun 21, 2021 via email

@teraita
Copy link
Contributor Author

teraita commented Jun 21, 2021 via email

@leonro
Copy link
Collaborator

leonro commented Jun 22, 2021

Well.... something I dont really understand: I am testing for leap seconds within the method LeapSeconds of stream.py. I am using the following conversion which actually should work fine in order to get a datetime compatible output:

t = "2019-03-31T02:00:00"
ti = time.strptime(t, "%Y-%m-%dT%H:%M:%S")
tim = datetime.fromtimestamp(time.mktime(ti))

tim, however, then results in 2019-03-31T03:00:00 which is obviously wrong. Wrong results are apparently only obtained on March 31, 2019 between 2:00 and 3:00.

Workaround:
tim = datetime(*ti[:5]+(min(ti[5], 59),))

@leonro
Copy link
Collaborator

leonro commented Jun 22, 2021

The workaround does the job. Issue solved in commit: e6e5258

@leonro leonro closed this as completed Jun 22, 2021
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

No branches or pull requests

2 participants