Do you want the actual median of the actual pixels within a particular annulus? 
 Or is resampling ok?  If the later, use map() to put it in radial coordinates, 
then use medover...

On Dec 24, 2012, at 7:31 PM, Tim Haines <[email protected]> wrote:

> Hello, all.
> 
> I am currently working with some simple 2D data, and I would like to replace 
> all of the pixel values lying along the same circular annulus with their 
> median. Currently, I am doing the following:
> 
> my $image = rfits('input.fits');
> my $radii = $image->long->inplace->rvals;
> 
> for my $radius ($radii->uniq->list)
> {
>     $image->whereND($radii==$radius) .= 
> $image->whereND($radii==$radius)->clump(-1)->medover;
> }
> 
> 
> I would like to get rid of the perl loop. I have tried using higher 
> dimensions in the whereND mask, but I couldn't quite get the threading to 
> work out for my purposes.
> 
> Any thoughts?
> 
> Many thanks.
> 
> - Tim
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to