You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this netcdf file which I can load into a xarray.Dataset containing a single data variable. This data variable consists of a structured numpy array. Loading it with:
import xarray as xr
import pandas as pd
import numpy as np
ds = xr.open_dataset('puftrac_2018103100ChinShan_Cs.nc')
returns
<xarray.Dataset>
Dimensions: (serial: 2657664)
Dimensions without coordinates: serial
Data variables:
trajec (serial) {'names':['ReleaseTime','CurrentTime','Longitude','Latitude','RelativeHeight','SigX','SigY','SigZ','AirConcentrationR','GroundConcentrationR'], 'formats':['<i8','<i8','<f4','<f4','<f4','<f4','<f4','<f4','<f4','<f4'], 'offsets':[0,8,16,20,24,28,32,36,40,44], 'itemsize':48, 'aligned':True} ...
Attributes:
Start Time: 1540944000
End Time: 1541635200
Release Period: 300
Dump Period: 300
I can't save it back to netcdf with
ds.to_netcdf('tmp.nc')
getting
~/anaconda3/lib/python3.6/site-packages/xarray/backends/netCDF4_.py in _get_datatype(var, nc_format, raise_on_invalid_encoding)
105 def _get_datatype(var, nc_format='NETCDF4', raise_on_invalid_encoding=False):
106 if nc_format == 'NETCDF4':
--> 107 datatype = _nc4_dtype(var)
108 else:
109 if 'dtype' in var.encoding:
~/anaconda3/lib/python3.6/site-packages/xarray/backends/netCDF4_.py in _nc4_dtype(var)
128 else:
129 raise ValueError('unsupported dtype for netCDF4 variable: {}'
--> 130 .format(var.dtype))
131 return dtype
132
ValueError: unsupported dtype for netCDF4 variable: {'names':['ReleaseTime','CurrentTime','Longitude','Latitude','RelativeHeight','SigX','SigY','SigZ','AirConcentrationR','GroundConcentrationR'], 'formats':['<i8','<i8','<f4','<f4','<f4','<f4','<f4','<f4','<f4','<f4'], 'offsets':[0,8,16,20,24,28,32,36,40,44], 'itemsize':48, 'aligned':True}
I have this netcdf file which I can load into a xarray.Dataset containing a single data variable. This data variable consists of a structured numpy array. Loading it with:
returns
I can't save it back to netcdf with
getting
Any thing I could do here? (I actually intend to change some values before writing back to disk.) The netcdf file can be found here: https://drive.google.com/open?id=1H5M3N_lv471JyOalcA3Bw_Y2ed0EX6xt
The text was updated successfully, but these errors were encountered: