raster_stream_buffer.py
def mask_by_value_op(array, value, nodata):
    """Return 1 where array==value 0 otherwise."""
    result = numpy.empty_like(array)
    result[:] = 0
    result[array == value] = 1
    result[numpy.isclose(array, nodata)] = 2
    return result
Return 1 where array==value 0 otherwise.
Return 1 where array==value 0 otherwise.
Return 1 where array == value 0 otherwise .
def mask_by_value_op(array, value, nodata):
    result = numpy.empty_like(array)
    result[:] = 0
    result[array == value] = 1
    result[numpy.isclose(array, nodata)] = 2
    return result
def mask_by_value_op ( array , value , nodata ) : result = numpy . empty_like ( array ) result [ : ] = 0 result [ array == value ] = 1 result [ numpy . isclose ( array , nodata ) ] = 2 return result
Return 1 where array==value 0 otherwise.
Return 1 where array == value 0 otherwise .
"""Return 1 where array==value 0 otherwise."""
array
value
nodata