Re: Using where() on slices of data cubes [message #68326 is a reply to message #68325] |
Tue, 20 October 2009 13:03   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Lajos writes:
>
> On Tue, 20 Oct 2009, Conor 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.
>>
>
>
> cube[where(cube[1,*,*] lt 0)*(size(cube, /dim))[0]+1] = 1e24
Humm. Well, I suppose, for this *specific* problem. I can't
wait to see the general solution, though, for a slice in any
direction. Do you suppose it will fit on a page of paper? :-)
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|