html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/4598#issuecomment-731743767,https://api.github.com/repos/pydata/xarray/issues/4598,731743767,MDEyOklzc3VlQ29tbWVudDczMTc0Mzc2Nw==,17162724,2020-11-22T12:54:18Z,2020-11-22T12:54:18Z,CONTRIBUTOR,"> Why not pandas.date_range Good point. Given the ""normal"" spacing of the data that makes sense. > The problematic variable in this dataset is ""tau"" Ah thanks for the digging into this for me.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748229907 https://github.com/pydata/xarray/issues/4598#issuecomment-731743161,https://api.github.com/repos/pydata/xarray/issues/4598,731743161,MDEyOklzc3VlQ29tbWVudDczMTc0MzE2MQ==,6628425,2020-11-22T12:49:53Z,2020-11-22T12:49:53Z,MEMBER,"I see, yeah, timezones with `cftime` are tricky. Why are you using `cftime_range` to populate the time variable though in this case? Why not `pandas.date_range`? The problematic variable in this dataset is `""tau""`. If we drop that variable the dates are automatically decoded to pandas-compatible times (perhaps that's not an option for you though): ``` In [1]: import xarray as xr In [2]: xr.open_dataset('https://tds.hycom.org/thredds/dodsC/GLBy0.08/latest', drop_variables=[""tau""]) Out[2]: Dimensions: (depth: 40, lat: 4251, lon: 4500, time: 101) Coordinates: * lat (lat) float64 -80.0 -79.96 -79.92 ... 89.92 89.96 90.0 * lon (lon) float64 0.0 0.07996 0.16 0.24 ... 359.8 359.8 359.9 * depth (depth) float64 0.0 2.0 4.0 6.0 ... 3e+03 4e+03 5e+03 * time (time) datetime64[ns] 2020-11-16T12:00:00 ... 2020-11-29 time_run (time) datetime64[ns] ... Data variables: time_offset (time) datetime64[ns] ... surf_el (time, lat, lon) float32 ... water_u (time, depth, lat, lon) float32 ... water_u_bottom (time, lat, lon) float32 ... water_v (time, depth, lat, lon) float32 ... water_v_bottom (time, lat, lon) float32 ... water_temp (time, depth, lat, lon) float32 ... water_temp_bottom (time, lat, lon) float32 ... salinity (time, depth, lat, lon) float32 ... salinity_bottom (time, lat, lon) float32 ... Attributes: classification_level: UNCLASSIFIED distribution_statement: Approved for public release. Distribution unli... downgrade_date: not applicable classification_authority: not applicable institution: Fleet Numerical Meteorology and Oceanography C... source: HYCOM archive file history: archv2ncdf2d ;\nFMRC Best Dataset comment: p-grid field_type: instantaneous Conventions: CF-1.4, NAVO_netcdf_v1.1 _CoordSysBuilder: ucar.nc2.dataset.conv.CF1Convention cdm_data_type: GRID featureType: GRID location: Proto fmrc:GLBy0.08_930_FMRC ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748229907 https://github.com/pydata/xarray/issues/4598#issuecomment-731741542,https://api.github.com/repos/pydata/xarray/issues/4598,731741542,MDEyOklzc3VlQ29tbWVudDczMTc0MTU0Mg==,17162724,2020-11-22T12:37:15Z,2020-11-22T12:37:15Z,CONTRIBUTOR,"> Which functionality are you looking for in xarray that pandas Timestamp objects provide, but cftime objects do not? https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.tz_localize.html For a bit more reference. I'm working with HyCOM data and want to keep track of 'local time'. ``` ds = xr.open_dataset('https://tds.hycom.org/thredds/dodsC/GLBy0.08/latest', decode_times=False) reference_date = ds.time.attrs['units'][12:25] ds['time'] = xr.cftime_range(start=reference_date, periods=len(ds.time), freq='3H') ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748229907 https://github.com/pydata/xarray/issues/4598#issuecomment-731740688,https://api.github.com/repos/pydata/xarray/issues/4598,731740688,MDEyOklzc3VlQ29tbWVudDczMTc0MDY4OA==,6628425,2020-11-22T12:30:37Z,2020-11-22T12:30:37Z,MEMBER,"We do not have anything in xarray that works for `cftime` scalars currently, but we do have a `to_datetimeindex` method on `CFTimeIndex`: ``` In [1]: import xarray as xr In [2]: times = xr.cftime_range(""2000"", periods=2) In [3]: times.to_datetimeindex() Out[3]: DatetimeIndex(['2000-01-01', '2000-01-02'], dtype='datetime64[ns]', freq=None) ``` Which functionality are you looking for in xarray that pandas `Timestamp` objects provide, but `cftime` objects do not?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,748229907