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

Home » Public Forums » archive » Re: Using where() on slices of data cubes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Using where() on slices of data cubes [message #68464 is a reply to message #68324] Wed, 21 October 2009 14:52 Go to previous message
JDS is currently offline  JDS
Messages: 94
Registered: March 2009
Member
On Oct 20, 4:32 pm, David Fanning <n...@dfanning.com> wrote:
> JD Smith writes:
>> you should easily be able to generalize the above arguments to access
>> these elements
>
> I think in this case the word "easily" might be
> too subtly sarcastic to be easily appreciated by
> the vast majority of this newsgroup. :-)

(Almost) no sarcasm was intended.

Suppose you have this:

w=where(cube[1,5:*,10:1024] lt 0)

The "slice" is no longer as large as the cube in the yz dimensions,
and is offset by [5,10] too. So

y_full_cube = slice_column + 5
z_full_cube = slice_row + 10

and since the slice is smaller than the cube by 5 columns, to convert
our WHERE index vector w into col,row in the slice, we use

slice_column = w mod (sz[1]-5)
slice_row = w/(sz[1]-5)

Putting it all together we have:

ind = 1 + sz[0] * (5 + w mod (sz[1]-5) + (10 + w/(sz[1]-5)) * sz[1])

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rrun itools at breakpoint
Next Topic: Designating values to different ROIs in a single ROI file

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

Current Time: Fri Oct 10 07:52:46 PDT 2025

Total time taken to generate the page: 0.47653 seconds