Index: trunk/BNC/scripts/pppPlot.pl
===================================================================
--- trunk/BNC/scripts/pppPlot.pl	(revision 9946)
+++ trunk/BNC/scripts/pppPlot.pl	(revision 9947)
@@ -6,10 +6,12 @@
 #
 # Plot metrics:
-#    - code and phase residuals in [m],
-#    - receiver clock errors in [m],
-#    - a-priori and correction values of tropospheric zenith delay in [m],
-#    - time offset between GPS time and Galileo/GLONASS/BDS time in [m],
-#    - ambiguities, given per satellite
-#    - elevations,  given per satellite
+#    - NEU displacements w.r.t. coordinates in Crd file
+#    - A-priori + correction values of tropospheric zenith delay in [m],
+#    - GNSS Receiver clock errors in [m],
+#    - Elevations, given per satellite
+#    - Ambiguities, given per satellite
+#    - Ionosphere Delay [m],
+#    - Receiver Bias [m]
+#    - Code and phase residuals in [m],
 #
 # Author  : Andrea Stuerze
@@ -105,7 +107,4 @@
     my ( $station, $file ) = Bnc::parsePPPLogfile( $file, $sampling );
     my $EPOCHS       = $file->{'EPOCHS'};
-    my $EPOCHS_OGR   = $file->{'EPOCHS_OGR'};
-    my $EPOCHS_OGE   = $file->{'EPOCHS_OGE'};
-    my $EPOCHS_OGC   = $file->{'EPOCHS_OGC'};
     my $EPOCHS_G_CLK = $file->{'EPOCHS_G_CLK'};
     my $EPOCHS_R_CLK = $file->{'EPOCHS_R_CLK'};
@@ -192,6 +191,5 @@
         my $chartTRP = newChart($station);
         $chartTRP->set( output => $pngName );
-        #$chartTRP->set( ylabel => "Tropospheric Delay[m]", yrange => [ " 2.0 ", " 2.6 " ] );
-        $chartTRP->set( ylabel => "Tropospheric Delay[m]", yrange => [ " 1.0 ", " 3.0 " ] );
+        $chartTRP->set( ylabel => "Tropospheric Delay [m]", yrange => [ " 1.0 ", " 3.0 " ] );
 
         my $dataTRP = Chart::Gnuplot::DataSet->new(
@@ -400,5 +398,5 @@
 
         # AMBIGUITY_TYPE #print Dumper \%AMB;
-        foreach my $key_ambType (%AMB) {    #print "$key_ambType \n";  ??????
+        foreach my $key_ambType (%AMB) {    #print "$key_ambType \n";
             foreach my $key_sys ( sort keys %{ $AMB{$key_ambType} } ) {
 
@@ -493,70 +491,4 @@
         }
 
-        ######### RES #####################
-        DEBUG "Plot Residuals";
-        $page = $pdf->page();
-        $page->mediabox('A4');
-        $y             = $y0 + $dy;
-        $headline      = sprintf ( "Residuals for station %s", $station );
-        $headline_text = $page->text;
-        $headline_text->font( $font1, 11 / pt );
-        $headline_text->translate( 15 / mm, 280 / mm );
-        $headline_text->text($headline);
-
-        my $chartRES = newChart($station);
-        $chartRES->set( legend => { position => "outside right" } );
-
-        # RESIDUAL_TYPE   #print Dumper \%RES;
-        foreach my $key_resType ( sort keys %RES ) {    #print "key_resType: $key_resType \n";
-                                                        #SYSTEM
-            foreach my $key_sys ( sort keys %{ $RES{$key_resType} } ) {
-
-                #print "key_sys: $key_sys \n"; #print Dumper $RES{$key_resType};
-                my @datasets;
-                my $pngName = sprintf ( "%s_RES_%s_%s.png", $station, $key_resType, $key_sys );
-                $chartRES->set( output => $pngName );
-                $chartRES->set( ylabel => "Residuals $key_resType [m]" );
-
-                if ( $key_resType =~ /^c/ ) {
-                    #$chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
-                    $chartRES->set( yrange => [ " -10.0 ", " 10.0 " ] );
-                }
-                elsif ( $key_resType =~ /^l/ ) {
-                   #$chartRES->set( yrange => [ " -0.06 ", " 0.06 " ] );
-                    $chartRES->set( yrange => [ " -0.10 ", " 0.10 " ] );
-                }
-
-                elsif ( $key_resType =~ /^GIM/ ) {
-                    $chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
-                }
-
-                # SATELLITE
-                foreach my $key_sat ( sort keys %{ $RES{$key_resType}{$key_sys} } ) {
-
-                    #print "$key_sat = $RES{$key_resType}{$key_sys}{$key_sat} \n";
-                    $dataset = Chart::Gnuplot::DataSet->new(
-                        xdata   => $RES{$key_resType}{$key_sys}{$key_sat}{EPOCH},  # array of epochs
-                        ydata   => $RES{$key_resType}{$key_sys}{$key_sat}{DATA},   # array of residuals of one satellite
-                        title   => "$key_sat",
-                        timefmt => '%s',
-
-                        #style   => "linespoints",
-                        style => "linespoints",
-                    );
-                    push ( @datasets, $dataset );
-                }
-                $chartRES->plot2d(@datasets);
-                $y = $y - $dy;
-                if ( $y < 30 / mm ) {
-                    $page = $pdf->page();
-                    $page->mediabox('A4');
-                    $y = $y0;
-                }
-                $png = $page->gfx();
-                LOGDIE("could not find image file: $!\n") unless -e $pngName;
-                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
-            }
-        }
-
         ######### ION #####################
         if ( grep ( $_ eq "ALL", @plotTypes ) ) {
@@ -656,4 +588,68 @@
             }
         }
+
+        ######### RES #####################
+        DEBUG "Plot Residuals";
+        $page = $pdf->page();
+        $page->mediabox('A4');
+        $y             = $y0 + $dy;
+        $headline      = sprintf ( "Residuals for station %s", $station );
+        $headline_text = $page->text;
+        $headline_text->font( $font1, 11 / pt );
+        $headline_text->translate( 15 / mm, 280 / mm );
+        $headline_text->text($headline);
+
+        my $chartRES = newChart($station);
+        $chartRES->set( legend => { position => "outside right" } );
+
+        # RESIDUAL_TYPE   #print Dumper \%RES;
+        foreach my $key_resType ( sort keys %RES ) {    #print "key_resType: $key_resType \n";
+                                                        #SYSTEM
+            foreach my $key_sys ( sort keys %{ $RES{$key_resType} } ) {
+
+                #print "key_sys: $key_sys \n"; #print Dumper $RES{$key_resType};
+                my @datasets;
+                my $pngName = sprintf ( "%s_RES_%s_%s.png", $station, $key_resType, $key_sys );
+                $chartRES->set( output => $pngName );
+                $chartRES->set( ylabel => "Residuals $key_resType [m]" );
+
+                if ( $key_resType =~ /^c/ ) {
+                    $chartRES->set( yrange => [ " -10.0 ", " 10.0 " ] );
+                }
+                elsif ( $key_resType =~ /^l/ ) {
+                    $chartRES->set( yrange => [ " -0.10 ", " 0.10 " ] );
+                }
+
+                elsif ( $key_resType =~ /^GIM/ ) {
+                    $chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
+                }
+
+                # SATELLITE
+                foreach my $key_sat ( sort keys %{ $RES{$key_resType}{$key_sys} } ) {
+
+                    #print "$key_sat = $RES{$key_resType}{$key_sys}{$key_sat} \n";
+                    $dataset = Chart::Gnuplot::DataSet->new(
+                        xdata   => $RES{$key_resType}{$key_sys}{$key_sat}{EPOCH},  # array of epochs
+                        ydata   => $RES{$key_resType}{$key_sys}{$key_sat}{DATA},   # array of residuals of one satellite
+                        title   => "$key_sat",
+                        timefmt => '%s',
+
+                        #style   => "linespoints",
+                        style => "linespoints",
+                    );
+                    push ( @datasets, $dataset );
+                }
+                $chartRES->plot2d(@datasets);
+                $y = $y - $dy;
+                if ( $y < 30 / mm ) {
+                    $page = $pdf->page();
+                    $page->mediabox('A4');
+                    $y = $y0;
+                }
+                $png = $page->gfx();
+                LOGDIE("could not find image file: $!\n") unless -e $pngName;
+                $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );
+            }
+        }
     }    # end if ALL @plotTypes
 
@@ -663,5 +659,5 @@
     system ("rm *.png");
     if (Common::amInteractiv ) {
-#    	system ("evince $inputDir/$pdf_name");
+#   system ("evince $inputDir/$pdf_name");
     }
 }    # -----  next logfile  -----
@@ -688,8 +684,8 @@
 
 OPTIONS:
-  -p,--plotTypes    ALL or NEU (default)
-  -l,--logFiles     comma separated list of BNC's PPP logfiles
-  -s,--sampling     sampling interval in seconds for the logfile data (default: 1); for a daily logfile <30> seconds should be usefull
-  -h,--help         show help contents
+  -p, --plotTypes    ALL or NEU (default)
+  -l, --logFiles     comma separated list of BNC's PPP logfiles
+  -s, --sampling     sampling interval in seconds for the logfile data (default: 1); for a daily logfile <30> seconds should be usefull
+  -h, --help         show help contents
 
 EXAMPLES:
