Comments (6)
This problem was when reading a Netcdf4 file.
But is not anymore when reading a Netcdf3 file, written with these options.
ds.to_netcdf(filenam,
'w',
format='NETCDF3_64BIT'
engine='scipy',
encoding={ vkey2:{'dtype':'float32'}})
from oocgcm.
Hi Simon,
could you please look in more detail and let me know what is the vkey/vname that returns the exception ?
thanks.
from oocgcm.
I am working on NEMO data with the following variables:
vkey = 'sea level'
vkey2 = vdict[vkey]['vname']
The dictionary is defined as follows:
vdict['sea level']={'vname': 'sossheig', ...
If it can provide information, here are my options to output in Netcdf4 (which raises a problem at the following reading stage)
ds.to_netcdf(filenam,'w',format='NETCDF4', engine='netcdf4', encoding={ vkey2:{'_FillValue':0,'dtype':'float32'}})
from oocgcm.
I suspect this related to the options used in reading netcdf files in core.io.
NB : these options have changed in the trunk (see)
- could you try to open your newly created dataset directly from xarray methods ?
- try without specifying chunk size for 't' dimension {'y': chunks[-2], 'x': chunks[-1]}
from oocgcm.
First, I noticed that I can not create the xarray.dataset: the error comes immediately from the open_mfdataset function
Here are my results:
-
Replacing
io.return_xarray_mfdataset(filemean,chunks=xr_chunks_tmean)
with
xr.open_mfdataset(filemean,chunks=xr_chunks_tmean,engine='netcdf4',lock=False)
does not change the result
-
Leaving out the 't' dimension provides this error:
ValueError: some chunks keys are not dimensions on this object: ['y', 'x']
I can add another result : when specifying chunk=None in the xarray function, the dataset again can not be read properly:
print xr.open_mfdataset(filemean,chunks=None,engine='netcdf4',lock=False)
gives
<xarray.Dataset>
Dimensions: ()
Coordinates:
*empty*
Data variables:
*empty*
from oocgcm.
The blocking version was when writing the file
ds.to_netcdf(filenam,'w','NETCDF4', 'netcdf4'...}})
which gives the following header
group: netcdf4 {
dimensions:
y = 3454 ;
x = 5422 ;
In fact, it works when writing the file
ds.to_netcdf(filenam,'w',format='NETCDF4', engine='netcdf4'...}})
which gives the following header
dimensions:
y = 3454 ;
x = 5422 ;
The first version seems to create an inner netcdf4 group which might not be a standard Netcdf4 file.
I understand that Xarray reading function may not read properly the first version (with an inner group) if the option 'group' is not filled.
from oocgcm.
Related Issues (20)
- Problem with boundary values in .core.grids._horizontal_gradient HOT 4
- Allow grid object to describe periodic grids (with a periodic x-axis).
- Shall I rename projection coordinates ? HOT 2
- How to reimplement grid coarsening and statistics-in-boxes in oocgcm ? HOT 7
- How to implement spatial integration methods in oocgcm ? HOT 2
- A decorator for testing chunks/grid_location.
- Add a class in order to access vertical coordinates and metrics HOT 4
- lon/lat information in xarray_dataset does not go through grid functions (norm_of_vectorfield for example) HOT 7
- Add method for Okubo-Weiss parameter in core.generic_2d_grid HOT 7
- Problem when slicing a NEMO 2d grid objects defined with dask chunks. HOT 4
- Suggestion: correct coordinates after curl/norm HOT 4
- Inheritance of DataArray HOT 1
- Data objects (scalar, vectors ...)
- Can not manage memory properly with norm_of_vectorfield
- use geojson for defining spatial diagnostics. HOT 1
- Add imports of sub-packages to top-level __init__.py HOT 2
- Slicing/isosurfaces methods for 3D grids. HOT 5
- pycomodo vs sgrid HOT 1
- oocgcm does not trivially apply to mitgcm outputs HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oocgcm.