Re: Function to find value in IDL [message #78118] |
Thu, 27 October 2011 05:12 |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
On Thu, 27 Oct 2011 04:34:58 -0700 (PDT), Waleria
<waleriantunes@gmail.com> wrote:
> I'm working with multidimensionals arrays, where my array is of type:
>
> % Compiled module: READ_FILE.
> <Expression> DOUBLE = Array[4, 16, 16, 16]
> <Expression> DOUBLE = Array[4, 16, 16, 16]
> <Expression> FLOAT = Array[16, 16, 16]
> <Expression> FLOAT = Array[16, 16, 16]
>
> No entanto as posi��es 16 e 16 do Array[4, 16, 16, 16] variam de
> acordo com arquivo lido, ou seja, no caso vou ter algo assim:
> Array[4,X,X,Y] . Ent�o preciso de alguma fun��o que encontre o valor
> dessa posi��o.
>
> However the positions 16 and 16 of the Array[4, 16, 16, 16] vary with
> file read or if I have something like this: Array [4, X, X, Y]. So I
> need some function to find the value of the position X and Y.
>
> You understand?
>
> I have this code: http://pastebin.com/DxRCWpTj
>
> Thanks,
The X and Y aren't positions but dimensions. You can find them with
the SIZE function, using the DIMENSIONS keyword. So for example:
IDL> arr=dblarr(4, 16, 16, 16)
IDL> help,arr
ARR DOUBLE = Array[4, 16, 16, 16]
IDL> print,size(arr,/dim)
4 16 16 16
|
|
|