find_lowest_nonnull_percentile¶
This module’s scope are tools relying on numpy.percentile.
Example:
>>> import numpy
>>> import tuna
>>> data = numpy.zeros ( shape = ( 10, 100, 100 ) )
>>> tuna.tools.find_lowest_nonnull_percentile ( data )
1
>>> data [ 0, :, : ] = numpy.ones ( shape = ( 100, 100 ) )
>>> tuna.tools.find_lowest_nonnull_percentile ( data )
90
-
tuna.tools.find_lowest_nonnull_percentile.
find_lowest_nonnull_percentile
(array)[source]¶ This function will attempt to find the lowest value, starting at 1, which makes numpy.percentile return a non-null value when fed the input array.
Parameters:
- array : numpy.ndarray
Containing the data to apply the percentile to.
Returns:
- lower_percentile : integer
The lowest percentile that is not null; if all data is null, this return value will be 1.