-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_netcdf() fails to write if input is read from netcdf3_classic #2822
Comments
When you leave the But something like either of these should work:
or
|
I just tried both of these in a minimal example and I still get the same exception. |
OK, in that case please provide a full example that I can run. |
minimal_example.tar.gz |
I can reproduce this with libnetcdf 4.6.2. It looks like this problem is associated with having a
This appears to be fixed in libnetcdf 4.6.3 (Unidata/netcdf-c#803), if you can upgrade to that version. In the meantime, you can manually delete the Out of curiosity, where did this netCDF file come from? |
Interesting! I wonder why using the netCDF4 python interface works fine with this scenario. It must not be using the nccopy code. I will see if I can test a newer netcdf library. This is definitely an edge case, but thanks for providing a workaround! The netCDF file is an excerpt from a hydrology water modeling input file. Definitely a bit of legacy workflows and files involved. |
* Described here: pydata/xarray#2822 (comment) * Until we get our conda environment fixed this will have to do.
* Described here: pydata/xarray#2822 (comment) * Until we get our conda environment fixed this will have to do.
* WIP: Implementing geojson-vt for bathymetry * Minor change to how geojson is loaded * Added API extension for PBF tiles * Updated API script * Disabled vector rendering before zoom level 7 * Added shape layers for zooms past 7 * Removed old API extension * Fixed Data types in bath_shapes params * Fixed extension of bath_shapes route * Changed API call for high res bathymetry to v1.0 * Disable old tiles for zooms beyond 7 * Chagned directory names to facilitate two demos * Updated max zoom level * disabled preloading on shape layers * Removed preloading, updated API to use mbtiles file * Moved tile serving to routes_impl and combined requests * removed demo stuff * Renamed API request and changed directories to work with flask config * Fixed styles, added projection to API request preemptively * Added projection variable + Added documentation * Vector sources now refresh on state change * Added description of mbt_impl * Formatting * Removed unnecessary files - deleted geojsons from previous attempts * Removed unnecessary lines * Added shape path - forgot this was important * Disabled preloading past zoom level 7 - exactly the same as having preloading at infinity for max zoom level 8 - this helps performance at higher zoom levels on lower end machines * Small clean up - changed layer_bath url back to the old api so old caches still work * Ran eslint --ext .jsx,.js src/ --fix * Unified tileGrids - Defined as a variable - Now using MAX_ZOOM[this.props.state.projection] * Fix some incorrect file paths * Changed variable names - Made mbt_imp a bit clearer * If block optimization - code more likely to run now runs first * Update datasetconfig.json (#429) * Added new calculated variables to supported datasets. * Switch from navigator domain to localhost (much better performance). * Workaround for subset failure (#433) * Described here: pydata/xarray#2822 (comment) * Until we get our conda environment fixed this will have to do. * Lat / Lon variable fix for subsetting (#434) * Search the superset for lat lon variables - broke from geoff's code, this should fix it * Removed unused variable declaration
by deleting the _NCProperties attribute as mentioned in pydata/xarray#2822
by deleting the _NCProperties attribute as mentioned in pydata/xarray#2822
Code Sample
Problem description
The generated attribute error isn't clear at all, the file actually gets created, but then fails in the processes of writing. There is no clear connection to the netCDF format.
Expected Output
A new file created/written in (default) NETCDF4 format with contents of the Dataset. Or at the very least provide an exception that clearly indicates the format incompatibilities.
Output of
xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.5 (default, Sep 12 2018, 05:31:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
python-bits: 64
OS: Linux
OS-release: 3.10.0-957.5.1.el7.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
libhdf5: 1.8.18
libnetcdf: 4.4.1.1
xarray: 0.11.3
pandas: 0.22.0
numpy: 1.14.2
scipy: 1.0.0
netCDF4: 1.4.1
pydap: None
h5netcdf: None
h5py: 2.7.1
Nio: None
zarr: None
cftime: 1.0.1
PseudonetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
cyordereddict: None
dask: None
distributed: None
matplotlib: 1.2.0
cartopy: None
seaborn: None
setuptools: 40.4.3
pip: 18.1
conda: None
pytest: None
IPython: None
sphinx: None
The text was updated successfully, but these errors were encountered: