compute_fill_mask

swxsoc.io.fillval.compute_fill_mask(arr: ndarray, fillval: Any) ndarray[source]

Compute a boolean mask of fill positions in arr.

For floats, both NaN values and exact equality to fillval count as fill. For integers and strings, only exact equality to fillval counts. The literal bytes b"nan" are never treated as fill on read.

Parameters:
  • arr (array-like) – The raw data array as read from the CDF.

  • fillval (scalar or None) – The variable’s FILLVAL attribute. If None, only NaN is detected for float arrays; integer and string arrays yield an all-False mask.

Returns:

numpy.ndarray – Boolean array, same shape as arr.