Im trying to manually copy all dimensions, variables and attribute of a NetCDF-file to a new file. As in copy netcdf file using python this works well, except for the storage parameters like 'fill_value' or 'chunksizes'. In ncdump -sch
, these parameters are shown with a leading underscore (_):
float var1(time, lat, lon) ;
var1:_FillValue = NaNf ;
var1:grid_mapping = "crs" ;
var1:unit = "m" ;
var1:_Storage = "chunked" ;
var1:_ChunkSizes = 1, 14, 146 ;
var1:_DeflateLevel = 9 ;
var1:_Shuffle = "true" ;
var1:_Endianness = "little" ;
In createVariable I can set these parameters for the new variable, but how can I obtain the parameters like 'fill_value' or 'chunksizes' from the existing file using the netcdf4-python module? What is the syntax to read those parameters?