Implemented both suggestions (bool and np.where(vol > thres, 1, 0) )