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

accept int64 time coordinates and print time coordinate differences #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

garyjg
Copy link
Member

@garyjg garyjg commented Dec 24, 2024

These changes allow comparing hotfilm netcdf files with an int64 time coordinate and units "microseconds since ...". Since the units have always been assumed to be "seconds", this code now enforces that the units must start with either "seconds" or "microseconds", and then it sets the time step accordingly. I don't think this should break other uses of nc_compare, but it's the most likely potential impact.

Time coordinate differences can be printed with the new --showtimes option, where before there was only a summary of the number of unique times in each file.

basetime_from_units() could still be more robust about checking that the units string was correctly parsed, such as by checking the sscanf() and strptime() return values, but I'll leave it for someone else to decide if that should be a separate issue. I guess it hasn't been a problem so far...

The time coordinate units must start with seconds or microseconds to set the
timestep explicitly.  This is to support isfs hotfilm netcdf files.
use iterators instead of indexes to simplify time comparision loop and make it
consistent with reporting loop, which revealed a bug in the reporting loop.
add --showtimes option to report time coordinate differences, so previous
--showindex output does not change.  show right time coordinates with an
offset to make it easier to follow times in left and right files.
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.

1 participant