def _mask_non_positives(a):
 mask = (a <= 0.0)
 if mask.any():
  return ma.MaskedArray(a, mask=mask)
 return a

def _mask_non_positives ( a ) : mask = ( a <= 0.0 ) if mask . any ( ) : return ma . MaskedArray ( a , mask = mask ) return a
return a numpy masked array where all non-positive values are masked .