Changeset 10585 in ntrip for trunk/BNC/scripts/pppPlot.pl
- Timestamp:
- Dec 10, 2024, 3:55:40 PM (7 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.