Changeset 10806 in ntrip for trunk/BNC/scripts/Bnc.pm


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

SSR debug info added

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.