Changeset 10806 in ntrip


Ignore:
Timestamp:
Feb 4, 2026, 8:42:15 AM (4 weeks ago)
Author:
stuerze
Message:

SSR debug info added

Location:
trunk/BNC/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/scripts/Bnc.pm

    r10798 r10806  
    395395                        if (   $hlp[14] eq '-nan'
    396396                                || $hlp[15] eq '-nan'
    397                                 || $hlp[16] eq '-nan' )
    398                         {
     397                                || $hlp[16] eq '-nan' ) {
    399398                                WARN("$hlp[2] $hlp[3]: NEU displacements are NAN");
    400399                                next;
     
    503502#          $logMode    [optional] Flag. If set, remember the position of the file-read
    504503#                      for the next read. Default: off
    505 # Return : $station, \%data
     504# Return : $dateStr, $station, $ssrData \%data
    506505# =============================================================================
    507506sub parsePPPLogfile {
     
    517516                $startSec = time() - $goBackSecs;
    518517        }
    519         my $epo;
     518        my $epo_ppp;
    520519        my $old_epochSec = 0;
    521520        my $epochSec     = 0;
    522521        my $epochDiff    = 0;
     522
     523    my ( @EPOCH_PPP);
    523524        my ( @hlp, @N, @E, @U, @ISFIX, @NUMFIX, @TRP );
    524         my ( @EPOCH, );
    525525        my ( %SATNUM, %RECCLK, %AMB, %RES, %ELE, %ION, %BIA );
    526         my ( $station, $lki, $sys, $sat, $amb );
     526        my ( $date, $station, $lki, $sys, $sat, $amb );
     527
     528        my ( @EPOCH_SSR);
     529        my ( %CLKCORR);
     530        my ( %YAW_SSR);
     531        my ( %YAW_DEF);
     532        my ( %CODEBIAS);
     533        my ( %PHASEBIAS);
     534        my ( %JUMPCOUNT);
     535        my $epochSsrSec = 0;
     536        my $ssrData;
     537        my $dateStr;
     538
    527539        open( my $fh, "<", $file ) || LOGDIE "Could not open file $file: $!\n";
    528540
     
    536548        while (<$fh>) {
    537549                chomp( $ln = $_ );
    538 
    539550                if ( $ln =~ /\bof Epoch\b/ ) {
    540 
    541551                        # PPP of Epoch 2015-08-27_14:00:15.000
    542                         if ( $ln =~
    543                                 /PPP of Epoch (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})\.\d+/ )
    544                         {
    545                                 $epo = $1;    #print "$epo\n";
    546                         }
    547                         else { ERROR "strange line: \"$ln\""; next }
    548 
    549                         my $tp = Time::Piece->strptime( $epo, '%Y-%m-%d_%H:%M:%S' );
     552                        if ( $ln =~ /PPP of Epoch (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})\.\d+/ ) {
     553                                $epo_ppp = $1;    #print "$epo_ppp\n";
     554                                @hlp = split( /\s+/, $ln );
     555                $ssrData = $hlp[5]; #print "$ssrData\n";
     556                $dateStr = substr( $hlp[3], 0, 9 );
     557
     558                        }
     559                        else {
     560                                ERROR "strange ppp line: \"$ln\""; next
     561                        }
     562
     563                        my $tp = Time::Piece->strptime( $epo_ppp, '%Y-%m-%d_%H:%M:%S' );
    550564                        $epochSec  = $tp->epoch();
    551565                        $epochDiff = $epochSec - $old_epochSec;
     
    553567                }
    554568
    555                 next if ( !$epo );
     569                next if ( !$epo_ppp );
    556570                next if ( defined $startSec && $epochSec < $startSec );
    557571                next if ( $epochDiff && $epochDiff < $sampling );
    558572
    559573                @hlp = split( /\s+/, $ln );
    560                 my $numFix = 0;
    561                 my $isFix;
    562                 my $strFix = "fix";
     574
    563575                if ( $ln =~ /\bdN\b/ ) {
    564                         push( @EPOCH, $epochSec );    # besser $epo ?
     576                        #2025-11-29_16:55:09.000 WTZR00DEU0 X = 4075580.2482 +- 0.0500 Y = 931854.1736 +- 0.0314 Z = 4801568.3044 +- 0.0591 dN = 0.0074 +- 0.0407 dE = 0.0895 +- 0.0284 dU = -0.0072 +- 0.0672 fix 96 %
     577                        push( @EPOCH_PPP, $epochSec );
    565578                        $old_epochSec = $epochSec;
    566 
    567 #2025-11-29_16:55:09.000 WTZR00DEU0 X = 4075580.2482 +- 0.0500 Y = 931854.1736 +- 0.0314 Z = 4801568.3044 +- 0.0591 dN = 0.0074 +- 0.0407 dE = 0.0895 +- 0.0284 dU = -0.0072 +- 0.0672 fix 96 %
     579                        $date = substr( $hlp[0], 0, 9 );
    568580                        $station = $hlp[1];
    569 
     581                    my $numFix = 0;
     582                    my $isFix;
     583                    my $strFix = "fix";
    570584                        if (   $hlp[19] eq '-nan'
    571585                                || $hlp[24] eq '-nan'
    572                                 || $hlp[29] eq '-nan' )
    573                         {
     586                                || $hlp[29] eq '-nan' ) {
    574587                                WARN("$hlp[0] $station: NEU displacements are NAN");
    575588                        }
    576 
    577589                        push @N, $hlp[19];
    578590                        push @E, $hlp[24];
     
    590602                        push @NUMFIX, $numFix;
    591603                }
    592                 elsif ( ( $ln =~ /\bAMB\b/ ) && ( $ln !~ /RESET/ ) ) {
    593 
    594                  # 2015-08... AMB lIF G04 253.0000 -8.9924 +- 1.7825 el = 22.03 epo = 86
     604                elsif ( ( $ln =~ /\bAMB\b/ ) && ( $ln !~ /RESET/ ) ) {           # 2015-08... AMB lIF G04 253.0000 -8.9924 +- 1.7825 el = 22.03 epo = 86
    595605                        $lki = $hlp[2];
    596606                        $sat = $hlp[3];
    597607                        $sys = substr( $sat, 0, 1 );
    598608                        $amb = $hlp[4] + $hlp[5];
    599                         push @{ $AMB{$lki}{$sys}{$sat}{EPOCH} },  $epochSec;
     609                        push @{ $AMB{$lki}{$sys}{$sat}{EPOCH_PPP} },  $epochSec;
    600610                        push @{ $AMB{$lki}{$sys}{$sat}{DATA} },   $amb;
    601611                        push @{ $AMB{$lki}{$sys}{$sat}{NUMEPO} }, $hlp[13];
    602                         push @{ $ELE{$sys}{$sat}{EPOCH} }, $epochSec;
     612                        push @{ $ELE{$sys}{$sat}{EPOCH_PPP} }, $epochSec;
    603613                        push @{ $ELE{$sys}{$sat}{DATA} },  $hlp[10];
    604614                }
    605                 elsif ( $ln =~ /\bRES\b/ && $ln !~ /Neglected/ ) {
    606 
    607                         # 2015-08... RES lIF G30  -0.0076
     615                elsif ( $ln =~ /\bRES\b/ && $ln !~ /Neglected/ ) {                      # 2015-08... RES lIF G30  -0.0076
    608616                        $sat = $hlp[3];
    609617                        $lki = $hlp[2];
     
    611619
    612620                        #print "$epo $lki $sys $sat $res\n";
    613                         push @{ $RES{$lki}{$sys}{$sat}{EPOCH} }, $epochSec;
     621                        push @{ $RES{$lki}{$sys}{$sat}{EPOCH_PPP} }, $epochSec;
    614622                        push @{ $RES{$lki}{$sys}{$sat}{DATA} },  $hlp[4];
    615623                }
    616                 elsif ( ( $ln =~ /\bION\b/ ) && ( $ln !~ /RESET/ ) ) {
    617 
    618                 # 2018-12-01_20:37:58.000 ION      G02     0.0000    -0.3277 +-   2.4663
     624                elsif ( ( $ln =~ /\bION\b/ ) && ( $ln !~ /RESET/ ) ) {          # 2018-12-01_20:37:58.000 ION      G02     0.0000    -0.3277 +-   2.4663
    619625                        $sat = $hlp[2];
    620626                        $sys = substr( $sat, 0, 1 );
    621                         push @{ $ION{$sys}{$sat}{EPOCH} }, $epochSec;
     627                        push @{ $ION{$sys}{$sat}{EPOCH_PPP} }, $epochSec;
    622628                        push @{ $ION{$sys}{$sat}{DATA} },  $hlp[4];
    623629                }
    624                 elsif ( ( $ln =~ /\bBIA\b/ ) && ( $ln !~ /RESET/ ) ) {
    625 
    626                 # 2020-12-09_00:55:19.000 BIA  c1  G       0.0000    +2.5149 +-   9.6543
     630                elsif ( ( $ln =~ /\bBIA\b/ ) && ( $ln !~ /RESET/ ) ) {          # 2020-12-09_00:55:19.000 BIA  c1  G       0.0000    +2.5149 +-   9.6543
    627631                        $lki = $hlp[2];
    628632                        $sys = $hlp[3];
    629                         push @{ $BIA{$lki}{$sys}{EPOCH} }, $epochSec;
     633                        push @{ $BIA{$lki}{$sys}{EPOCH_PPP} }, $epochSec;
    630634                        push @{ $BIA{$lki}{$sys}{DATA} },  $hlp[4] + $hlp[5];
    631635                }
     
    636640                        push( @TRP, $hlp[2] + $hlp[3] );
    637641                }
    638                 elsif ( $ln =~ /\bREC_CLK\b/ ) {
    639 
    640                  # 2024-10-20_03:57:30.000 RECCLK  G       0.0000    -1.7861 +-   0.5268
     642                elsif ( $ln =~ /\bREC_CLK\b/ ) {                 # 2024-10-20_03:57:30.000 RECCLK  G       0.0000    -1.7861 +-   0.5268
    641643                        $sys = $hlp[2];
    642                         push @{ $RECCLK{$sys}{EPOCH} }, $epochSec;
     644                        push @{ $RECCLK{$sys}{EPOCH_PPP} }, $epochSec;
    643645                        push @{ $RECCLK{$sys}{DATA} },  $hlp[3] + $hlp[4];
     646                }
     647                ##################
     648                # SSR parameters #
     649                ##################
     650            elsif ( $ln =~ /\bclkCorr\b/ && @hlp > 3) {
     651                # clkCorr 2025-11-17_13:50:45.000 C45 -18.576
     652                if ( $ln =~ /clkCorr (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})\.\d+/ ) {
     653                                $epochSsrSec = $1;    #print "$epochSsrSec\n";
     654                        }
     655                        else {
     656                                ERROR "strange ssr line: \"$ln\""; next
     657                        }
     658                        my $tp = Time::Piece->strptime( $epo_ppp, '%Y-%m-%d_%H:%M:%S' );
     659                        $epochSsrSec  = $tp->epoch();
     660                        $date = substr( $hlp[0], 0, 9 );
     661                        $sat = $hlp[2];
     662                        $sys = substr( $sat, 0, 1 );
     663                        push @{ $CLKCORR{$sys}{$sat}{EPOCH_SSR} }, $epochSsrSec;
     664                        push @{ $CLKCORR{$sys}{$sat}{DATA} },  $hlp[3];
     665                }
     666            elsif ( $ln =~ /\byawAngle\b/&& @hlp > 3 ) {
     667                # yawAngle 2025-11-17_13:50:40.000 G06 218.672 136.115
     668                if ( $ln =~ /yawAngle (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})\.\d+/ ) {
     669                                $epochSsrSec = $1;    #print "$epochSsrSec\n";
     670                        }
     671                        else {
     672                                ERROR "strange ssr line: \"$ln\""; next
     673                        }
     674                        my $tp = Time::Piece->strptime( $epo_ppp, '%Y-%m-%d_%H:%M:%S' );
     675                        $epochSsrSec  = $tp->epoch();
     676                        $sat = $hlp[2];
     677                        $sys = substr( $sat, 0, 1 );
     678                        push @{ $YAW_SSR{$sat}{EPOCH_SSR} }, $epochSsrSec;
     679                        push @{ $YAW_SSR{$sat}{DATA} },  $hlp[3];
     680                        push @{ $YAW_DEF{$sat}{EPOCH_SSR} }, $epochSsrSec;
     681                        push @{ $YAW_DEF{$sat}{DATA} },  $hlp[4];
     682                }
     683            elsif ( $ln =~ /\bcodeBias\b/ && @hlp > 3) {
     684                #codeBias 2025-11-17_13:50:35.000 C45  1P  12.140  2I  13.330  5P  21.740  6I  20.190
     685                if ( $ln =~ /codeBias (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})\.\d+/ ) {
     686                                $epochSsrSec = $1;    #print "$epochSsrSec\n";
     687                        }
     688                        else {
     689                                ERROR "strange ssr line: \"$ln\""; next
     690                        }
     691                        my $tp = Time::Piece->strptime( $epo_ppp, '%Y-%m-%d_%H:%M:%S' );
     692                        my ($num_bias, $bias_type, $bias_value);
     693                        $epochSsrSec  = $tp->epoch();
     694                        $sat = $hlp[2];
     695                        $sys = substr( $sat, 0, 1 );
     696                        my $hlpSize = @hlp;
     697                        for (my $i=3; $i < $hlpSize; $i++) {
     698              $bias_type  = $hlp[$i++];
     699              $bias_value = $hlp[$i];
     700              push @{ $CODEBIAS{$bias_type}{$sys}{$sat}{EPOCH_SSR} }, $epochSsrSec;
     701                          push @{ $CODEBIAS{$bias_type}{$sys}{$sat}{DATA} },  $bias_value;
     702            }
     703                }
     704            elsif ( $ln =~ /\bphaseBias\b/ && @hlp > 3) {
     705                #phaseBias 2025-11-17_13:50:55.000 G02  315.00   0.000  1C  1 x  0.291  2W  1 x  0.408
     706                if ( $ln =~ /phaseBias (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2})\.\d+/ ) {
     707                                $epochSsrSec = $1;    #print "$epochSsrSec\n";
     708                        }
     709                        else {
     710                                ERROR "strange ssr line: \"$ln\""; next
     711                        }
     712                        my $tp = Time::Piece->strptime( $epo_ppp, '%Y-%m-%d_%H:%M:%S' );
     713                        my ($num_bias, $bias_type, $bias_value, $jump_count, $int_flag);
     714                        $epochSsrSec  = $tp->epoch();
     715                        $sat = $hlp[2];
     716                        $sys = substr( $sat, 0, 1 );
     717                        my $hlpSize = @hlp;
     718                        for (my $i=5; $i < $hlpSize; $i++) {
     719              $bias_type  = $hlp[$i++]; #print "$sat type: $bias_type";
     720              $jump_count = $hlp[$i++]; #print " count: $jump_count";
     721              $int_flag   = $hlp[$i++]; #print " flag: $int_flag";
     722              $bias_value = $hlp[$i];   #print " bias: $bias_value \n";
     723              push @{ $PHASEBIAS{$bias_type}{$sys}{$sat}{EPOCH_SSR} }, $epochSsrSec;
     724              push @{ $JUMPCOUNT{$bias_type}{$sys}{$sat}{EPOCH_SSR} }, $epochSsrSec;
     725                          push @{ $PHASEBIAS{$bias_type}{$sys}{$sat}{DATA} },  $bias_value;
     726                          push @{ $JUMPCOUNT{$bias_type}{$sys}{$sat}{DATA} },  $jump_count;
     727            }
    644728                }
    645729        }    # -----  next line  -----
     
    648732        close $fh;
    649733
    650         my $nof_epochs = scalar @EPOCH;
     734        my $nof_epochs = scalar @EPOCH_PPP;
    651735        DEBUG(  "$station: epochs:$nof_epochs, North displac.: "
    652736                  . scalar @N
     
    671755
    672756        my %data = (
    673                 EPOCH  => \@EPOCH,
    674                 N      => \@N,
    675                 E      => \@E,
    676                 U      => \@U,
    677                 ISFIX  => \@ISFIX,
    678                 NUMFIX => \@NUMFIX,
    679                 TRP    => \@TRP,
    680                 SATNUM => \%SATNUM,
    681                 RECCLK => \%RECCLK,
    682                 RES    => \%RES,
    683                 AMB    => \%AMB,
    684                 ELE    => \%ELE,
    685                 ION    => \%ION,
    686                 BIA    => \%BIA,
     757                EPOCH_PPP  => \@EPOCH_PPP,
     758                N          => \@N,
     759                E          => \@E,
     760                U          => \@U,
     761                ISFIX      => \@ISFIX,
     762                NUMFIX     => \@NUMFIX,
     763                TRP        => \@TRP,
     764                SATNUM     => \%SATNUM,
     765                RECCLK     => \%RECCLK,
     766                RES        => \%RES,
     767                AMB        => \%AMB,
     768                ELE        => \%ELE,
     769                ION        => \%ION,
     770                BIA        => \%BIA,
     771                EPOCH_SSR  => \@EPOCH_SSR,
     772                CLKCORR    => \%CLKCORR,
     773                YAW_SSR    => \%YAW_SSR,
     774                YAW_DEF    => \%YAW_DEF,
     775                CODEBIAS   => \%CODEBIAS,
     776                PHASEBIAS  => \%PHASEBIAS,
     777                JUMPCOUNT  => \%JUMPCOUNT,
    687778        );
    688779
    689         return ( $station, \%data, 0 );
     780        return ($dateStr, $station, $ssrData, \%data, 0 );
    690781}
    691782
  • trunk/BNC/scripts/pppPlot.pl

    r10798 r10806  
    106106 # Read logfile
    107107 # -----------------------------------------------------------------------------
    108         my ( $station, $file ) = Bnc::parsePPPLogfile( $file, $sampling );
    109         my $EPOCH  = $file->{'EPOCH'};
    110         my $N      = $file->{'N'};
    111         my $E      = $file->{'E'};
    112         my $U      = $file->{'U'};
    113         my $ISFIX  = $file->{'ISFIX'};
    114         my $NUMFIX = $file->{'NUMFIX'};
    115         my %RECCLK = %{ $file->{'RECCLK'} };
    116         my %AMB    = %{ $file->{'AMB'} };
    117         my %RES    = %{ $file->{'RES'} };
    118         my %ELE    = %{ $file->{'ELE'} };
    119         my %ION    = %{ $file->{'ION'} };
    120         my %BIA    = %{ $file->{'BIA'} };
     108        my ( $dateStr, $station, $ssrData, $file ) = Bnc::parsePPPLogfile( $file, $sampling );
     109print "TEST: $ssrData\n";
     110        # PPP #
     111        my $EPOCH_PPP = $file->{'EPOCH_PPP'};
     112        my $N         = $file->{'N'};
     113        my $E         = $file->{'E'};
     114        my $U         = $file->{'U'};
     115        my $ISFIX     = $file->{'ISFIX'};
     116        my $NUMFIX    = $file->{'NUMFIX'};
     117        my %RECCLK    = %{ $file->{'RECCLK'} };
     118        my %AMB       = %{ $file->{'AMB'} };
     119        my %RES       = %{ $file->{'RES'} };
     120        my %ELE       = %{ $file->{'ELE'} };
     121        my %ION       = %{ $file->{'ION'} };
     122        my %BIA       = %{ $file->{'BIA'} };
     123
     124        # SSR #
     125        my $EPOCH_SSR = $file->{'EPOCH_SSR'};
     126        my %CLKCORR   = %{ $file->{'CLKCORR'} };
     127        my %YAW_SSR   = %{ $file->{'YAW_SSR'} };
     128        my %YAW_DEF   = %{ $file->{'YAW_DEF'} };
     129        my %CODEBIAS  = %{ $file->{'CODEBIAS'} };
     130        my %PHASEBIAS = %{ $file->{'PHASEBIAS'} };
     131        my %JUMPCOUNT = %{ $file->{'JUMPCOUNT'}};
    121132
    122133 # -----------------------------------------------------------------------------
     
    140151        $str_rms_u   = sprintf( " %.2f ", $rms_u );
    141152        $str_rms_trp = sprintf( " %.2f ", $rms_trp );
    142         DEBUG("RMS: North: $str_rms_n, East: $str_rms_e, Up: $str_rms_u, TRP: $str_rms_trp");
     153        DEBUG(
     154"RMS: North: $str_rms_n, East: $str_rms_e, Up: $str_rms_u, TRP: $str_rms_trp"
     155        );
    143156
    144157 # -----------------------------------------------------------------------------
     
    146159 # -----------------------------------------------------------------------------
    147160        my $dataset;
    148         $page = $pdf->page();
    149         $page->mediabox('A4');
    150         $headline      = sprintf( "PPP results for station %s", $station );
    151         $headline_text = $page->text;
    152         $headline_text->font( $font1, 11 / pt );
    153         $headline_text->translate( 15 / mm, 280 / mm );
    154         $headline_text->text($headline);
    155         $y = $y0;
    156 
    157161        ######### NEU #####################
    158         DEBUG "Plot NEU";
    159         my $pngNameNEU = sprintf( "%s_NEU.png", $station );
    160         my $chartNEU   = newChart($station);
    161         $chartNEU->set(
    162                 output => $pngNameNEU,
    163                 ylabel => "Displacements [m]",
    164                 yrange => [ " -0.5 ", " 0.5 " ],
    165         );
    166         my $dataN = Chart::Gnuplot::DataSet->new(
    167                 xdata   => $EPOCH,
    168                 ydata   => $N,
    169                 title   => "Displacements N, RMS + -$str_rms_n m",
    170                 timefmt => '%s',
    171                 style   => "dots",
    172         );
    173         my $dataE = Chart::Gnuplot::DataSet->new(
    174                 xdata   => $EPOCH,
    175                 ydata   => $E,
    176                 title   => "Displacements E, RMS + -$str_rms_e m",
    177                 timefmt => '%s',
    178                 style   => "dots",
    179         );
    180         my $dataU = Chart::Gnuplot::DataSet->new(
    181                 xdata   => $EPOCH,
    182                 ydata   => $U,
    183                 title   => "Displacements U, RMS + -$str_rms_u m",
    184                 timefmt => '%s',
    185                 style   => "dots",
    186         );
    187 
    188         my @datasets = ( $dataN, $dataE, $dataU );
    189         $chartNEU->plot2d(@datasets);
    190 
    191         $png = $page->gfx();
    192         LOGDIE("could not find image file: $!\n") unless -e $pngNameNEU;
    193         $png->image( $pdf->image_png($pngNameNEU), $x, $y, $width, $height );
    194 
     162        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
     163                $page = $pdf->page();
     164            $page->mediabox('A4');
     165            $headline      = sprintf( "PPP results for station %s", $station );
     166        $headline_text = $page->text;
     167            $headline_text->font( $font1, 11 / pt );
     168        $headline_text->translate( 15 / mm, 280 / mm );
     169            $headline_text->text($headline);
     170            $y = $y0;
     171                DEBUG "Plot NEU ";
     172                my $pngNameNEU = sprintf( "%s_NEU.png", $station );
     173                my $chartNEU   = newChart("$station ($dateStr)");
     174                $chartNEU->set(
     175                        output => $pngNameNEU,
     176                        ylabel => "Displacements [m]",
     177                        yrange => [ " -0.5 ", " 0.5 " ],
     178                );
     179                my $dataN = Chart::Gnuplot::DataSet->new(
     180                        xdata   => $EPOCH_PPP,
     181                        ydata   => $N,
     182                        title   => "Displacements N, RMS + -$str_rms_n m",
     183                        timefmt => '%s',
     184                        style   => "dots",
     185                );
     186                my $dataE = Chart::Gnuplot::DataSet->new(
     187                        xdata   => $EPOCH_PPP,
     188                        ydata   => $E,
     189                        title   => "Displacements E, RMS + -$str_rms_e m",
     190                        timefmt => '%s',
     191                        style   => "dots",
     192                );
     193                my $dataU = Chart::Gnuplot::DataSet->new(
     194                        xdata   => $EPOCH_PPP,
     195                        ydata   => $U,
     196                        title   => "Displacements U, RMS + -$str_rms_u m",
     197                        timefmt => '%s',
     198                        style   => "dots",
     199                );
     200                my @datasets = ( $dataN, $dataE, $dataU );
     201                $chartNEU->plot2d(@datasets);
     202                $png = $page->gfx();
     203                LOGDIE("could not find image file: $!\n") unless -e $pngNameNEU;
     204                $png->image( $pdf->image_png($pngNameNEU), $x, $y, $width, $height );
     205        }
    195206        ######### FIX #####################
    196         if ( grep ( $_ eq "ALL", @plotTypes ) ) {
     207        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
    197208                DEBUG "Plot FIX";
    198209                my $pngNameFIX = sprintf( "%s_FIX.png", $station );
    199                 my $chartFIX   = newChart($station);
     210                my $chartFIX   = newChart("$station ($dateStr)");
    200211                $chartFIX->set(
    201212                        output => $pngNameFIX,
     
    204215                        ytics  => 20,
    205216                );
    206 
    207217                my $dataNUMFIX = Chart::Gnuplot::DataSet->new(
    208                         xdata   => $EPOCH,
     218                        xdata   => $EPOCH_PPP,
    209219                        ydata   => $NUMFIX,
    210220                        timefmt => '%s',
     
    212222                        color   => "green",
    213223                );
    214 
    215224                $chartFIX->plot2d($dataNUMFIX);
    216225                $y = $y - $dy;
     
    225234        }
    226235        ######### TRP #####################
    227         if ( grep ( $_ eq "ALL", @plotTypes ) ) {
     236        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
    228237                DEBUG "Plot TRP";
    229238                my $pngNameTRP = sprintf( "%s_TRP.png", $station );
    230                 my $chartTRP   = newChart($station);
     239                my $chartTRP   = newChart("$station ($dateStr)");
    231240                $chartTRP->set( output => $pngNameTRP );
    232241                $chartTRP->set(
    233242                        ylabel => "Tropospheric Delay [m]",
    234                         yrange => [ " 1.0 ", " 3.0 " ]
     243                        yrange => [ " 1.0 ", " 3.0 " ],
    235244                );
    236245                my $dataTRP = Chart::Gnuplot::DataSet->new(
    237                         xdata   => $EPOCH,
     246                        xdata   => $EPOCH_PPP,
    238247                        ydata   => $file->{'TRP'},
    239248                        title   => "Tropospheric Delay, RMS + -$str_rms_trp m",
     
    252261                LOGDIE("could not find image file: $!\n") unless -e $pngNameTRP;
    253262                $png->image( $pdf->image_png($pngNameTRP), $x, $y, $width, $height );
    254 
    255                 ######### RECCLK #####################
     263        }
     264        ######### RECCLK #####################
     265        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
    256266                DEBUG "Plot Receiver Clocks";
    257267                $page = $pdf->page();
     
    263273                $headline_text->translate( 15 / mm, 280 / mm );
    264274                $headline_text->text($headline);
    265 
    266                 my $chartRECCLK = newChart($station);
    267                 $chartRECCLK->set( legend => { position => "outside right" } );
     275                my $chartRECCLK = newChart("$station ($dateStr)");
     276                $chartRECCLK->set(
     277                    legend => { position => "outside right" } ,
     278                );
    268279                my @datasets      = ();                                  # init datasets
    269280                my $pngNameRECCLK = sprintf( "%s_RECCLK.png", $station );
    270281                $chartRECCLK->set( output => $pngNameRECCLK );
    271282                $chartRECCLK->set( ylabel => "Receiver Clocks [m]" );
    272 
    273283                # SYSTEM
    274284                foreach my $key_sys ( sort keys %RECCLK ) {
    275 
    276285                        $dataset = Chart::Gnuplot::DataSet->new(
    277                                 xdata => \@{ $RECCLK{$key_sys}{EPOCH} },    # array of epochs
     286                                xdata => \@{ $RECCLK{$key_sys}{EPOCH_PPP} },   # array of epochs
    278287                                ydata => \@{ $RECCLK{$key_sys}{DATA} }
    279288                                ,    # array of elevations of one satellite
     
    285294                }
    286295                $chartRECCLK->plot2d(@datasets);
    287 
    288                 # system ("display $pngName&");
    289296                $y = $y - $dy;
    290297                if ( $y < 30 / mm ) {
     
    296303                die("could not find image file: $!") unless -e $pngNameRECCLK;
    297304                $png->image( $pdf->image_png($pngNameRECCLK), $x, $y, $width, $height );
    298 
    299                 ######### ELE #####################
     305        }
     306        ######### ELE #####################
     307        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
    300308                DEBUG "Plot Elevations";
    301309                $page = $pdf->page();
     
    307315                $headline_text->translate( 15 / mm, 280 / mm );
    308316                $headline_text->text($headline);
    309 
    310                 my $chartELE = newChart($station);
    311                 $chartELE->set( legend => { position => "outside right" } );
    312 
     317                my $chartELE = newChart("$station ($dateStr)");
     318                $chartELE->set(
     319                    legend => { position => "outside right" },
     320                );
    313321                # SYSTEM #print Dumper \%ELE;
    314322                foreach my $key_sys ( sort keys %ELE ) {
    315 
    316323                        # print "$key_sys \n";# print Dumper $ELE{$key_sys};
    317324                        my @datasets = ();    # init datasets
     
    322329                                yrange => [ " 0.0 ", " 90.0 " ]
    323330                        );
    324 
    325331                        # SATELLITE
    326                         foreach my $key_sat ( sort keys %{ $ELE{$key_sys} } ) {
    327 
    328                                 # print "$key_sat = $ELE{$key_sys}{$key_sat} \n";
     332                        foreach my $key_sat ( sort keys %{ $ELE{$key_sys} } ) {                         # print "$key_sat = $ELE{$key_sys}{$key_sat} \n";
    329333                                $dataset = Chart::Gnuplot::DataSet->new(
    330                                         xdata => \@{ $ELE{$key_sys}{$key_sat}{EPOCH} }
     334                                        xdata => \@{ $ELE{$key_sys}{$key_sat}{EPOCH_PPP} }
    331335                                        ,    # array of epochs
    332336                                        ydata => \@{ $ELE{$key_sys}{$key_sat}{DATA} }
     
    339343                        }
    340344                        $chartELE->plot2d(@datasets);
    341 
    342                         # system ("display $pngName&");
    343345                        $y = $y - $dy;
    344346                        if ( $y < 30 / mm ) {
     
    352354                                $height );
    353355                }
    354 
    355                 ######### AMB #####################
     356        }
     357        ######### AMB #####################
     358        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
    356359                DEBUG "Plot Ambiguities";
    357360                $page = $pdf->page();
     
    363366                $headline_text->translate( 15 / mm, 280 / mm );
    364367                $headline_text->text($headline);
    365 
    366368                # AMBIGUITY_TYPE #print Dumper \%AMB;
    367                 foreach my $key_ambType (%AMB) {    #print "$key_ambType \n";
     369                foreach my $key_ambType (%AMB) {
    368370                        foreach my $key_sys ( sort keys %{ $AMB{$key_ambType} } ) {
    369 
    370                                 #print "$key_sys \n"; print Dumper $AMB{$key_ambType};
    371371                                my ( @datasets_amb, @datasets_epo );    # init datasets
    372                                 my $pngNameAMB = sprintf( "%s_AMB_%s_%s.png",
    373                                         $station, $key_ambType, $key_sys );
    374                                 my $pngNameEPO = sprintf( "%s_EPO_%s_%s.png",
    375                                         $station, $key_ambType, $key_sys );
     372                                my $pngNameAMB = sprintf( "%s_AMB_%s_%s.png",   $station, $key_ambType, $key_sys );
     373                                my $pngNameEPO = sprintf( "%s_EPO_%s_%s.png",   $station, $key_ambType, $key_sys );
    376374                                my $chartAMB = Chart::Gnuplot->new(
    377375                                        output   => $pngNameAMB,
     
    379377                                        title    => $station,
    380378                                        ylabel   => "Ambiguities $key_ambType [m]",
    381 
    382                                         # yrange => [" 0.0 ", " 90.0 "],
    383                                         xlabel   => "Time [h]",
    384379                                        timeaxis => 'x',
    385380                                        xtics    => { labelfmt => '%H:%M', rotate => '-270', },
     
    392387                                        title    => $station,
    393388                                        ylabel   => "Number of Epochs $key_ambType [-]",
    394 
    395                                         # yrange => [" 0.0 ", " 90.0 "],
    396                                         xlabel   => "Time [h]",
    397389                                        timeaxis => 'x',
    398390                                        xtics    => { labelfmt => '%H:%M', rotate => '-270', },
     
    400392                                        grid     => 'on',
    401393                                );
    402 
    403394                                # SATELLITE
    404                                 foreach
    405                                   my $key_sat ( sort keys %{ $AMB{$key_ambType}{$key_sys} } )
    406                                 {
    407 
    408                                   #print "$key_sat = $AMB{$key_ambType}{$key_sys}{$key_sat} \n";
    409                                   # ambiguities
     395                                foreach  my $key_sat ( sort keys %{ $AMB{$key_ambType}{$key_sys} } ){
     396                                        # ambiguities
    410397                                        my $dataset_amb = Chart::Gnuplot::DataSet->new(
    411                                                 xdata => $AMB{$key_ambType}{$key_sys}{$key_sat}{EPOCH}
    412                                                 ,    # array of epochs
    413                                                 ydata => $AMB{$key_ambType}{$key_sys}{$key_sat}{DATA}
    414                                                 ,    # array of ambiguities of one satellite
     398                                                xdata =>  $AMB{$key_ambType}{$key_sys}{$key_sat}{EPOCH_PPP}             ,    # array of epochs
     399                                                ydata => $AMB{$key_ambType}{$key_sys}{$key_sat}{DATA}                   ,    # array of ambiguities of one satellite
    415400                                                title   => "$key_sat",
    416401                                                timefmt => '%s',
     
    418403                                        );
    419404                                        push( @datasets_amb, $dataset_amb );
    420 
    421405                                        # number of epochs used for ambiguity
    422406                                        my $dataset_epo = Chart::Gnuplot::DataSet->new(
    423                                                 xdata => $AMB{$key_ambType}{$key_sys}{$key_sat}{EPOCH}
    424                                                 ,    # array of epochs
    425                                                 ydata => $AMB{$key_ambType}{$key_sys}{$key_sat}{NUMEPO}
    426                                                 ,    # array of ambiguities of one satellite
     407                                                xdata =>  $AMB{$key_ambType}{$key_sys}{$key_sat}{EPOCH_PPP}     ,    # array of epochs
     408                                                ydata => $AMB{$key_ambType}{$key_sys}{$key_sat}{NUMEPO}         ,    # array of ambiguities of one satellite
    427409                                                title   => "$key_sat",
    428410                                                timefmt => '%s',
     
    431413                                        push( @datasets_epo, $dataset_epo );
    432414                                }
    433 
    434415                                # ambiguities
    435416                                $chartAMB->plot2d(@datasets_amb);
    436 
    437                                 # system ("display $pngName_amb&");
    438417                                $y = $y - $dy;
    439418                                if ( $y < 30 / mm ) {
     
    443422                                }
    444423                                $png = $page->gfx();
    445                                 LOGDIE("could not find image file: $!\n") unless -e $pngNameAMB;
    446                                 $png->image( $pdf->image_png($pngNameAMB),
    447                                         $x, $y, $width, $height );
    448 
     424                                LOGDIE("could not find image file: $!\n")
     425                                  unless -e $pngNameAMB;
     426                                $png->image( $pdf->image_png($pngNameAMB),      $x, $y, $width, $height );
    449427                                # number of epochs used for ambiguity
    450428                                $chartEPO->plot2d(@datasets_epo);
    451 
    452                                 # system ("display $pngName_epo&");
    453429                                $y = $y - $dy;
    454430                                if ( $y < 30 / mm ) {
     
    464440                        }
    465441                }
    466 
    467                 ######### ION #####################
    468                 if ( grep ( $_ eq "ALL", @plotTypes ) ) {
    469                         DEBUG "Plot ION";
    470                         $page = $pdf->page();
    471                         $page->mediabox('A4');
    472                         $y        = $y0 + $dy;
    473                         $headline = sprintf( "Ionosphere Delay for station %s", $station );
    474                         $headline_text = $page->text;
    475                         $headline_text->font( $font1, 11 / pt );
    476                         $headline_text->translate( 15 / mm, 280 / mm );
    477                         $headline_text->text($headline);
    478 
    479                         my $chartION = newChart($station);
    480                         $chartION->set( ylabel => "Ionophere Delay [m]" );
    481                         $chartION->set( legend => { position => "outside right" } );
    482 
    483                         # SYSTEM
    484                         foreach my $ksys ( sort keys %ION )
    485                         {    #print "$key_sys \n"; #print Dumper $ION{$key_sys};
     442        }
     443        ######### ION #####################
     444        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
     445                DEBUG "Plot ION";
     446                $page = $pdf->page();
     447                $page->mediabox('A4');
     448                $y             = $y0 + $dy;
     449                $headline      = sprintf( "Ionosphere Delay for station %s", $station );
     450                $headline_text = $page->text;
     451                $headline_text->font( $font1, 11 / pt );
     452                $headline_text->translate( 15 / mm, 280 / mm );
     453                $headline_text->text($headline);
     454                my $chartION = newChart("$station ($dateStr)");
     455                $chartION->set( ylabel => "Ionophere Delay [m]" );
     456                $chartION->set( legend => { position => "outside right" } );
     457                # SYSTEM
     458                foreach my $ksys ( sort keys %ION ) {
     459                        my @datasets;    # init datasets
     460                        my $pngNameION = sprintf( "%s_ION_%s.png", $station, $ksys );
     461                        $chartION->set( output => $pngNameION );
     462                        # SATELLITE
     463                        foreach my $sat ( sort keys %{ $ION{$ksys} } ) {
     464                                my $dataset = Chart::Gnuplot::DataSet->new(
     465                                        xdata => $ION{$ksys}{$sat}{EPOCH_PPP},    # array of epochs
     466                                        ydata => $ION{$ksys}{$sat}{DATA}
     467                                        ,    # array of ionvations of one satellite
     468                                        title   => "$sat",
     469                                        timefmt => '%s',
     470                                        style   => "dots",
     471                                );
     472                                push( @datasets, $dataset );
     473                        }
     474                        $chartION->plot2d(@datasets);    #system ("display $pngName&");
     475                        $y = $y - $dy;
     476                        if ( $y < 30 / mm ) {
     477                                $page = $pdf->page();
     478                                $page->mediabox('A4');
     479                                $y = $y0;
     480                        }
     481                        $png = $page->gfx();
     482                        die("could not find image file: $!") unless -e $pngNameION;
     483                        $png->image( $pdf->image_png($pngNameION), $x, $y, $width,
     484                                $height );
     485                }
     486        }
     487        ######### BIAS #####################
     488        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
     489                DEBUG "Plot BIAS";
     490                $page = $pdf->page();
     491                $page->mediabox('A4');
     492                $y             = $y0 + $dy;
     493                $headline      = sprintf( "Receiver Biases for station %s", $station );
     494                $headline_text = $page->text;
     495                $headline_text->font( $font1, 11 / pt );
     496                $headline_text->translate( 15 / mm, 280 / mm );
     497                $headline_text->text($headline);
     498                my $chartBIAS = newChart("$station ($dateStr)");
     499                $chartBIAS->set( legend => { position => "outside right" } );
     500
     501                # BIAS_TYPE   #print Dumper \%BIA;
     502                foreach my $key_biasType ( sort keys %BIA )     {    #print "key_biasType: $key_biasType \n";
     503                        foreach my $key_sys ( sort keys %{ $BIA{$key_biasType} } )      {  #print "key_sys: $key_sys \n"; #print Dumper $BIA{$key_biasType};
    486504                                my @datasets;    # init datasets
    487                                 my $pngNameION = sprintf( "%s_ION_%s.png", $station, $ksys );
    488                                 $chartION->set( output => $pngNameION );
    489 
    490                                 # SATELLITE
    491                                 foreach my $sat ( sort keys %{ $ION{$ksys} } )
    492                                 {    #print "$key_sat = $ION{$key_sys}{$key_sat} \n";
    493                                         my $dataset = Chart::Gnuplot::DataSet->new(
    494                                                 xdata => $ION{$ksys}{$sat}{EPOCH},    # array of epochs
    495                                                 ydata => $ION{$ksys}{$sat}{DATA}
    496                                                 ,    # array of ionvations of one satellite
    497                                                 title   => "$sat",
    498                                                 timefmt => '%s',
    499                                                 style   => "dots",
    500                                         );
    501                                         push( @datasets, $dataset );
    502                                 }
    503 
    504                                 $chartION->plot2d(@datasets);    #system ("display $pngName&");
     505                                my $pngNameBIA = sprintf( "%s_BIAS_%s_%s.png",
     506                                        $station, $key_biasType, $key_sys );
     507                                $chartBIAS->set( output => $pngNameBIA );
     508                                $chartBIAS->set( ylabel => "Receiver Bias $key_biasType [m]" );
     509
     510                                my $dataset = Chart::Gnuplot::DataSet->new(
     511                                        xdata   => $BIA{$key_biasType}{$key_sys}{EPOCH_PPP},
     512                                        ydata   => $BIA{$key_biasType}{$key_sys}{DATA},
     513                                        title   => "$key_sys",
     514                                        timefmt => '%s',
     515                                        style   => "dots",
     516                                );
     517                                push( @datasets, $dataset );
     518
     519                                $chartBIAS->plot2d(@datasets);
    505520                                $y = $y - $dy;
    506521                                if ( $y < 30 / mm ) {
     
    510525                                }
    511526                                $png = $page->gfx();
    512                                 die("could not find image file: $!") unless -e $pngNameION;
    513                                 $png->image( $pdf->image_png($pngNameION),
    514                                         $x, $y, $width, $height );
    515                         }
    516                 }
    517 
    518                 ######### BIAS #####################
    519                 if ( grep ( $_ eq "ALL", @plotTypes ) ) {
    520                         DEBUG "Plot BIAS";
    521                         $page = $pdf->page();
    522                         $page->mediabox('A4');
    523                         $y        = $y0 + $dy;
    524                         $headline = sprintf( "Receiver Biases for station %s", $station );
    525                         $headline_text = $page->text;
    526                         $headline_text->font( $font1, 11 / pt );
    527                         $headline_text->translate( 15 / mm, 280 / mm );
    528                         $headline_text->text($headline);
    529 
    530                         my $chartBIAS = newChart($station);
    531                         $chartBIAS->set( legend => { position => "outside right" } );
    532 
    533                         # BIAS_TYPE   #print Dumper \%BIA;
    534                         foreach my $key_biasType ( sort keys %BIA )
    535                         {    #print "key_biasType: $key_biasType \n";
    536                                 foreach my $key_sys ( sort keys %{ $BIA{$key_biasType} } ) {
    537 
    538                            #print "key_sys: $key_sys \n"; #print Dumper $BIA{$key_biasType};
    539                                         my @datasets;    # init datasets
    540                                         my $pngNameBIA = sprintf( "%s_BIAS_%s_%s.png",
    541                                                 $station, $key_biasType, $key_sys );
    542                                         $chartBIAS->set( output => $pngNameBIA );
    543                                         $chartBIAS->set(
    544                                                 ylabel => "Receiver Bias $key_biasType [m]" );
    545 
    546                                         my $dataset = Chart::Gnuplot::DataSet->new(
    547                                                 xdata   => $BIA{$key_biasType}{$key_sys}{EPOCH},
    548                                                 ydata   => $BIA{$key_biasType}{$key_sys}{DATA},
    549                                                 title   => "$key_sys",
    550                                                 timefmt => '%s',
    551                                                 style   => "dots",
    552                                         );
    553                                         push( @datasets, $dataset );
    554 
    555                                         $chartBIAS->plot2d(@datasets);
    556                                         $y = $y - $dy;
    557                                         if ( $y < 30 / mm ) {
    558                                                 $page = $pdf->page();
    559                                                 $page->mediabox('A4');
    560                                                 $y = $y0;
    561                                         }
    562                                         $png = $page->gfx();
    563                                         die("could not find image file: $!") unless -e $pngNameBIA;
    564                                         $png->image( $pdf->image_png($pngNameBIA),
    565                                                 $x, $y, $width, $height );
    566                                 }
    567                         }
    568                 }
    569 
    570                 ######### RES #####################
     527                                die("could not find image file: $!") unless -e $pngNameBIA;
     528                                $png->image( $pdf->image_png($pngNameBIA), $x, $y, $width, $height );
     529                        }
     530                }
     531        }
     532        ######### RES #####################
     533        if ( grep ( $_ eq "PPP", @plotTypes ) ) {
    571534                DEBUG "Plot Residuals";
    572535                $page = $pdf->page();
     
    578541                $headline_text->translate( 15 / mm, 280 / mm );
    579542                $headline_text->text($headline);
    580 
    581                 my $chartRES = newChart($station);
     543                my $chartRES = newChart("$station ($dateStr)");
    582544                $chartRES->set( legend => { position => "outside right" } );
    583 
    584545                # RESIDUAL_TYPE   #print Dumper \%RES;
    585                 foreach my $key_resType ( sort keys %RES )
    586                 {    #print "key_resType: $key_resType \n";
    587                                 #SYSTEM
    588                         foreach my $key_sys ( sort keys %{ $RES{$key_resType} } ) {
    589 
    590                                 #print "key_sys: $key_sys \n"; #print Dumper $RES{$key_resType};
     546                foreach my $key_resType ( sort keys %RES ){    #print "key_resType: $key_resType \n";
     547                        #SYSTEM
     548                        foreach my $key_sys ( sort keys %{ $RES{$key_resType} } ) {                             #print "key_sys: $key_sys \n"; #print Dumper $RES{$key_resType};
    591549                                my @datasets;
    592                                 my $pngNameRES = sprintf( "%s_RES_%s_%s.png",
    593                                         $station, $key_resType, $key_sys );
     550                                my $pngNameRES = sprintf( "%s_RES_%s_%s.png", $station, $key_resType, $key_sys );
    594551                                $chartRES->set( output => $pngNameRES );
    595                                 $chartRES->set( ylabel => "Residuals $key_resType [m]" );
    596 
     552                                $chartRES->set(ylabel => "Residuals $key_resType [m]" );
    597553                                if ( $key_resType =~ /^c/ ) {
    598554                                        $chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
     
    601557                                        $chartRES->set( yrange => [ " -0.06 ", " 0.06 " ] );
    602558                                }
    603 
    604559                                elsif ( $key_resType =~ /^GIM/ ) {
    605560                                        $chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
    606561                                }
    607 
    608562                                # SATELLITE
    609                                 foreach
    610                                   my $key_sat ( sort keys %{ $RES{$key_resType}{$key_sys} } )
    611                                 {
    612 
    613                                   #print "$key_sat = $RES{$key_resType}{$key_sys}{$key_sat} \n";
     563                                foreach my $key_sat ( sort keys %{ $RES{$key_resType}{$key_sys} } ) {                     #print "$key_sat = $RES{$key_resType}{$key_sys}{$key_sat} \n";
    614564                                        $dataset = Chart::Gnuplot::DataSet->new(
    615                                                 xdata => $RES{$key_resType}{$key_sys}{$key_sat}{EPOCH}
    616                                                 ,    # array of epochs
     565                                                xdata => $RES{$key_resType}{$key_sys}{$key_sat}{EPOCH_PPP},    # array of epochs
    617566                                                ydata => $RES{$key_resType}{$key_sys}{$key_sat}{DATA}
    618567                                                ,    # array of residuals of one satellite
     
    631580                                }
    632581                                $png = $page->gfx();
    633                                 LOGDIE("could not find image file: $!\n") unless -e $pngNameRES;
    634                                 $png->image( $pdf->image_png($pngNameRES),
    635                                         $x, $y, $width, $height );
    636                         }
    637                 }
    638         }    # end if ALL @plotTypes
    639 
    640         $pdf->save();
    641         $pdf->end();
    642 
    643         system("rm *.png");
    644         if (Common::amInteractiv) {
    645                 system("evince $inputDir/$pdf_name");
    646         }
     582                                LOGDIE("could not find image file: $!\n")
     583                                  unless -e $pngNameRES;
     584                                $png->image( $pdf->image_png($pngNameRES), $x, $y, $width, $height );
     585                        }
     586                }
     587        }
     588    ######### CLKCORR #####################
     589        if ( grep ( $_ eq "SSR", @plotTypes ) ) {
     590                DEBUG "Plot CLKCORR";
     591                $page = $pdf->page();
     592                $page->mediabox('A4');
     593                $y             = $y0 + $dy;
     594                $headline      = sprintf( "Clock Corrections from %s", $ssrData );
     595                $headline_text = $page->text;
     596                $headline_text->font( $font1, 11 / pt );
     597                $headline_text->translate( 15 / mm, 280 / mm );
     598                $headline_text->text($headline);
     599                my $chartCLKCORR = newChart("$station ($dateStr)");
     600                $chartCLKCORR->set( ylabel => "Clock Corrections [m]" );
     601                $chartCLKCORR->set( legend => { position => "outside right" } );
     602                # SYSTEM
     603                foreach my $ksys ( sort keys %CLKCORR ) {    #print "$key_sys \n"; #print Dumper $CLKCORR{$key_sys};
     604                        my @datasets;
     605                        my $pngNameCLKCORR = sprintf( "%s_CLKCORR_%s.png", $station, $ksys );
     606                        $chartCLKCORR->set( output => $pngNameCLKCORR );
     607                        # SATELLITE
     608                        foreach my $sat ( sort keys %{ $CLKCORR{$ksys} } ) {    #print "$key_sat = $CLKCORR{$key_sys}{$key_sat} \n";
     609                                my $dataset = Chart::Gnuplot::DataSet->new(
     610                                        xdata => $CLKCORR{$ksys}{$sat}{EPOCH_SSR}, # array of epochs
     611                                        ydata => $CLKCORR{$ksys}{$sat}{DATA},    # array of ionvations of one satellite
     612                                        title   => "$sat",
     613                                        timefmt => '%s',
     614                                        style   => "dots",
     615                                );
     616                                push( @datasets, $dataset );
     617                        }
     618                        $chartCLKCORR->plot2d(@datasets);    #system ("display $pngName&");
     619                        $y = $y - $dy;
     620                        if ( $y < 30 / mm ) {
     621                                $page = $pdf->page();
     622                                $page->mediabox('A4');
     623                                $y = $y0;
     624                        }
     625                        $png = $page->gfx();
     626                        die("could not find image file: $!") unless -e $pngNameCLKCORR;
     627                        $png->image( $pdf->image_png($pngNameCLKCORR),
     628                                $x, $y, $width, $height );
     629                }
     630        }
     631        ######### YAW ANGLE #####################
     632        if ( grep ( $_ eq "SSR", @plotTypes ) ) {
     633                DEBUG "Plot YAW";
     634                $page = $pdf->page();
     635                $page->mediabox('A4');
     636                $y = $y0 + $dy;
     637                $headline =
     638                  sprintf( "Yaw angle from %s versus Standard Model", $ssrData );
     639                $headline_text = $page->text;
     640                $headline_text->font( $font1, 11 / pt );
     641                $headline_text->translate( 15 / mm, 280 / mm );
     642                $headline_text->text($headline);
     643                # SATELLITE
     644                foreach my $sat ( sort keys %YAW_SSR ) {
     645                        my @datasets;
     646                        my $chartYAW = newChart("Yaw Angle Satellite $sat ($dateStr)");
     647                        $chartYAW->set( ylabel => "Yaw Angle [°]" );
     648                        #$chartYAW->set( legend => { position => "outside right" } );
     649                        my $pngNameYAW = sprintf( "%s_YAW_%s.png", $station, $sat );
     650                        $chartYAW->set( output => $pngNameYAW );
     651                        # YAW from SSR data
     652                        my $datasetYAW_SSR = Chart::Gnuplot::DataSet->new(
     653                                xdata => $YAW_SSR{$sat}{EPOCH_SSR},    # array of epochs
     654                                ydata => $YAW_SSR{$sat}{DATA}   ,    # array of ionvations of one satellite
     655                                title   => $ssrData,
     656                                timefmt => '%s',
     657                                style   => "line",
     658                        );
     659                        push( @datasets, $datasetYAW_SSR );
     660                        # YAW from standard model
     661                        my $datasetYAW_DEF = Chart::Gnuplot::DataSet->new(
     662                                xdata => $YAW_DEF{$sat}{EPOCH_SSR},    # array of epochs
     663                                ydata => $YAW_DEF{$sat}{DATA}   ,    # array of ionvations of one satellite
     664                                title   => "Standard Model",
     665                                timefmt => '%s',
     666                                style   => "line",
     667                        );
     668                        push( @datasets, $datasetYAW_DEF );
     669                        $chartYAW->plot2d(@datasets);
     670                        $y = $y - $dy;
     671                        if ( $y < 30 / mm ) {
     672                                $page = $pdf->page();
     673                                $page->mediabox('A4');
     674                                $y = $y0;
     675                        }
     676                        $png = $page->gfx();
     677                        die("could not find image file: $!") unless -e $pngNameYAW;
     678                        $png->image( $pdf->image_png($pngNameYAW), $x, $y, $width,      $height );
     679                }
     680        }
     681        ######### CODE BIASES #####################
     682        if ( grep ( $_ eq "SSR", @plotTypes ) ) {
     683                DEBUG "Plot Code Biases";
     684                $page = $pdf->page();
     685                $page->mediabox('A4');
     686                $y             = $y0 + $dy;
     687                $headline      = sprintf( "Code Biases from %s ", $ssrData );
     688                $headline_text = $page->text;
     689                $headline_text->font( $font1, 11 / pt );
     690                $headline_text->translate( 15 / mm, 280 / mm );
     691                $headline_text->text($headline);
     692                my $chartCB = newChart("$ssrData ($dateStr)");
     693                $chartCB->set( legend => { position => "outside right" } );
     694                foreach my $key_type ( sort keys %CODEBIAS ) {
     695                        #SYSTEM
     696                        foreach my $key_sys ( sort keys %{ $CODEBIAS{$key_type} } ) {
     697                                my @datasets;
     698                                my $pngNameCB =  sprintf( "%s_CB_%s_%s.png", $station, $key_type, $key_sys );
     699                                $chartCB->set( output => $pngNameCB );
     700                                $chartCB->set( ylabel => "Code Biases $key_type [m]" );
     701                                # SATELLITE
     702                                foreach  my $key_sat ( sort keys %{ $CODEBIAS{$key_type}{$key_sys} } )  {
     703                                        $dataset = Chart::Gnuplot::DataSet->new(
     704                                                xdata => $CODEBIAS{$key_type}{$key_sys}{$key_sat}{EPOCH_SSR},    # array of epochs
     705                                                ydata => $CODEBIAS{$key_type}{$key_sys}{$key_sat}{DATA}         ,    # array of residuals of one satellite
     706                                                title   => "$key_sat",
     707                                                timefmt => '%s',
     708                                                style   => "dots",
     709                                        );
     710                                        push( @datasets, $dataset );
     711                                }
     712                                $chartCB->plot2d(@datasets);
     713                                $y = $y - $dy;
     714                                if ( $y < 30 / mm ) {
     715                                        $page = $pdf->page();
     716                                        $page->mediabox('A4');
     717                                        $y = $y0;
     718                                }
     719                                $png = $page->gfx();
     720                                LOGDIE("could not find image file: $!\n")
     721                                  unless -e $pngNameCB;
     722                                $png->image( $pdf->image_png($pngNameCB),$x, $y, $width, $height );
     723                        }
     724                }
     725        }
     726        ######### PHASE BIASES #####################
     727        if ( grep ( $_ eq "SSR", @plotTypes ) ) {
     728                DEBUG "Plot Phase Biases";
     729                $page = $pdf->page();
     730                $page->mediabox('A4');
     731                $y             = $y0 + $dy;
     732                $headline      = sprintf( "Phase Biases from %s ", $ssrData );
     733                $headline_text = $page->text;
     734                $headline_text->font( $font1, 11 / pt );
     735                $headline_text->translate( 15 / mm, 280 / mm );
     736                $headline_text->text($headline);
     737                foreach my $key_type ( sort keys %PHASEBIAS ) {
     738                        #SYSTEM
     739                        foreach my $key_sys ( sort keys %{ $PHASEBIAS{$key_type} } ) {
     740                                my (@datasetsPB, $datasetPB);
     741                                my (@datasetsJC, $datasetJC);
     742                                my $pngNamePB =  sprintf( "%s_PB_%s_%s.png", $station, $key_type, $key_sys );
     743                                my $pngNameJC =  sprintf( "%s_JC_%s_%s.png", $station, $key_type, $key_sys );
     744                                my $chartPB = newChart("$ssrData ($dateStr)");
     745                        $chartPB->set( legend => { position => "outside right" } );
     746                                $chartPB->set( output => $pngNamePB );
     747                                $chartPB->set( ylabel => "Phase Biases $key_type [m]" );
     748                                my $chartJC = newChart("$ssrData ($dateStr)");
     749                        $chartJC->set( legend => { position => "outside right" } );
     750                                $chartJC->set( output => $pngNameJC );
     751                                $chartJC->set( ylabel => "Counter Value $key_type " );
     752                                # SATELLITE
     753                                foreach  my $key_sat ( sort keys %{ $PHASEBIAS{$key_type}{$key_sys} } ) {
     754                                        $datasetPB = Chart::Gnuplot::DataSet->new(
     755                                                xdata => $PHASEBIAS{$key_type}{$key_sys}{$key_sat}{EPOCH_SSR},    # array of epochs
     756                                                ydata => $PHASEBIAS{$key_type}{$key_sys}{$key_sat}{DATA},    # array of residuals of one satellite
     757                                                title   => "$key_sat",
     758                                                timefmt => '%s',
     759                                                style   => "linespoints",
     760                                        );
     761                                        push( @datasetsPB, $datasetPB );
     762                                        $datasetJC = Chart::Gnuplot::DataSet->new(
     763                                                xdata => $JUMPCOUNT{$key_type}{$key_sys}{$key_sat}{EPOCH_SSR},    # array of epochs
     764                                                ydata => $JUMPCOUNT{$key_type}{$key_sys}{$key_sat}{DATA},    # array of residuals of one satellite
     765                                                title   => "$key_sat",
     766                                                timefmt => '%s',
     767                                                style   => "linespoints",
     768                                        );
     769                                        push( @datasetsJC, $datasetJC );
     770                                }
     771                                #phase biases
     772                                $chartPB->plot2d(@datasetsPB);
     773                                $y = $y - $dy;
     774                                if ( $y < 30 / mm ) {
     775                                        $page = $pdf->page();
     776                                        $page->mediabox('A4');
     777                                        $y = $y0;
     778                                }
     779                                $png = $page->gfx();
     780                                LOGDIE("could not find image file: $!\n")
     781                                  unless -e $pngNamePB;
     782                                $png->image( $pdf->image_png($pngNamePB),$x, $y, $width, $height );
     783                                #jump counter
     784                                $chartJC->plot2d(@datasetsJC);
     785                                $y = $y - $dy;
     786                                if ( $y < 30 / mm ) {
     787                                        $page = $pdf->page();
     788                                        $page->mediabox('A4');
     789                                        $y = $y0;
     790                                }
     791                                $png = $page->gfx();
     792                                LOGDIE("could not find image file: $!\n")
     793                                  unless -e $pngNameJC;
     794                                $png->image( $pdf->image_png($pngNameJC),$x, $y, $width, $height );
     795                        }
     796                }
     797        }
     798
     799$pdf->save();
     800$pdf->end();
     801
     802system("rm *.png");
     803if (Common::amInteractiv) {
     804        system("evince $inputDir/$pdf_name");
     805}
     806
    647807}    # -----  next logfile  -----
    648808
     
    653813                terminal => 'png',
    654814                title    => $title,
    655                 xlabel   => "Time [h]",
    656815                timeaxis => 'x',
     816        xlabel   => "Time [h]",
    657817                xtics    => { labelfmt => '%H:%M', rotate => '-270' },
     818                #xtics    => { labelfmt => '%H:%M\n%m-%d', rotate => '-270'},
    658819                grid     => 'on',
    659820        );
     
    668829
    669830OPTIONS:
    670   -p, --plotTypes    ALL or NEU (default)
     831  -p, --plotTypes    PPP or SSR (requires PPP files in debug mode)
    671832  -l, --logFiles     comma separated list of BNC's PPP logfiles
    672833  -s, --sampling     sampling interval in seconds for the logfile data (default: 1); for a daily logfile <30> seconds should be usefull
     
    674835
    675836EXAMPLES:
    676   $prog --plotTypes ALL -s 30 -l /path/to/FFMJ186730.ppp
     837  $prog --plotTypes PPP -s 30 -l /path/to/FFMJ186730.ppp
    677838
    6788392021 andrea.stuerze\@bkg.bund.de
Note: See TracChangeset for help on using the changeset viewer.