You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The calculation of the sparse intersection weights via calc_intersect_weights is fairly slow (approx. 4 minutes for 4000 CMLs and the 900x900 RADOLAN grid) and the resulting weight matrix would be large in dense format. Hence, it is often required to write the sparse intersection weights to disk and read them back in later to reuse them. Writing sparse data to a file e.g. in COO format is possible, but we want to keep the linkage to the indices that we have in the xarray.DataArray of the sparse weights matrix.
What we need is a function to read and write a xarray.DataArray, containing a sparse matrix, to NetCDF or zarr.
The text was updated successfully, but these errors were encountered:
At the end of this notebook Sparse arrays and the CESM land model component I learned that there is also a CF convention for storing sparse data via Compression by Gathering. Not sure if this helps us. But there is some implementation, at least for MultiIndex for this in cf-xarray according to their docs using cfxr.encode_multi_index_as_compress and cfxr.decode_compress_to_multi_index.
The calculation of the sparse intersection weights via
calc_intersect_weights
is fairly slow (approx. 4 minutes for 4000 CMLs and the 900x900 RADOLAN grid) and the resulting weight matrix would be large in dense format. Hence, it is often required to write the sparse intersection weights to disk and read them back in later to reuse them. Writing sparse data to a file e.g. in COO format is possible, but we want to keep the linkage to the indices that we have in thexarray.DataArray
of the sparse weights matrix.What we need is a function to read and write a
xarray.DataArray
, containing a sparse matrix, to NetCDF or zarr.The text was updated successfully, but these errors were encountered: