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

vgac time units #96

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BengtRydberg
Copy link
Contributor

@BengtRydberg BengtRydberg commented Oct 17, 2024

This PR deals with #93
and makes that time unit is milliseconds since 1970-01-01 in vgac and gac files,
by using a floating point datatype instead of int. Note also that that two time variables are present in these files:

  • time (unit like: days since 2018-11-01T10:42:08, and dtype: int64)
  • scanline_timestamps (unit: milliseconds since 1970-01-01, dtype: double)

Tis PR only modify the scanline_timestamps variable.

We still get a warning from satpy/writers/cf_writer.py, as you can see by checking the details of the test, or more exactly it comes from xarray. Xarray cast time variables to np.datetime64[ns] datatype. I guess the warnings comes from that it is not possible to serialize this to some other datatype / units without loosing precision. I understand this warning is useful if you really care about the the nano-second precision, but sine we do not do that I guess we can ignore the warning.

Anyhow, if I use "nanoseconds since 1970-01-01" as unit I get rid of the warnings, but whatever else I try result in warnings with "moment 22" suggestions for solutions.

Not clear to me if this PR actually closes the issue, since it modifies the datatype of the variable and we still get warnings,
but we at least get milliseconds since 1970-01-01 as unit.

@coveralls
Copy link

coveralls commented Oct 17, 2024

Pull Request Test Coverage Report for Build 11398124652

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 80.281%

Totals Coverage Status
Change from base Build 11367953830: 0.008%
Covered Lines: 1613
Relevant Lines: 1970

💛 - Coveralls

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 this pull request may close these issues.

2 participants