Skip to content

Commit 3286cd5

Browse files
committed
Fix UTC offset calc VFPA 2nd Narrow HADCP dataset
This addresses a breaking change in xarray=0.15.1 (see pydata/xarray#3862).
1 parent e0f04b1 commit 3286cd5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

nowcast/workers/get_vfpa_hadcp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323
"""
2424
import logging
2525
import os
26-
27-
import numpy
28-
import pandas
2926
from pathlib import Path
3027

3128
import arrow
29+
import numpy
30+
import pandas
3231
import xarray
3332
from moad_tools.places import PLACES
3433
from nemo_nowcast import NowcastWorker
@@ -170,7 +169,7 @@ def _make_hour_dataset(csv_dir, utc_start_hr, place):
170169
)
171170
ds = _csv_to_dataset(csv_dir / csv_filename, place)
172171
logger.debug("transformed csv data into xarray.Dataset")
173-
ds["time"] -= pandas.to_timedelta(utc_offset)
172+
ds.assign_coords(time=ds["time"] - pandas.to_timedelta(utc_offset))
174173
ds["time"].attrs["cf_role"] = "timeseries_id"
175174
ds["time"].attrs["comment"] = "time values are UTC"
176175
ds.coords["longitude"], ds.coords["latitude"] = place["lon lat"]

0 commit comments

Comments
 (0)