Changeset 9679 in ntrip
- Timestamp:
- Apr 7, 2022, 4:46:56 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/scripts/sot.pl
r9672 r9679 2 2 3 3 # 4 # sot.pl - parse BNC logfile and create *.sot files that contain the observation types for each GNSS in RINEX header format4 # sot.pl - parse BNC logfile(s) and create *.sot files that contain the observation types for each GNSS in RINEX header format 5 5 # 6 # Revision: $Header :$6 # Revision: $Header$ 7 7 # 8 8 … … 19 19 $opts{h} && HELP_MESSAGE(); 20 20 my $caster = $opts{n} ? $opts{n} : ""; 21 22 my $logFil = $ARGV[0]; 23 if ( !$logFil ) { 21 if ( scalar @ARGV < 1 ) { 24 22 warn "usage error: no BNC logfile given\n"; 25 23 HELP_MESSAGE(); 26 24 } 25 my @logFiles = @ARGV; 27 26 28 27 my %obsTyps_of; 29 open ( my $inp, '<', $logFil ) || die ("could not open file '$logFil': $!");30 while (<$inp>) {31 if ( $_ =~ /Observation Types:/ ) { # 16-03-21 10:25:38 MARS0: Observation Types: R 6 C1C L1C S1C C2P L2P S2P32 chomp;33 my @fields = split ( /\s+/, $_ );34 my $mp = $fields[2];35 $mp =~ s/:$//;36 my $satSys = $fields[5];37 my @obsTyps = @fields[ 7 .. $#fields ];38 $obsTyps_of{$mp}->{$satSys} = \@obsTyps;39 28 40 # Check obs types 41 if ( $satSys eq "G" ) { # GPS see #65 42 foreach my $otp (@obsTyps) { 43 if ( $otp eq "L2P" || $otp eq "C2P" ) { 44 warn ("$_: Observation Types 'L2P' and/or 'C2P' are not reasonable for GPS\n"); 29 # Parse each logfile 30 foreach my $logfile (@logFiles) { 31 my $inp; 32 if ( !open ( $inp, '<', $logfile ) ) { 33 warn "could not open file '$logfile': $!"; 34 next; 35 } 36 while (<$inp>) { 37 38 # # 16-03-21 10:25:38 MARS0: Observation Types: R 6 C1C L1C S1C C2P L2P S2P 39 if ( $_ =~ /Observation Types:/ ) { 40 chomp; 41 my @fields = split ( /\s+/, $_ ); 42 my $mp = $fields[2]; 43 $mp =~ s/:$//; 44 my $satSys = $fields[5]; 45 my @obsTyps = @fields[ 7 .. $#fields ]; 46 $obsTyps_of{$mp}->{$satSys} = \@obsTyps; 47 48 # Check obs types 49 if ( $satSys eq "G" ) { # GPS see #65 50 foreach my $otp (@obsTyps) { 51 if ( $otp eq "L2P" || $otp eq "C2P" ) { 52 warn ("$_: Observation Types 'L2P' and/or 'C2P' are not reasonable for GPS\n"); 53 } 45 54 } 46 55 } 47 56 } 48 57 } 58 close ($inp); 49 59 } 50 close ($inp);51 60 52 61 # Write .sot files … … 104 113 sub HELP_MESSAGE { 105 114 print <<EOI_HILFE; 106 $prog - parse observation types from BNC's logfile and write them as *.sot files115 $prog - parse observation types from BNC's logfile(s) and write them as *.sot files 107 116 108 117 USAGE: 109 $prog [OPTIONS] <bnc-logfil >118 $prog [OPTIONS] <bnc-logfiles> 110 119 111 120 OPTIONS: … … 114 123 115 124 EXAMPLES: 116 $prog -n euref-ip.net /home/user/log/ scanRTCM_EUREF-IP.log125 $prog -n euref-ip.net /home/user/log/bnc*.log 117 126 118 127 EOI_HILFE
Note:
See TracChangeset
for help on using the changeset viewer.