home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 812278389

This data as json

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/5023#issuecomment-812278389 https://api.github.com/repos/pydata/xarray/issues/5023 812278389 MDEyOklzc3VlQ29tbWVudDgxMjI3ODM4OQ== 7237617 2021-04-02T02:14:19Z 2021-04-02T02:14:19Z NONE

Thanks for the great suggestion @shoyer - your suggestion to loop through the netCDF files is working well in Dask using the following code:

``` import xarray as xr import gcsfs from tqdm.autonotebook import tqdm xr.set_options(display_style="html");

fs = gcsfs.GCSFileSystem(project='ldeo-glaciology', mode='r',cache_timeout = 0) NCs = fs.glob('gs://ldeo-glaciology/AMPS/WRF_24/domain_02/*.nc') url = 'gs://' + NCs[0] openfile = fs.open(url, mode='rb') ds = xr.open_dataset(openfile, engine='h5netcdf',chunks={'Time': -1}) for i in tqdm(range(1, 8)): url = 'gs://' + NCs[i] openfile = fs.open(url, mode='rb') temp = xr.open_dataset(openfile, engine='h5netcdf',chunks={'Time': -1}) ds = xr.concat([ds,temp],'Time') ```

However, I am still confused why open_mfdataset was not parsing the Time dimension - the concatenated DataSet using the looping method above appears to have a time dimension compatible with datetime64[ns].

```

ds.coords['XTIME'].compute()

xarray.DataArray'XTIME'Time: 8 array(['2019-01-01T03:00:00.000000000', '2019-01-01T06:00:00.000000000', '2019-01-01T09:00:00.000000000', '2019-01-01T12:00:00.000000000', '2019-01-01T15:00:00.000000000', '2019-01-01T18:00:00.000000000', '2019-01-01T21:00:00.000000000', '2019-01-02T00:00:00.000000000'], dtype='datetime64[ns]') ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  829426650
Powered by Datasette · Queries took 0.847ms · About: xarray-datasette