IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39115


Ignore:
Timestamp:
Nov 12, 2015, 2:50:33 PM (11 years ago)
Author:
bills
Message:

when checking for outliers, read in the original column and then only
look at deltas where the values are not -999

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bills/adddeltacolumns

    r39056 r39115  
    4646# foreach my $line (<C>) {
    4747my @deltas;
     48my @columns;
    4849foreach my $line (@lines) {
    4950    next if $line =~ '^#';
     
    6162    $cmd .=  "addcol -after $p2 $dcol $equation;";
    6263    push @deltas, $dcol;
     64    push @columns, $p2;
    6365}
    6466$cmd .= "'";
     
    8082output /dev/null
    8183macro checkdelta
    82     \$col = \$1
     84    \$dcol = \$1
     85    \$col = \$2
    8386    \$thislimit = \$limit
    84     \$length = \$col[]
     87    set goodmask = \$col != -999
     88    subset good = \$dcol where goodmask == 1
     89    \$length = good[]
    8590    for i 0 10
    86         subset d = \$col where abs(\$col) > \$thislimit
     91        subset d = good where abs(good) > \$thislimit
    8792        \$noutliers = d[]
    8893        if (\$noutliers > 0)
    89             echo \$col has \$noutliers out of \$length with difference > \$thislimit
     94            echo \$dcol has \$noutliers out of \$length with difference > \$thislimit
    9095            \$thislimit = \$thislimit * 10
    9196        else
     
    97102
    98103    print $manafile "\nmacro dotests\n";
    99     foreach my $col (@deltas) {
    100         print $manafile "    checkdelta $col\n";
     104    my $n = scalar @deltas;
     105    for (my $i=0; $i < $n; $i++) {
     106        my $col = $columns[$i];
     107        my $dcol = $deltas[$i];
     108        print $manafile "    checkdelta $dcol $col\n";
    101109    }
    102110    print $manafile "end\n";
     
    105113    print $manafile "read -fits Joined";
    106114    foreach my $col (@deltas) {
     115        print $manafile " $col";
     116    }
     117    print $manafile "\n";
     118    print $manafile "read -fits Joined";
     119    foreach my $col (@columns) {
    107120        print $manafile " $col";
    108121    }
Note: See TracChangeset for help on using the changeset viewer.