Skip to content
Snippets Groups Projects
Commit 662477c2 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Center hours at midnight

parent f57ecf9a
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ import logging
from logging.config import dictConfig
# externals
import numpy as np
import xarray as xr
# locals
......@@ -83,6 +84,10 @@ if __name__ == '__main__':
# rename temporal dimension: from DATE to time
ds = ds.rename({'DATE': 'time'})
# center hours at 00:00:00 rather than 12:00:00
ds['time'] = np.asarray([t.astype('datetime64[D]') for t in
ds.time.values])
# set NetCDF file compression for each variable
for _, var in ds.data_vars.items():
var.encoding['zlib'] = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment