cf.RegridOperator.tosparse¶
-
RegridOperator.
tosparse
()[source]¶ Convert the weights to
scipy
sparse array format in-place.The
weights
attribute is set to a Compressed Sparse Row (CSR) array (i.e. ascipy.sparse._arrays.csr_array
instance) that combines the weights and the row and column indices, and therow
andcol
attributes are set toNone
.The
dst_mask
attribute is also updated toTrue
for destination grid points for which the weights are all zero.A CSR array is used as the most efficient sparse array type given that we expect no changes to the sparsity structure, and any further modification of the weights to account for missing values in the source grid will always involve row-slicing.
If the weights are already in a sparse array format then no action is taken.
New in version 3.13.0.
- Returns