Skip to content

Boolean evaluation of an array #25

Description

@ryankeedy

Python doesn't care for the way the validity of a value is being evaluated:

Traceback (most recent call last):
File "pypiv_test.py", line 43, in
u, v, mask = openpiv.validation.global_val( u, v, (-10, 200), (-30, 30) )
File "/usr/local/lib/python2.6/dist-packages/openpiv/validation.py", line 65, in global_val
ind = u < u_thresholds[0] or u > u_thresholds[1] or v < v_thresholds[0] or v > v_thresholds[1]
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

It seems that because u and v are arrays, it is not interested in evaluating it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions