libera_utils.io.netcdf.fill_in_dtype#
- libera_utils.io.netcdf.fill_in_dtype(fill_value: float | int, dtype: dtype) ndarray | None#
Return
fill_valueindtype, orNonewhen no value of that dtype can equal it.An integer dtype holds the fill only when it is a whole number within the dtype’s range; any other fill would wrap or truncate onto a valid value, so no stored value is fill. A float fill is cast to the float dtype, which reproduces the stored bit pattern of a sentinel such as the float32 maximum.
- Parameters:
- Returns:
A zero-dimensional array holding the fill in
dtype, orNonewhendtypeis an integer dtype andfill_valueis not finite, not a whole number, or outside the dtype’s range.- Return type:
np.ndarray or None