IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2006, 10:29:46 PM (19 years ago)
Author:
eugene
Message:

rewrite tests to avoid div by zero

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/detrend_reject_imfile.pl

    r10700 r10719  
    162162    }
    163163    if ($reject_imfile_sn) {
    164         if ($mean / $stdev < $reject_imfile_sn) {
    165             print "Rejecting exposure based on bad imfile S/N for imfile $i: " .
    166                 $mean / $stdev . " vs " . $reject_imfile_sn . "\n";
     164        if ($mean < $stdev * $reject_imfile_sn) {
     165            print "Rejecting exposure based on bad imfile S/N for imfile $i: \n";
     166            print "mean: " . $mean . " vs " . "stdev*SNlimit: " . $stdev * $reject_imfile_sn . "\n";
    167167            $reject = 1;
    168168            last;
     
    193193if ($reject_exp_mean) {
    194194    if (abs($mean) > $reject_exp_mean * $stdev) {
    195         print "Rejecting exposure based on bad mean: " . ($mean / $stdev) . " vs " .
    196             $reject_exp_mean . "\n";
     195        print "Rejecting exposure based on bad mean: \n";
     196        print "mean: $mean, stdev: $stdev (limit is: % $reject_exp_mean\n";
    197197        $reject = 1;
    198198    }
     
    222222# reject if the signal-to-noise is insufficient
    223223if ($reject_exp_sn) {
    224     if ($mean / $stdev < $reject_exp_sn) {
    225         print "Rejecting exposure based on poor S/N: " . $mean / $stdev . " vs " .
    226             $reject_exp_sn . "\n";
     224    if ($mean < $stdev * $reject_exp_sn) {
     225        print "Rejecting exposure based on poor S/N: \n";
     226        print "signal: $mean vs noise: $stdev (s/n limit is: $reject_exp_sn)\n";
    227227        $reject = 1;
    228228    }
     
    306306## the same logical cuts above can be applied to components in an
    307307## imfile, imfiles in an exposure, and exposures in a stack
     308
     309### this function needs to avoid div by zero: compare Signal vs Noise*limit
Note: See TracChangeset for help on using the changeset viewer.