Comments (7)
would xarray future multidimensional groupby operator be useful for this ?
from oocgcm.
would cab-lab be useful for this ?
from oocgcm.
would xarray future multidimensional groupby operator be useful for this ?
Definitely could be done, but if your coarse graining is very regular (i.e. coarsen the grid by a specific factor, e.g. x2, x4, etc.) there is a faster implementation
In this gist, I have an implementation of coarse-graining using dask's map_blocks
https://gist.github.com/rabernat/10029776541cfe018905
from oocgcm.
Here is just the aggregation function on its own:
https://gist.github.com/rabernat/cb4f97be6289ffd8fa9b
from oocgcm.
thanks for the suggestion and for sharing your code.
Wrapping a function designed for numpy arrays is probably a good way to proceed.
Do you have an idea of how efficient is building a list of sliced arrays for large arrays ?
result = reduce(np.add, [data[sl] for sl in slices])
with GriddedData.py mentionned above, I paid attention to avoid iterating on list of chunks. In practice I am using only numpy.reshape and numpy.swapaxes (see here)
from oocgcm.
Another question is how to implement the possibility to reorganize lazily the data so that you can reshape it from say (Nx,Ny) in to (Nx/nx, Ny/ny, nx,ny) which can be usefull for building more advanced descriptive statistics than just variance and means in boxes.
from oocgcm.
This discussion thread is probably relevant to the current issue. See also this discussion about stack/unstack on xarray.
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 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 while reading a self-made netcdf file with io.return_xarray_mfdataset HOT 6
- 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.