diff --git a/tests/test_postprocess.py b/tests/test_postprocess.py index 53ebac56..4cfb5064 100644 --- a/tests/test_postprocess.py +++ b/tests/test_postprocess.py @@ -111,7 +111,7 @@ def test_decode_times(times): @pytest.mark.parametrize( 'sample_dataset_with_kwargs,xtime_dtype', [ - (('mercator', {'decode_times': True}), np.timedelta64), + (('mercator', {'decode_times': True}), np.datetime64), (('mercator', {'decode_times': False}), np.float32), ], indirect=['sample_dataset_with_kwargs'], diff --git a/xwrf/postprocess.py b/xwrf/postprocess.py index a92a74c0..2d7ccf25 100644 --- a/xwrf/postprocess.py +++ b/xwrf/postprocess.py @@ -2,7 +2,6 @@ import warnings -import numpy as np import pandas as pd import xarray as xr @@ -25,14 +24,6 @@ def _decode_times(ds: xr.Dataset) -> xr.Dataset: ) ds = ds.assign_coords({'Time': _time}) ds.Time.attrs = {'long_name': 'Time', 'standard_name': 'time'} - # make XTIME be consistent with its description - if 'XTIME' in ds.variables and np.issubdtype(ds.XTIME.dtype, np.datetime64): - ds['XTIME'].data = ( - ds.XTIME.data - - pd.to_datetime( - ds['XTIME'].description, format='minutes since %Y-%m-%d %H:%M:%S' - ).to_datetime64() - ) return ds