Changeset 10585 in ntrip for trunk/BNC/scripts
- Timestamp:
- Dec 10, 2024, 3:55:40 PM (7 days ago)
- Location:
- trunk/BNC/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/scripts/Bnc.pm
r10514 r10585 493 493 my $epochSec = 0; 494 494 my $epochDiff = 0; 495 my ( @hlp, @N, @E, @U, %SATNUM, @TRP , @CLK, @OFF_GPS, @OFF_GLO, @OFF_GAL, @OFF_BDS);496 my ( @EPOCH, @EPOCH_CLK, @EPOCH_OFF_GPS, @EPOCH_OFF_GLO, @EPOCH_OFF_GAL, @EPOCH_OFF_BDS);497 my ( % AMB, %RES, %ELE, %ION, %BIA);498 my ( $station, $lki, $sys, $sat, $amb);495 my ( @hlp, @N, @E, @U, %SATNUM, @TRP); 496 my ( @EPOCH, ); 497 my ( %RECCLK, %AMB, %RES, %ELE, %ION, %BIA); 498 my ( $station, $lki, $sys, $sat, $amb); 499 499 open ( my $fh, "<", $file ) || LOGDIE "Could not open file $file: $!\n"; 500 500 … … 584 584 push @{ $BIA{$lki}{$sys}{DATA} }, $hlp[4] + $hlp[5]; 585 585 } 586 elsif ( $ln =~ /\bREC_CLK\b/ ) {587 push ( @EPOCH_CLK, $epochSec );588 push ( @CLK, $hlp[2] + $hlp[3] );589 }590 elsif ( $ln =~ /\bOFF_GPS\b/ ) { # 2015-08... OFF_GPS 52.6806 -3.8042 +- 9.0077591 push ( @EPOCH_OFF_GPS, $epochSec );592 push ( @OFF_GPS, $hlp[2] + $hlp[3] );593 }594 elsif ( $ln =~ /\bOFF_GLO\b/ ) { # 2015-08... OFF_GLO 52.6806 -3.8042 +- 9.0077595 push ( @EPOCH_OFF_GLO, $epochSec );596 push ( @OFF_GLO, $hlp[2] + $hlp[3] );597 }598 elsif ( $ln =~ /\bOFF_GAL\b/ ) { # 2015-08... OFF_GAL 52.6806 -3.8042 +- 9.0077599 push ( @EPOCH_OFF_GAL, $epochSec );600 push ( @OFF_GAL, $hlp[2] + $hlp[3] );601 }602 elsif ( $ln =~ /\bOFF_BDS\b/ ) { # 2015-08... OFF_BDS 52.6806 -3.8042 +- 9.0077603 push ( @EPOCH_OFF_BDS, $epochSec );604 push ( @OFF_BDS, $hlp[2] + $hlp[3] );605 }606 586 elsif ( $ln =~ /\bSATNUM\b/ ) { # 2015-09... SATNUM G 8 607 587 push ( @{ $SATNUM{ $hlp[2] } }, $hlp[3] ); … … 609 589 elsif ( $ln =~ /\bTRP\b/ ) { # 2015-08... TRP 2.3803 +0.1009 +- 0.0324 610 590 push ( @TRP, $hlp[2] + $hlp[3] ); 591 } 592 elsif ( $ln =~ /\bREC_CLK\b/) { 593 # 2024-10-20_03:57:30.000 RECCLK G 0.0000 -1.7861 +- 0.5268 594 $sys = $hlp[2]; 595 push @{ $RECCLK{$sys}{EPOCH} }, $epochSec; 596 push @{ $RECCLK{$sys}{DATA} }, $hlp[3] + $hlp[4]; 611 597 } 612 598 } # ----- next line ----- … … 627 613 if ( $nof_epochs != scalar @N ) { LOGDIE "number of epochs and residuals not equal\n" } 628 614 if ( $nof_epochs != scalar @TRP ) { LOGDIE "number of epochs and TRP not equal\n" } 629 if ( @CLK && scalar @EPOCH_CLK != scalar @CLK ) { LOGDIE "number of epochs and CLK not equal\n" } 630 if ( @OFF_GPS && scalar @EPOCH_OFF_GPS != scalar @OFF_GPS ) { LOGDIE "number of epochs and OFF_GPS not equal\n" } 631 if ( @OFF_GLO && scalar @EPOCH_OFF_GLO != scalar @OFF_GLO ) { LOGDIE "number of epochs and OFF_GLO not equal\n" } 632 if ( @OFF_GAL && scalar @EPOCH_OFF_GAL != scalar @OFF_GAL ) { LOGDIE "number of epochs and OFF_GAL not equal\n" } 633 if ( @OFF_BDS && scalar @EPOCH_OFF_BDS != scalar @OFF_BDS ) { LOGDIE "number of epochs and OFF_BDS not equal\n" } 615 634 616 635 617 if ( !$station ) { WARN "could not grep stationname from file: $file\n" } … … 642 624 SATNUM => \%SATNUM, 643 625 TRP => \@TRP, 644 CLK => \@CLK, 645 OFF_GPS => \@OFF_GPS, 646 OFF_GLO => \@OFF_GLO, 647 OFF_GAL => \@OFF_GAL, 648 OFF_BDS => \@OFF_BDS, 626 RECCLK => \%RECCLK, 649 627 RES => \%RES, 650 628 AMB => \%AMB, -
trunk/BNC/scripts/pppPlot.pl
r10388 r10585 107 107 my ( $station, $file ) = Bnc::parsePPPLogfile( $file, $sampling ); 108 108 my $EPOCH = $file->{'EPOCH'}; 109 my $EPOCH_OFF_GPS = $file->{'EPOCH_OFF_GPS'}; 110 my $EPOCH_OFF_GLO = $file->{'EPOCH_OFF_GLO'}; 111 my $EPOCH_OFF_GAL = $file->{'EPOCH_OFF_GAL'}; 112 my $EPOCH_OFF_BDS = $file->{'EPOCH_OFF_BDS'}; 113 my $EPOCH_CLK = $file->{'EPOCH_CLK'}; 109 my %RECCLK = %{ $file->{'RECCLK'} }; 114 110 my %AMB = %{ $file->{'AMB'} }; 115 111 my %RES = %{ $file->{'RES'} }; … … 154 150 my $chartNEU = newChart($station); 155 151 $chartNEU->set( output => $pngName ); 156 $chartNEU->set( ylabel => "Displacements [m]", yrange => [ " -0. 5 ", " 0.5" ] );152 $chartNEU->set( ylabel => "Displacements [m]", yrange => [ " -0.9 ", " 0.9 " ] ); 157 153 158 154 #y2label => "Number of Satellites [-]", y2range => [" 0 ", " 20 "], y2tics => 'on', … … 213 209 $png->image( $pdf->image_png($pngName), $x, $y, $width, $height ); 214 210 215 ######### CLK ##################### 216 if ( scalar @{ $file->{'CLK'} } < 1 ) { 217 DEBUG "No CLK found"; 218 } 219 else { 220 DEBUG "Plot CLK"; 221 $pngName = sprintf ( "%s_CLK.png", $station ); 222 my $chartCLK = newChart($station); 223 $chartCLK->set( output => $pngName ); 224 $chartCLK->set( ylabel => "CLK [m]" ); 225 226 $dataset = Chart::Gnuplot::DataSet->new( 227 xdata => $EPOCH, 228 ydata => $file->{'CLK'}, 229 title => "Receiver clock", 230 timefmt => '%s', 231 style => "linespoints", 232 ); 233 $chartCLK->plot2d($dataset); 211 ######### RECCLK ##################### 212 DEBUG "Plot Receiver Clocks"; 213 $page = $pdf->page(); 214 $page->mediabox('A4'); 215 $y = $y0 + $dy; 216 $headline = sprintf ( "Receiver Clocks for station %s", $station ); 217 $headline_text = $page->text; 218 $headline_text->font( $font1, 11 / pt ); 219 $headline_text->translate( 15 / mm, 280 / mm ); 220 $headline_text->text($headline); 221 222 my $chartRECCLK = newChart($station); 223 $chartRECCLK->set( legend => { position => "outside right" } ); 224 my @datasets = (); # init datasets 225 my $pngName = sprintf ( "%s_RECCLK.png", $station); 226 $chartRECCLK->set( output => $pngName ); 227 $chartRECCLK->set( ylabel => "Receiver Clocks [m]" ); 228 # SYSTEM 229 foreach my $key_sys ( sort keys %RECCLK ) { 230 231 $dataset = Chart::Gnuplot::DataSet->new( 232 xdata => \@{ $RECCLK{$key_sys}{EPOCH} }, # array of epochs 233 ydata => \@{ $RECCLK{$key_sys}{DATA} }, # array of elevations of one satellite 234 title => "$key_sys", 235 timefmt => '%s', 236 237 #style => "points", 238 style => "points", 239 ); 240 push ( @datasets, $dataset ); 241 } 242 $chartRECCLK->plot2d(@datasets); 243 244 # system ("display $pngName&"); 234 245 $y = $y - $dy; 235 236 246 if ( $y < 30 / mm ) { 237 247 $page = $pdf->page(); … … 240 250 } 241 251 $png = $page->gfx(); 242 LOGDIE("could not find image file: $!\n") unless -e $pngName;252 die ("could not find image file: $!") unless -e $pngName; 243 253 $png->image( $pdf->image_png($pngName), $x, $y, $width, $height ); 244 }245 246 ######### OFF_GPS #####################247 if ( grep ( $_ eq "ALL", @plotTypes ) ) {248 if ( scalar @{ $file->{'OFF_GPS'} } < 1 ) {249 DEBUG "No OFF_GPS found";250 }251 else {252 DEBUG "Plot OFF_GPS";253 my $pngName = sprintf ( "%s_OFF_G.png", $station );254 my $chartOFF_GPS = newChart($station);255 $chartOFF_GPS->set( output => $pngName );256 $chartOFF_GPS->set( ylabel => "Offset GPS [m]" );257 258 $dataset = Chart::Gnuplot::DataSet->new(259 xdata => $EPOCH_OFF_GPS,260 ydata => $file->{'OFF_GPS'},261 title => "Receiver Offset GPS",262 timefmt => '%s',263 style => "linespoints",264 );265 $chartOFF_GPS->plot2d($dataset); #system ("display $pngName&");266 $y = $y - $dy;267 268 if ( $y < 30 / mm ) {269 $page = $pdf->page();270 $page->mediabox('A4');271 $y = $y0;272 }273 $png = $page->gfx();274 LOGDIE("could not find image file: $!\n") unless -e $pngName;275 $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );276 }277 }278 279 280 ######### OFF_GLO #####################281 if ( grep ( $_ eq "ALL", @plotTypes ) ) {282 if ( scalar @{ $file->{'OFF_GLO'} } < 1 ) {283 DEBUG "No OFF_GLO found";284 }285 else {286 DEBUG "Plot OFF_GLO";287 my $pngName = sprintf ( "%s_OFF_R.png", $station );288 my $chartOFF_GLO = newChart($station);289 $chartOFF_GLO->set( output => $pngName );290 $chartOFF_GLO->set( ylabel => "Offset GLONASS [m]" );291 292 $dataset = Chart::Gnuplot::DataSet->new(293 xdata => $EPOCH_OFF_GLO,294 ydata => $file->{'OFF_GLO'},295 title => "Receiver Offset GLONASS",296 timefmt => '%s',297 style => "linespoints",298 );299 $chartOFF_GLO->plot2d($dataset); #system ("display $pngName&");300 $y = $y - $dy;301 302 if ( $y < 30 / mm ) {303 $page = $pdf->page();304 $page->mediabox('A4');305 $y = $y0;306 }307 $png = $page->gfx();308 LOGDIE("could not find image file: $!\n") unless -e $pngName;309 $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );310 }311 }312 313 ######### OFF_GAL #####################314 if ( grep ( $_ eq "ALL", @plotTypes ) ) {315 if ( scalar @{ $file->{'OFF_GAL'} } < 1 ) {316 DEBUG "No OFF_GAL found";317 }318 else {319 DEBUG "Plot OFF_GAL";320 my $pngName = sprintf ( "%s_OFF_E.png", $station );321 my $chartOFF_GAL = newChart($station);322 $chartOFF_GAL->set( output => $pngName );323 $chartOFF_GAL->set( ylabel => "Offset Galileo [m]" );324 325 $dataset = Chart::Gnuplot::DataSet->new(326 xdata => $EPOCH_OFF_GAL,327 ydata => $file->{'OFF_GAL'},328 title => "Receiver Offset Galileo",329 timefmt => '%s',330 style => "linespoints",331 );332 $chartOFF_GAL->plot2d($dataset); #system ("display $pngName&");333 $y = $y - $dy;334 335 if ( $y < 30 / mm ) {336 $page = $pdf->page();337 $page->mediabox('A4');338 $y = $y0;339 }340 $png = $page->gfx();341 LOGDIE("could not find image file: $!\n") unless -e $pngName;342 $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );343 }344 }345 346 ######### OFF_BDS #####################347 if ( grep ( $_ eq "ALL", @plotTypes ) ) {348 if ( scalar @{ $file->{'OFF_BDS'} } < 1 ) {349 DEBUG "No OFF_BDS found";350 }351 else {352 DEBUG "Plot OFF_BDS";353 my $pngName = sprintf ( "%s_OFF_C.png", $station );354 my $chartOFF_BDS = newChart($station);355 $chartOFF_BDS->set( output => $pngName );356 $chartOFF_BDS->set( ylabel => "Offset Beidou [m]" );357 358 $dataset = Chart::Gnuplot::DataSet->new(359 xdata => $EPOCH_OFF_BDS,360 ydata => $file->{'OFF_BDS'},361 title => "Receiver Offset Beidou",362 timefmt => '%s',363 style => "linespoints",364 );365 $chartOFF_BDS->plot2d($dataset); #system ("display $pngName&");366 $y = $y - $dy;367 368 if ( $y < 30 / mm ) {369 $page = $pdf->page();370 $page->mediabox('A4');371 $y = $y0;372 }373 $png = $page->gfx();374 LOGDIE("could not find image file: $!\n") unless -e $pngName;375 $png->image( $pdf->image_png($pngName), $x, $y, $width, $height );376 }377 }378 254 379 255 ######### ELE ##################### … … 698 574 $pdf->end(); 699 575 700 system ("rm *.png");576 # system ("rm *.png"); 701 577 if (Common::amInteractiv ) { 702 578 system ("evince $inputDir/$pdf_name");
Note:
See TracChangeset
for help on using the changeset viewer.