Changeset 10806 in ntrip for trunk/BNC/scripts/Bnc.pm
- Timestamp:
- Feb 4, 2026, 8:42:15 AM (6 days ago)
- File:
-
- 1 edited
-
trunk/BNC/scripts/Bnc.pm (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/scripts/Bnc.pm
r10798 r10806 395 395 if ( $hlp[14] eq '-nan' 396 396 || $hlp[15] eq '-nan' 397 || $hlp[16] eq '-nan' ) 398 { 397 || $hlp[16] eq '-nan' ) { 399 398 WARN("$hlp[2] $hlp[3]: NEU displacements are NAN"); 400 399 next; … … 503 502 # $logMode [optional] Flag. If set, remember the position of the file-read 504 503 # for the next read. Default: off 505 # Return : $ station,\%data504 # Return : $dateStr, $station, $ssrData \%data 506 505 # ============================================================================= 507 506 sub parsePPPLogfile { … … 517 516 $startSec = time() - $goBackSecs; 518 517 } 519 my $epo; 518 my $epo_ppp; 520 519 my $old_epochSec = 0; 521 520 my $epochSec = 0; 522 521 my $epochDiff = 0; 522 523 my ( @EPOCH_PPP); 523 524 my ( @hlp, @N, @E, @U, @ISFIX, @NUMFIX, @TRP ); 524 my ( @EPOCH, );525 525 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 527 539 open( my $fh, "<", $file ) || LOGDIE "Could not open file $file: $!\n"; 528 540 … … 536 548 while (<$fh>) { 537 549 chomp( $ln = $_ ); 538 539 550 if ( $ln =~ /\bof Epoch\b/ ) { 540 541 551 # 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' ); 550 564 $epochSec = $tp->epoch(); 551 565 $epochDiff = $epochSec - $old_epochSec; … … 553 567 } 554 568 555 next if ( !$epo ); 569 next if ( !$epo_ppp ); 556 570 next if ( defined $startSec && $epochSec < $startSec ); 557 571 next if ( $epochDiff && $epochDiff < $sampling ); 558 572 559 573 @hlp = split( /\s+/, $ln ); 560 my $numFix = 0; 561 my $isFix; 562 my $strFix = "fix"; 574 563 575 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 ); 565 578 $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 ); 568 580 $station = $hlp[1]; 569 581 my $numFix = 0; 582 my $isFix; 583 my $strFix = "fix"; 570 584 if ( $hlp[19] eq '-nan' 571 585 || $hlp[24] eq '-nan' 572 || $hlp[29] eq '-nan' ) 573 { 586 || $hlp[29] eq '-nan' ) { 574 587 WARN("$hlp[0] $station: NEU displacements are NAN"); 575 588 } 576 577 589 push @N, $hlp[19]; 578 590 push @E, $hlp[24]; … … 590 602 push @NUMFIX, $numFix; 591 603 } 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 595 605 $lki = $hlp[2]; 596 606 $sat = $hlp[3]; 597 607 $sys = substr( $sat, 0, 1 ); 598 608 $amb = $hlp[4] + $hlp[5]; 599 push @{ $AMB{$lki}{$sys}{$sat}{EPOCH} }, $epochSec; 609 push @{ $AMB{$lki}{$sys}{$sat}{EPOCH_PPP} }, $epochSec; 600 610 push @{ $AMB{$lki}{$sys}{$sat}{DATA} }, $amb; 601 611 push @{ $AMB{$lki}{$sys}{$sat}{NUMEPO} }, $hlp[13]; 602 push @{ $ELE{$sys}{$sat}{EPOCH} }, $epochSec; 612 push @{ $ELE{$sys}{$sat}{EPOCH_PPP} }, $epochSec; 603 613 push @{ $ELE{$sys}{$sat}{DATA} }, $hlp[10]; 604 614 } 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 608 616 $sat = $hlp[3]; 609 617 $lki = $hlp[2]; … … 611 619 612 620 #print "$epo $lki $sys $sat $res\n"; 613 push @{ $RES{$lki}{$sys}{$sat}{EPOCH} }, $epochSec; 621 push @{ $RES{$lki}{$sys}{$sat}{EPOCH_PPP} }, $epochSec; 614 622 push @{ $RES{$lki}{$sys}{$sat}{DATA} }, $hlp[4]; 615 623 } 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 619 625 $sat = $hlp[2]; 620 626 $sys = substr( $sat, 0, 1 ); 621 push @{ $ION{$sys}{$sat}{EPOCH} }, $epochSec; 627 push @{ $ION{$sys}{$sat}{EPOCH_PPP} }, $epochSec; 622 628 push @{ $ION{$sys}{$sat}{DATA} }, $hlp[4]; 623 629 } 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 627 631 $lki = $hlp[2]; 628 632 $sys = $hlp[3]; 629 push @{ $BIA{$lki}{$sys}{EPOCH} }, $epochSec; 633 push @{ $BIA{$lki}{$sys}{EPOCH_PPP} }, $epochSec; 630 634 push @{ $BIA{$lki}{$sys}{DATA} }, $hlp[4] + $hlp[5]; 631 635 } … … 636 640 push( @TRP, $hlp[2] + $hlp[3] ); 637 641 } 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 641 643 $sys = $hlp[2]; 642 push @{ $RECCLK{$sys}{EPOCH} }, $epochSec; 644 push @{ $RECCLK{$sys}{EPOCH_PPP} }, $epochSec; 643 645 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 } 644 728 } 645 729 } # ----- next line ----- … … 648 732 close $fh; 649 733 650 my $nof_epochs = scalar @EPOCH; 734 my $nof_epochs = scalar @EPOCH_PPP; 651 735 DEBUG( "$station: epochs:$nof_epochs, North displac.: " 652 736 . scalar @N … … 671 755 672 756 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, 687 778 ); 688 779 689 return ( $station, \%data, 0 ); 780 return ($dateStr, $station, $ssrData, \%data, 0 ); 690 781 } 691 782
Note:
See TracChangeset
for help on using the changeset viewer.
