cf.RegridOperator.tosparse¶
-
RegridOperator.
tosparse
()[source]¶ Convert the weights to
scipy
sparse array format in-place.The weights are converted to Compressed Sparse Row(CSR) array format, i.e. the
weights
attribute becomes ascipy.sparse._arrays.csr_array
object. A CSR array 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.The
dst_mask
attribute is updated toTrue
for destination grid points for which the weights are all zero.- Returns