On Mon, Nov 2, 2009 at 1:04 PM, Kun-Dar Li <[email protected]> wrote:
>
> Hi Daniel,
>
> Thank you so much for your reply. Sorry for my unclear statement. I am
> trying to set the value of var2D to the value of z3D, where var3D is larger
> than 0.5. Since there maybe several z3D with var3D larger 0.5, so I choose
> the maximum value of z3D. Can I write as:

This is a lot more complicated than I thought. You can of course do
this with a loop, like so,

    for z in z3D:
            z2D = z * numerix.ones(len(x2D))
           mask = var3D((x2D, y2D, z2D)) > 0.5
           var2D[mask] = z

I'm not seeing a way to do this without a loop without reshaping var3D
and collapsing along the z-axis and then you'd have to assume that x2D
and y2D somehow correspond to x3D and y3D, which I'd rather not do.

-- 
Daniel Wheeler

Reply via email to