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

Home » Public Forums » archive » Re: Cumulative max() in *arbitrary* dimension?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Cumulative max() in *arbitrary* dimension? [message #79359] Fri, 24 February 2012 05:52 Go to next message
ameigs is currently offline  ameigs
Messages: 12
Registered: March 2009
Junior Member
On Feb 23, 8:38 pm, Gianguido Cianci <gianguido.cia...@gmail.com>
wrote:
> Hi all,
>
> I would like to write a generic version of the following, which is for a 3d movie:
>
> res=movie
> s=size(res, /dim)
> FOR i = 1,  s[2]-1 DO BEGIN
>    res[*, *, i] = max(dim = 3,  res[*, *, 0:i])
> ENDFOR
>
> So how to I generalize this to any dimension? I could make something with execute, but there's gotta be a better way. I'm on IDL7.
>
> Thanks,
> Gianguido

I am surprized that Craig Markwardt has not replied already, but here
goes (using his CMAPPLY routine at http://www.physics.wisc.edu/~craigm/idl/arrays.html):

IDL> res = cmapply('max',movie,3)

Andy
Re: Cumulative max() in *arbitrary* dimension? [message #79449 is a reply to message #79359] Sun, 26 February 2012 23:25 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Feb 24, 8:52 am, ameigs <andyme...@gmail.com> wrote:
> On Feb 23, 8:38 pm, Gianguido Cianci <gianguido.cia...@gmail.com>
> wrote:
>
>> Hi all,
>
>> I would like to write a generic version of the following, which is for a 3d movie:
>
>> res=movie
>> s=size(res, /dim)
>> FOR i = 1,  s[2]-1 DO BEGIN
>>    res[*, *, i] = max(dim = 3,  res[*, *, 0:i])
>> ENDFOR
>
>> So how to I generalize this to any dimension? I could make something with execute, but there's gotta be a better way. I'm on IDL7.
>
>> Thanks,
>> Gianguido
>
> I am surprized that Craig Markwardt has not replied already, but here
> goes (using his CMAPPLY routine athttp://www.physics.wisc.edu/~craigm/idl/arrays.html):
>
> IDL> res = cmapply('max',movie,3)

I didn't reply because the original poster appeared to be asking for a
kind of "rolling" maximum, which CMAPPLY doesn't do. (i.e. MAX(res[*,
*, 0:i]) for each i)

Craig
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Capturing Ctrl+c
Next Topic: hai dear this is special gift for uuuuuuuu

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

Current Time: Wed Oct 08 13:52:57 PDT 2025

Total time taken to generate the page: 0.00543 seconds