def mask_array_by_array_val(in_array, test_array, min_val):
    """
    Sets elements of array to 0, where test_array < min_val
    :param in_array: array to be manipulated
    :param test_array: array in which min_val must be reached. must be same
    dimensions as in_array
    :param min_val: value test_array must reach
    :return: masked array
    """

    in_array[test_array < min_val] = 0
    return in_array