2D analogue of the WHERE function? [message #66359] |
Wed, 29 April 2009 10:52  |
stefan5465
Messages: 13 Registered: March 2009
|
Junior Member |
|
|
Dear all,
Haven't found a thread mentioning this problem, which I can't
understand as it seems like something someone would have mentioned
before.
Anyway, to get to the point: Is there an equivalent of the WHERE
function that will scan a multidimensional array, and return a set of
indices for the elements that match the criteria?
I'm trying to pick out certain pixels of a FITS image, and the only
way round the problem I can think of is to loop the WHERE function
over one of the dimensions. Does a more elegant solution exist?
Many thanks,
Stefan
|
|
|
Re: 2D analogue of the WHERE function? [message #66366 is a reply to message #66359] |
Wed, 29 April 2009 16:03  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Apr 29, 2:17 pm, stefan5...@hotmail.com wrote:
> Dear all,
>
> Haven't found a thread mentioning this problem, which I can't
> understand as it seems like something someone would have mentioned
> before.
>
> Anyway, to get to the point: Is there an equivalent of the WHERE
> function that will scan a multidimensional array, and return a set of
> indices for the elements that match the criteria?
>
> I'm trying to pick out certain pixels of a FITS image, and the only
> way round the problem I can think of is to loop the WHERE function
> over one of the dimensions. Does a more elegant solution exist?
>
> Many thanks,
>
> Stefan
WHERE works perfectly well on multidimensional arrays.
-Jeremy.
|
|
|