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 #68331 is a reply to message #68327] Tue, 20 October 2009 08:00 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Conor writes:
>
>> 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 *seems* like there should be a simple way to do this,
> but if there is, I haven't found it. What would make
> sense to me is this:
>
> (cube[1,*,*])[w] = 1e24
>
> But this gives the error message that you can't store into
> a temporary variable. (The ol' pass by reference/pass by value
> thing, I suppose.)

Is it possible at all to use IDL pointer for aliasing? E.g. in Fortran I would do
something like the following

real, target :: cube(:,:,:)
real, pointer :: alias(:,:) => null()

alias => cube(1,:,:)

where ( alias < 0.0 )
alias = 1e24
end where

nullify(alias)


Is there an IDL equivalent to the "alias => cube(1,:,:)" statement in Fortran?

If there is, then that might get around the tired old "can't store into a temporary
variable" issue that plagues IDL due to it sticking to pass by reference only. (Man, I
wish they would fix that.)

The only way I can figure out to do the aliasing ends up copying the data.

Anyway...

cheers,

paulv
[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 19:38:24 PDT 2025

Total time taken to generate the page: 0.64154 seconds