cf.RegridOperator.tosparse¶
- RegridOperator.tosparse()[source]¶
Convert the weights to
scipysparse array format in-place.The
weightsattribute is set to a Compressed Sparse Row (CSR) array (i.e. ascipy.sparse._arrays.csr_arrayinstance) that combines the weights and the row and column indices, and therowandcolattributes are set toNone.The
dst_maskattribute is also updated toTruefor 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.
Added in version 3.13.0.
- Returns: