Use whichND.

$location = whichND $a>30;

On Aug 4, 2012, at 11:07 AM, Tim Haines wrote:

> Hi, all.
> 
> I am trying to find the 2D coordinates of particular values in a piddle. I 
> came up with the following, but is there an easier (better?) way? I was 
> thinking that whichND would do this directly without the call to ndcoords, 
> but it always returns *all* of the coordinates- not just the ones that match 
> the mask.
> 
> use PDL;
> $a = sequence(10,5);
> $b = $a->ndcoords->mv(0,2)->whereND($a>30);
> print $a, join(',', $b->dims()), "\n", $b;
> 
> 
> Many thanks.
> 
> - Tim
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to