Index: trunk/BNC/scripts/compareSP3Plot.pl
===================================================================
--- trunk/BNC/scripts/compareSP3Plot.pl	(revision 11016)
+++ trunk/BNC/scripts/compareSP3Plot.pl	(revision 11083)
@@ -15,4 +15,7 @@
 # - at first one offset 'per epoch for all satellites' and
 # - secondly one offset 'per satellite for all epochs'.
+# The signal-in-space difference SIS (radial minus clock difference, only the
+# epoch offset removed, i.e. including the satellite offsets) is given in the
+# last column of BNC's epoch lines.
 # ========================================================================
 # Uses
@@ -70,5 +73,5 @@
     my (%COMPARISON);
     my (@array);
-    my ($sys, $sat, $epo, $radial, $along, $out, $drange, $clk, $clkRed);
+    my ($sys, $sat, $epo, $radial, $along, $out, $drange, $clk, $clkRed, $sis);
     # -----------------------------------------------------------------------------
     # create pdf for plot results
@@ -95,4 +98,5 @@
             $clk    = $array[5];#print "$clk\n";
             $clkRed = $array[6];#print "$clkRed\n";
+            $sis    = $array[8];# not present if the clock comparison is missing
             if ($out !~ /^\.$/) {
               push @{$COMPARISON{$sys}{$sat}{EPOCH }}, $epo;
@@ -102,4 +106,8 @@
               push @{$COMPARISON{$sys}{$sat}{CLK   }}, $clk;
               push @{$COMPARISON{$sys}{$sat}{CLKRED}}, $clkRed;
+            }
+            if (defined $sis && $sis =~ /^-?\d/) {
+              push @{$COMPARISON{$sys}{$sat}{EPOCH_SIS}}, $epo;
+              push @{$COMPARISON{$sys}{$sat}{SIS      }}, $sis;
             }
         }
@@ -280,4 +288,56 @@
         }
     }
+    ######## SIS #####################
+    if (("ALL" ~~ @plotTypes ) || ("SIS" ~~ @plotTypes)) {
+        print "Plot SIGNAL-IN-SPACE DIFFERENCES (RADIAL MINUS CLOCK) ...\n";
+        $page = $pdf->page(); $page->mediabox('A4');
+        $headline = sprintf("Signal-in-space differences, radial minus clock, incl. satellite offsets (%s)", $inputFilename);
+        $headline_text = $page->text;
+        $headline_text->font($font1, 11/pt);
+        $headline_text->translate(15/mm, 280/mm);
+        $headline_text->text($headline);
+        $y = $y0+$dy;
+        #SYSTEM
+        foreach my $key_sys (sort keys %COMPARISON) {
+            my @sats = grep { exists $COMPARISON{$key_sys}{$_}{SIS} } sort keys %{$COMPARISON{$key_sys}};
+            next unless @sats;
+            print "    for $key_sys\n";
+            my @datasets_s; # init datasets
+            my $pngName_s  = sprintf ("%s_SIS_%s.png", $inputFilename, $key_sys);
+            # SIS contains the satellite offsets: y range from the data
+            my $maxAbs = 0.1;
+            foreach my $key_sat (@sats) {
+                my ( $min, $max ) = minmax @{$COMPARISON{$key_sys}{$key_sat}{SIS}};
+                $maxAbs = abs($min) if abs($min) > $maxAbs;
+                $maxAbs = abs($max) if abs($max) > $maxAbs;
+            }
+            my $chart_s = Chart::Gnuplot->new(
+                          output => $pngName_s, terminal => 'png',title => "SIS (radial minus clock)",
+                          ylabel => "SIS Difference [m]", yrange => ["-$maxAbs", "$maxAbs"],
+                          xlabel => "Time [h]", timeaxis => 'x', xtics => {labelfmt => '%H:%M', rotate => '-270',},
+                          legend => { position => "outside right",},
+                          grid => 'on',);
+            #SATELLITE
+            foreach my $key_sat (@sats) {
+                my $colour = sprintf("%d", (substr $key_sat, -2)+1);
+                my $dataset_s = Chart::Gnuplot::DataSet->new(
+                                xdata => \@{$COMPARISON{$key_sys}{$key_sat}{EPOCH_SIS}},
+                                ydata => \@{$COMPARISON{$key_sys}{$key_sat}{SIS}},
+                                title => "$key_sat",
+                                timefmt => '%Y-%m-%d_%H:%M:%S',
+                                linetype => $colour,
+                                style => " lines ",);
+                push (@datasets_s, $dataset_s);
+            }
+            $chart_s->plot2d(@datasets_s);
+            $y = $y - $dy;
+            if($y < 30/mm) {
+                $page = $pdf->page(); $page->mediabox('A4');
+                $y = $y0;
+            }
+            $png = $page->gfx(); die("Unable to find image file: $!") unless -e $pngName_s;
+            $png->image($pdf->image_png($pngName_s), $x, $y, $width, $height);
+        }
+    }
     $pdf->save();
     $pdf->end();
@@ -295,6 +355,7 @@
 PARAMETER:
 
-      --plotTypes     possible: ALL => RAO and CLOCK; CLK => CLOCK and CLOCKRED; RAO => RAO only
-      --logFiles      comma separated list of BNC's combination logfiles
+      --plotTypes     possible: ALL => RAO, CLOCK and SIS; CLK => CLOCK and CLOCKRED; RAO => RAO only;
+                      SIS => signal-in-space differences (radial minus clock) only
+      --logFiles      comma separated list of BNC's SP3 comparison logfiles
       --help          show help contents
 
