home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 337733183

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
337733183 MDU6SXNzdWUzMzc3MzMxODM= 2265 .to_zarr with datetime64[ns] 4338975 closed 0     4 2018-07-03T03:31:21Z 2018-07-04T00:25:33Z 2018-07-04T00:25:33Z NONE      

Hi I've noticed a possible inconsistency with datetime storing. ``` t=xr.open_dataset(files[0]) t['JULD_LOCATION'][0] <xarray.DataArray 'JULD_LOCATION' ()> array('2008-07-29T20:20:58.000000000', dtype='datetime64[ns]') Attributes: long_name: Julian day (UTC) of the location relative to REFERENCE_DATE... conventions: Relative julian days with decimal part (as parts of day) resolution: 0.0

t.to_zarr(r'D:\argo\argo2.zarr',mode='w')

za =zarr.open(r'D:\argo\argo2.zarr',mode='w+') za['JULD_LOCATION'].info Out[442]: Name : /JULD_LOCATION Type : zarr.core.Array Data type : float64 Shape : (197,) Chunk shape : (197,) Order : C Read-only : False Compressor : Zlib(level=1) Store type : zarr.storage.DirectoryStore No. bytes : 1576 (1.5K) No. bytes stored : 2000 (2.0K) Storage ratio : 0.8 Chunks initialized : 1/1 ```

if I try this za['JULD_LOCATION1'] =t['JULD_LOCATION'] za['JULD_LOCATION1'].info Out[444]: Name : /JULD_LOCATION1 Type : zarr.core.Array Data type : datetime64[ns] Shape : (197,) Chunk shape : (197,) Order : C Read-only : False Compressor : Zlib(level=1) Store type : zarr.storage.DirectoryStore No. bytes : 1576 (1.5K) No. bytes stored : 1742 (1.7K) Storage ratio : 0.9 Chunks initialized : 1/1

There also seems to be a problem with the actual values stored are different using the two methods ``` pd.to_datetime(za['JULD_LOCATION'][0]) Timestamp('1970-01-01 00:00:00.000021394')

pd.to_datetime(za['JULD_LOCATION1'][0]) Timestamp('2008-07-29 20:20:58') I think it is to do with the reference date time not being applied? t1['REFERENCE_DATE_TIME'] Out[459]: <xarray.DataArray 'REFERENCE_DATE_TIME' ()> array(b'19500101000000', dtype='|S14') Attributes: long_name: Date of reference for Julian days conventions: YYYYMMDDHHMISS ```

I hope this makes sense

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2265/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 4 rows from issue in issue_comments
Powered by Datasette · Queries took 2.409ms · About: xarray-datasette