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 #68333 is a reply to message #68327] Tue, 20 October 2009 07:39 Go to previous messageGo to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Oct 20, 10:22 am, Conor <cmanc...@gmail.com> wrote:
> I feel like this should be an easy one, but I've never quite figured
> it out.  Let's say I got a data cube and I want to do something on
> just a slice of it, say I want to turn certain values in a column into
> something else:
>
> w = where( cube[1,*,*] lt 0 )
>
> It seems like you should be able to do something like this:
>
> cube[1,w] = 1e24
>
> But that doesn't work...  Somehow I can't quite figure out the right
> way to do this.

It does not apply to this case, but for future reference, it may be
useful to know that it could be done directly if the slice was the
other way around (a subset of indices on the left):

w=where(cube[*,*,i] lt 0)
nel=n_elements(cube[*,*,i])
cube[i*nel+w]=1e24
[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: Sat Oct 18 02:36:04 PDT 2025

Total time taken to generate the page: 2.79867 seconds