Skip to content

Commit

Permalink
Fix UTC offset calc VFPA 2nd Narrow HADCP dataset
Browse files Browse the repository at this point in the history
This addresses a breaking change in xarray=0.15.1
(see pydata/xarray#3862).
  • Loading branch information
douglatornell committed Jul 9, 2020
1 parent e0f04b1 commit 3286cd5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions nowcast/workers/get_vfpa_hadcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
"""
import logging
import os

import numpy
import pandas
from pathlib import Path

import arrow
import numpy
import pandas
import xarray
from moad_tools.places import PLACES
from nemo_nowcast import NowcastWorker
Expand Down Expand Up @@ -170,7 +169,7 @@ def _make_hour_dataset(csv_dir, utc_start_hr, place):
)
ds = _csv_to_dataset(csv_dir / csv_filename, place)
logger.debug("transformed csv data into xarray.Dataset")
ds["time"] -= pandas.to_timedelta(utc_offset)
ds.assign_coords(time=ds["time"] - pandas.to_timedelta(utc_offset))
ds["time"].attrs["cf_role"] = "timeseries_id"
ds["time"].attrs["comment"] = "time values are UTC"
ds.coords["longitude"], ds.coords["latitude"] = place["lon lat"]
Expand Down

0 comments on commit 3286cd5

Please sign in to comment.