NOAA-ORR-ERD / gridded

A single API for accessing / working with gridded model results on multiple grid types
https://noaa-orr-erd.github.io/gridded/index.html
The Unlicense
64 stars 14 forks source link

mutiple files with different time "Units" #63

Open ChrisBarker-NOAA opened 3 years ago

ChrisBarker-NOAA commented 3 years ago

If you try to use multipel files (netCDF4.MFDataset), they maybe have different time units, such as:

"hours since 2009-1-1 00:00:00" and "hours since 2009-1-2 00:00:00"

This is not SO rare, as some software uses the first time as the ephoc when writting a file.

It turns out that netCDF4 provides:

netCDF4.MFTime(time, units=None, calendar=None)
Docstring:     
Class providing an interface to a MFDataset time Variable by imposing a unique common
time unit and/or calendar to all files.

So we could use that in gridded to address ths issue.