No worries, glad to help (and glad that Chris's reply was even more helpful and 
direct!)

Er, I think the "until($img_NMn->nelem==0)" is a mistake -- I should have said 
"until($dex->nelem==0)".

On Mar 12, 2014, at 2:15 PM, Schregle Roland HSLU T&A <[email protected]> 
wrote:

> On Wed, 12 Mar 2014 00:33:05 +0100, Craig DeForest 
> <[email protected]> wrote:
> 
>> You could generate a weighting variable and use the sum over the weighting 
>> variable, instead of average().  But you're better off using BAD values, 
>> which are awesome.  You can set a given element to a special value that 
>> indicates it's bad, and it will be ignored by all the statistical routines. 
>> Also, if you're using glue() iteratively, you'll do marginally better to 
>> accumulate n of your (3,N,M) images into a Perl array, and then PDL them all 
>> at once. Like this:
>> 
>> $imgStack = pdl( double, map { rpic($_) } @files );  # 3,N,M,n
>> $img_NMn = $imgStack->average; # N,M,n;
>> $img_NMn->badflag(1);
>> $img_nNM = $img_NMn->mv(2,0);
>> 
>> do {
>>      my($mean, undef, undef, undef, undef, undef, $sigma) = 
>> $img_nNM->statsover;
>>      $dex = whichND( abs($img_NMn-$mean) > $sigma);
>>      $img_NMn->indexND($dex) .= $img_NMn->badvalue;
>> } until($img_NMn->nelem==0);
> 
> Hi Craig,
> 
> thanks for the hint with the baddies, looks very sleek. Will try that 
> tomorrow.
> 
> I don't quite get the do... until($img_NMn->nelem==0), I assume this simply 
> indicates that all images have been processed.
> 
> Note that the images are in a custom high dynamic range format, so instead of 
> using rpic() I wrote my own import routine.
> 
> Thanks again & best regards,
> 
> --Roland
> 
> 
> 
> -- 
> Dr. Roland Schregle
> Senior Research Associate
> 
> T direct: +41 41 349 39 77
> [email protected]
> 
> Lucerne University of Applied Sciences and Arts
> School of Engineering and Architecture
> CC Envelopes and Solar Energy (EASE)
> Technikumstrasse 21, CH-6048 Horw
> T +41 41 349 33 11, F +41 41 349 39 60
> www.hslu.ch/ccease


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

Reply via email to