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

Home » Public Forums » archive » Chunk Array Decimation
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: Chunk Array Decimation [message #63709 is a reply to message #32363] Tue, 18 November 2008 07:21 Go to previous messageGo to previous message
Keflavich is currently offline  Keflavich
Messages: 19
Registered: May 2008
Junior Member
On Nov 18, 3:52 am, Wox <s...@nomail.com> wrote:
> On Mon, 17 Nov 2008 13:40:45 -0800 (PST), Keflavich
>
> <keflav...@gmail.com> wrote:
>>     Does anyone know how to implement this algorithm using a median
>> stack of each pixel instead of simply adding / averaging?
>
> The 'dual histogram loop' approach to drizzling, which you use, loops
> over the index-frequencies and not over the index-values like e.g. the
> 'single histogram' loop does. In the first case, intermediate results
> (partial sums) are calculated each iteration while in the second case,
> final results (total sums) are calculated each iteration.
>
> As far as I know, there is no 'intermediate' median (i.e. the
> equivalent to a partial sum). So maybe the single histogram loop is
> what you need:
>
> data=[1,2,3,4,5]
> inds=[4,4,1,2,1]
>
> mx=max(inds)
> vec3=fltarr(mx+1)
> h=histogram(inds,reverse_indices=ri,OMIN=om)
> for j=0L,n_elements(h)-1 do if ri[j+1] gt ri[j] then $
>       vec3[j+om]=median(data[ri[ri[j]:ri[j+1]-1]])
>
> Does this help?


It does, thanks. That's remarkably simple; I think it's time for me
to understand reverse indices on a deeper level.

Adam
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ASTER Data
Next Topic: reading slices of FITS files

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

Current Time: Wed Oct 08 17:48:01 PDT 2025

Total time taken to generate the page: 0.00385 seconds