netcdf4-python
netcdf4-python copied to clipboard
netcdf4-python: python/numpy interface to the netCDF C library
I had a bug in one of my scripts, which took me quite a while to debug. The reason for this was that one can read using either [][] or...
Writing big-endian data into a netCDF4 file on a little-endian system works perfectly well if I'm creating a _new_ netCDF4 file. However, the endiannes appears to be wrong when modifying...
Earlier today I had a large simulation file which I just inadvertently erased by running `Dataset(filename, 'w')` without reading the documentation warning me about `clobber=True` being the default. I can't...
For our operational service it would be useful with possibility to specify a timeout on calling netcdf4.Dataset on remote datasets (Thredds/OPeNDAP), e.g.: ``` f = Dataset(OPeNDAP_URL, 'r', timeout=10) ```
I'm working on reading some data from a Thredds server using OPeNDAP in a nedcdf4 format. The URL for the server I'm working with is here: https://climate.northwestknowledge.net/RangelandForecast/download.php When accesses some...
Hi, this is linux, python 3.5, latest numpy. While profiling memory leaks in our software (which reads and writes a lot of NetCDF files), I have found what looks like...
Array slicing with libnetcdf 4.7.4 is very slow. The same slicing with 4.7.3 is fast. To reproduce this issue, first download this file: [https://data.nodc.noaa.gov/thredds/catalog/ncei/woa/salinity/A5B7/0.25/catalog.html?dataset=ncei/woa/salinity/A5B7/0.25/woa18_A5B7_s16_04.nc](https://data.nodc.noaa.gov/thredds/catalog/ncei/woa/salinity/A5B7/0.25/catalog.html?dataset=ncei/woa/salinity/A5B7/0.25/woa18_A5B7_s16_04.nc) (I can't generate a MWE file.)...
``` from netCDF4 import Dataset import os data = Dataset(os.path.join(filepath, file), 'r', format='NETCDF4') ``` > File "netCDF4/_netCDF4.pyx", line 1848, in netCDF4._netCDF4.Dataset.__init__ (netCDF4/_netCDF4.c:13983) > OSError: NetCDF: HDF netCDF4==1.2.7 h5py==2.7.0
### Example Code ``` import matplotlib.pyplot as plt import numpy as np import netCDF4 url = ('http://thredds-test.unidata.ucar.edu/thredds/dodsC/' 'satellite/goes16/GRB16/ABI/CONUS/Channel02/current/' 'OR_ABI-L1b-RadC-M3C02_G16_s20182341637323_e20182341640096_c20182341640138.nc') ds = netCDF4.Dataset(url) values = ds.variables['Rad'][:,:] print(np.count_nonzero(values==-20.289911)) plt.imshow(values) plt.show() ``` ###...
https://github.com/pydata/xarray/issues/4050#issue-615288533