comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Converting a 1D index into its original 2D index?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Converting a 1D index into its original 2D index? [message #68729] Fri, 20 November 2009 18:44
Chris Chronopoulos is currently offline  Chris Chronopoulos
Messages: 4
Registered: July 2009
Junior Member
On Nov 20, 5:07 am, jeanh
<jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
> Chris Chronopoulos wrote:
>> Hello,
>
>> I'm looking for the indeces of a 2D array which satisfy a logical
>> condition, so naturally I tried to use WHERE. However, I found that it
>> returns the indeces in 1D form. This is fine for subscripting, but
>> actually I want to interpret the index values themselves. Is there a
>> good way to convert these back to 2D format, or otherwise get around
>> the problem of WHERE confounding my indeces?
>
>> Thanks,
>> Chris
>
> Chris,
>
> see ARRAY_INDICES
>
> Jean

Ah, thanks guys! Just what I was looking for.

_chris
Re: Converting a 1D index into its original 2D index? [message #68739 is a reply to message #68729] Fri, 20 November 2009 05:07 Go to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
Chris Chronopoulos wrote:
> Hello,
>
> I'm looking for the indeces of a 2D array which satisfy a logical
> condition, so naturally I tried to use WHERE. However, I found that it
> returns the indeces in 1D form. This is fine for subscripting, but
> actually I want to interpret the index values themselves. Is there a
> good way to convert these back to 2D format, or otherwise get around
> the problem of WHERE confounding my indeces?
>
> Thanks,
> Chris


Chris,

see ARRAY_INDICES

Jean
Re: Converting a 1D index into its original 2D index? [message #68740 is a reply to message #68739] Fri, 20 November 2009 05:04 Go to previous message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
Chris Chronopoulos wrote:
> I'm looking for the indeces of a 2D array which satisfy a logical

Try array_indices() to convert to multidimensional indices.


chl
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Cubic root finding on a grid
Next Topic: Reading IDL save files into Python

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:29:14 PDT 2025

Total time taken to generate the page: 0.00524 seconds