]> jspc29.x-matter.uni-frankfurt.de Git - hades_mdc_settings.git/commitdiff
add default baseline setting
authorJan Michel <michel@physik.uni-frankfurt.de>
Fri, 2 Sep 2022 09:10:33 +0000 (11:10 +0200)
committerJan Michel <michel@physik.uni-frankfurt.de>
Fri, 2 Sep 2022 09:10:33 +0000 (11:10 +0200)
scripts/generate_pasttrec_settings.pl
scripts/pasttrec_baseline_finder.pl

index 6c405fc3ec4b35baa2f2d01cf6a2ae71974ded1c..2462004f60fadfc5f8540ff24dca352404f18d75 100755 (executable)
@@ -27,11 +27,13 @@ my $settings;  #addr -> @registers(0xa040-0xa07F)
 
 my $threshold = 0;
 my $help = 0;
+my $default_baseline = 0x10;
 
 Getopt::Long::Configure(qw(gnu_getopt));
 GetOptions(
            'help|h' => \$help,
            'threshold|t=i' => \$threshold,
+           'defaultbase|u=i' => \$default_baseline,
            'noload' => \$NO_LOAD_DIRECT,
            'nowrite' => \$NO_WRITE_FILES,
            'debug|d' => \$DEBUG,
@@ -97,8 +99,13 @@ foreach my $a (keys %$addresses) {
       else{  
         foreach my $i (0..7) {                                     #replace baselines
           my $t  = $settings->{$a}[$pt*16+4+$i];
-            $t &= 0xFFF00;
+          $t &= 0xFFF00;
+          if ($baselines->{$addresses->{$a}}{$pt}[$i] != 99) {
             $t += $baselines->{$addresses->{$a}}{$pt}[$i];
+            }
+          else {
+            $t += $default_baseline;
+            }
           $settings->{$a}[$pt*16+4+$i] = $t;
           }
         }  
@@ -150,6 +157,7 @@ generate_pasttrec_settings.pl [options]
    -h, --help          brief help message
    -t, --threshold N   use threshold N
    -d, --debug         write debug messages
+   -u, --defaultbase N    default baseline to use if none has been found
    --noload            don't load settings
    --nowrite           don't save settings
 
@@ -177,6 +185,10 @@ Do not write configuration files
 
 Write debug messages
 
+=item B<-u | --defaultbase>
+
+default baseline to use if none has been found
+
 =back
 
 =head1 DESCRIPTION
index 49dab499169df7f878053f87f37806abf7026eb6..2e6c8fe4c00965090fbcce9c8c9ab37eb4e3c851 100755 (executable)
@@ -154,6 +154,7 @@ foreach my $b (sort keys %{$rates}) {
       $baselines->{$b}[$p*8+7]+0.5,
       );
     }
+  print("\n");  
   }
 printf(" No baseline found for %i channels. \n", $numOfFailures);