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 
Return to the default flat view Create a new topic Submit Reply
Re: Cumulative max() in *arbitrary* dimension? [message #79359] Fri, 24 February 2012 05:52 Go to previous 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
[Message index]
 
Read Message
Read Message
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: Thu Oct 09 07:22:09 PDT 2025

Total time taken to generate the page: 2.48369 seconds