home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 100601294

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
100601294 MDU6SXNzdWUxMDA2MDEyOTQ= 526 64-bit values are coerced to 32-bit when writing as NETCDF4_CLASSIC 6645714 closed 0     5 2015-08-12T18:06:42Z 2015-09-01T21:02:08Z 2015-09-01T21:02:08Z CONTRIBUTOR      

``` import xray import numpy

ds = xray.Dataset() time_data = numpy.arange(10.0, 100.0, .5) raw_data = time_data.copy() times = xray.Variable('time', time_data) data = xray.DataArray(raw_data, dims=['time'], coords={'time': times}) ds['data'] = data ```

If you examine ds now, you’ll see:

<xray.Dataset> Dimensions: (time: 180) Coordinates: * time (time) float64 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 ... Data variables: data (time) float64 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 ...

Now, if we dump to netcdf and reload:

ds.to_netcdf('test1.nc', format='NETCDF4_CLASSIC') ds1 = xray.open_dataset('test1.nc')

The formerly 64-bit values are now 32-bit:

<xray.Dataset> Dimensions: (time: 180) Coordinates: * time (time) float32 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 ... Data variables: data (time) float32 10.0 10.5 11.0 11.5 12.0 12.5 13.0 13.5 14.0 ...

It looks to me like coerce_nc3_dtype is being called for all formats that aren't straight NETCDF4.

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

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 5 rows from issue in issue_comments
Powered by Datasette · Queries took 0.553ms · About: xarray-datasette