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/2265#issuecomment-402327882,https://api.github.com/repos/pydata/xarray/issues/2265,402327882,MDEyOklzc3VlQ29tbWVudDQwMjMyNzg4Mg==,4338975,2018-07-04T00:25:33Z,2018-07-04T00:25:33Z,NONE,@jhamman thanks I'll add to the discussion there and close this issue.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,337733183 https://github.com/pydata/xarray/issues/2265#issuecomment-402216978,https://api.github.com/repos/pydata/xarray/issues/2265,402216978,MDEyOklzc3VlQ29tbWVudDQwMjIxNjk3OA==,2443309,2018-07-03T16:30:06Z,2018-07-03T16:30:06Z,MEMBER,"> Is there a way of appending an xarray dataset onto an existing zarr array? @NickMortimer - No, not yet. It has been proposed already though in #2022. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,337733183 https://github.com/pydata/xarray/issues/2265#issuecomment-402155326,https://api.github.com/repos/pydata/xarray/issues/2265,402155326,MDEyOklzc3VlQ29tbWVudDQwMjE1NTMyNg==,4338975,2018-07-03T13:22:24Z,2018-07-03T13:24:04Z,NONE,"@spencerkclark yes that helps very much and a great example of how to answer a question! I'm learning so much from this group. Is there a way of appending an xarray dataset onto an existing zarr array? That's why I've been accessing direct through zarr, what I'm trying to do is build a zarr file of all the Argo float profiles and add new ones as they arrive.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,337733183 https://github.com/pydata/xarray/issues/2265#issuecomment-402131750,https://api.github.com/repos/pydata/xarray/issues/2265,402131750,MDEyOklzc3VlQ29tbWVudDQwMjEzMTc1MA==,6628425,2018-07-03T12:05:37Z,2018-07-03T12:05:37Z,MEMBER,"When writing datetime objects to disk, xarray encodes them following CF conventions (converting them to numerical values quantifying some units of time since a given reference date). This is to support other backends which do not support writing `datetime64` objects directly to disk. For accurate roundtripping of Datasets, xarray also includes logic to automatically decode datetimes stored following CF conventions. For that reason, instead of loading in the raw zarr store using zarr's `open` function, I recommend using xarray's `open_zarr` function, which will automatically decode the CF-encoded values to `datetime64` objects. See the following example: ``` In [1]: import numpy as np In [2]: import xarray as xr In [3]: da = xr.DataArray(np.datetime64('2000-01-01'), name='date') In [4]: da Out[4]: array('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]') In [5]: da.to_dataset().to_zarr('example.zarr') Out[5]: In [6]: ds = xr.open_zarr('example.zarr') In [7]: ds.date Out[7]: array('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]') ``` Note if we open the zarr store directly, we'll find that the date was encoded with the integer `0` and appropriate units and calendar attributes: ``` In [1]: import zarr In [2]: z = zarr.open('example.zarr') In [3]: z['date'][...] Out[3]: array(0) In [4]: z['date'].attrs['units'] Out[4]: u'days since 2000-01-01 00:00:00' In [5]: z['date'].attrs['calendar'] Out[5]: u'proleptic_gregorian' ``` Unlike xarray, zarr does not include logic for automatically decoding CF-encoded datetimes. I hope that helps.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,337733183