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

Merged
merged 5 commits into from
Nov 21, 2024
Merged

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 and in vgac files.

@coveralls
Copy link

coveralls commented Oct 17, 2024

Pull Request Test Coverage Report for Build 11954413519

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 80.297%

Totals Coverage Status
Change from base Build 11367953830: 0.02%
Covered Lines: 1618
Relevant Lines: 1975

💛 - Coveralls

@ninahakansson
Copy link
Collaborator

ninahakansson commented Nov 21, 2024

I tried to add the line:
scn_["scanline_timestamps"].data = scn_["scanline_timestamps"].data.astype('datetime64[ms]'),
just before saving to dataset and then i got milliseconds while still having datatype as int64.
Still some warnings though.

UserWarning: Converting non-nanosecond precision datetime values to nanosecond precision. This behavior can eventually be relaxed in xarray, as it is an artifact from pandas which is now beginning to support non-nanosecond precision values. This warning is caused by passing non-nanosecond np.datetime64 or np.timedelta64 values to the DataArray or Variable constructor; it can be silenced by converting the values to nanosecond precision ahead of time.

@BengtRydberg
Copy link
Contributor Author

I tried to add the line: scn_["scanline_timestamps"].data = scn_["scanline_timestamps"].data.astype('datetime64[ms]'), just before saving to dataset and then i got milliseconds while still having datatype as int64. Still some warnings though.

UserWarning: Converting non-nanosecond precision datetime values to nanosecond precision. This behavior can eventually be relaxed in xarray, as it is an artifact from pandas which is now beginning to support non-nanosecond precision values. This warning is caused by passing non-nanosecond np.datetime64 or np.timedelta64 values to the DataArray or Variable constructor; it can be silenced by converting the values to nanosecond precision ahead of time.

I verified that your suggestion seems to work. A bit odd why it works, but I added the casting to datetime64/ms and a test for it. Seems like the remaining warnings come from satpy.

@ninahakansson ninahakansson merged commit deed643 into foua-pps:main Nov 21, 2024
8 checks passed
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.

3 participants