| 1 | #!/usr/bin/env perl
|
|---|
| 2 |
|
|---|
| 3 | # ========================================================================
|
|---|
| 4 | # pppPlot.pl - plot BNC's PPP results using gnuplot
|
|---|
| 5 | # ========================================================================
|
|---|
| 6 | #
|
|---|
| 7 | # Plot metrics:
|
|---|
| 8 | # - NEU displacements w.r.t. coordinates in Crd file
|
|---|
| 9 | # - A-priori + correction values of tropospheric zenith delay in [m],
|
|---|
| 10 | # - Receiver clock error and offsets in [m],
|
|---|
| 11 | # - Elevations, given per satellite
|
|---|
| 12 | # - Ambiguities, given per satellite
|
|---|
| 13 | # - Ionosphere Delay [m],
|
|---|
| 14 | # - Receiver Bias [m]
|
|---|
| 15 | # - Code and phase residuals in [m],
|
|---|
| 16 | #
|
|---|
| 17 | # Author : Andrea Stuerze
|
|---|
| 18 | # Revision: $Header: trunk/BNC/scripts/pppPlot.pl 10809 2026-02-09 09:45:42Z stuerze $
|
|---|
| 19 | # Changes :
|
|---|
| 20 | # ========================================================================
|
|---|
| 21 |
|
|---|
| 22 | # Uses
|
|---|
| 23 | use strict;
|
|---|
| 24 | use warnings;
|
|---|
| 25 |
|
|---|
| 26 | BEGIN {
|
|---|
| 27 | use FindBin qw($Bin);
|
|---|
| 28 | use lib "$Bin";
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | use diagnostics;
|
|---|
| 32 | use PDL;
|
|---|
| 33 | use FindBin qw($Bin);
|
|---|
| 34 | use Getopt::Long;
|
|---|
| 35 | use Chart::Gnuplot;
|
|---|
| 36 | use Data::Dumper qw(Dumper);
|
|---|
| 37 | use File::Basename;
|
|---|
| 38 | use Date::Manip;
|
|---|
| 39 | use Log::Log4perl qw(:easy);
|
|---|
| 40 | use PDF::API2;
|
|---|
| 41 |
|
|---|
| 42 | use Bnc;
|
|---|
| 43 | use Common;
|
|---|
| 44 |
|
|---|
| 45 | use constant {
|
|---|
| 46 | mm => 25.4 / 72,
|
|---|
| 47 | inch => 1 / 72,
|
|---|
| 48 | pt => 1,
|
|---|
| 49 | }; # There are 72 postscript points in an inch and there are 25.4 millimeters in an inch.
|
|---|
| 50 |
|
|---|
| 51 | # Logging
|
|---|
| 52 | Log::Log4perl->easy_init(
|
|---|
| 53 | {
|
|---|
| 54 |
|
|---|
| 55 | #file => "plotPPP.log",
|
|---|
| 56 | layout => '%d [%c l%L] %p: %m%n',
|
|---|
| 57 | level => $TRACE
|
|---|
| 58 | }
|
|---|
| 59 | );
|
|---|
| 60 |
|
|---|
| 61 | # Options
|
|---|
| 62 | my ($prog) = fileparse($0);
|
|---|
| 63 | my $help = 0;
|
|---|
| 64 | my @plotTypes = ();
|
|---|
| 65 | my @logFiles = ();
|
|---|
| 66 | my $sampling = 1;
|
|---|
| 67 |
|
|---|
| 68 | GetOptions(
|
|---|
| 69 | 'help' => \$help,
|
|---|
| 70 | 'plotTypes=s' => \@plotTypes,
|
|---|
| 71 | 'logFiles=s' => \@logFiles,
|
|---|
| 72 | 'sampling=s' => \$sampling,
|
|---|
| 73 | );
|
|---|
| 74 |
|
|---|
| 75 | HELP_MESSAGE() if $help;
|
|---|
| 76 | @plotTypes = qw(NEU) unless (@plotTypes);
|
|---|
| 77 | @plotTypes = map { uc } split( /[, ]/, join( ',', @plotTypes ) );
|
|---|
| 78 | @logFiles = split( /[, ]/, join( ',', @logFiles ) );
|
|---|
| 79 | unless (@logFiles) { ERROR "logfiles missing"; HELP_MESSAGE() }
|
|---|
| 80 | DEBUG(
|
|---|
| 81 | "\n plotTpes: @plotTypes\n logfiles: @logFiles\n sampling: $sampling"
|
|---|
| 82 | );
|
|---|
| 83 |
|
|---|
| 84 | # -----------------------------------------------------------------------------
|
|---|
| 85 | # Generate data sets for gnuplot
|
|---|
| 86 | # -----------------------------------------------------------------------------
|
|---|
| 87 | # for pdf gerneration
|
|---|
| 88 | my ( $png, $page, $headline, $headline_text );
|
|---|
| 89 | my $y0 = 180 / mm;
|
|---|
| 90 | my ( $x, $y, $width, $height ) = ( 40 / mm, $y0, 130 / mm, 80 / mm );
|
|---|
| 91 | my $dy = $height + 10 / mm;
|
|---|
| 92 |
|
|---|
| 93 | # Loop over logfiles
|
|---|
| 94 | foreach my $file (@logFiles) {
|
|---|
| 95 | DEBUG "Parse logfile $file";
|
|---|
| 96 |
|
|---|
| 97 | # -----------------------------------------------------------------------------
|
|---|
| 98 | # Create pdf for plot results
|
|---|
| 99 | # -----------------------------------------------------------------------------
|
|---|
| 100 | my ( $inputFilename, $inputDir, $inputSuffix ) = fileparse( $file, '\..*' );
|
|---|
| 101 | my $pdf_name = sprintf( "%s.pdf", $inputFilename );
|
|---|
| 102 | my $pdf = PDF::API2->new( -file => "$inputDir$pdf_name" );
|
|---|
| 103 | my $font1 = $pdf->corefont('Helvetica-Bold');
|
|---|
| 104 |
|
|---|
| 105 | # -----------------------------------------------------------------------------
|
|---|
| 106 | # Read logfile
|
|---|
| 107 | # -----------------------------------------------------------------------------
|
|---|
| 108 | my ( $dateStr, $station, $ssrData, $file ) = Bnc::parsePPPLogfile( $file, $sampling );
|
|---|
| 109 | print "TEST: $ssrData\n";
|
|---|
| 110 | # PPP #
|
|---|
| 111 | my $EPOCH_PPP = $file->{'EPOCH_PPP'};
|
|---|
| 112 | my $N = $file->{'N'};
|
|---|
| 113 | my $E = $file->{'E'};
|
|---|
| 114 | my $U = $file->{'U'};
|
|---|
| 115 | my $ISFIX = $file->{'ISFIX'};
|
|---|
| 116 | my $NUMFIX = $file->{'NUMFIX'};
|
|---|
| 117 | my %RECCLK = %{ $file->{'RECCLK'} };
|
|---|
| 118 | my %AMB = %{ $file->{'AMB'} };
|
|---|
| 119 | my %RES = %{ $file->{'RES'} };
|
|---|
| 120 | my %ELE = %{ $file->{'ELE'} };
|
|---|
| 121 | my %ION = %{ $file->{'ION'} };
|
|---|
| 122 | my %BIA = %{ $file->{'BIA'} };
|
|---|
| 123 |
|
|---|
| 124 | # SSR #
|
|---|
| 125 | my $EPOCH_SSR = $file->{'EPOCH_SSR'};
|
|---|
| 126 | my %CLKCORR = %{ $file->{'CLKCORR'} };
|
|---|
| 127 | my %YAW_SSR = %{ $file->{'YAW_SSR'} };
|
|---|
| 128 | my %YAW_DEF = %{ $file->{'YAW_DEF'} };
|
|---|
| 129 | my %CODEBIAS = %{ $file->{'CODEBIAS'} };
|
|---|
| 130 | my %PHASEBIAS = %{ $file->{'PHASEBIAS'} };
|
|---|
| 131 | my %JUMPCOUNT = %{ $file->{'JUMPCOUNT'}};
|
|---|
| 132 |
|
|---|
| 133 | # -----------------------------------------------------------------------------
|
|---|
| 134 | # RMS computation
|
|---|
| 135 | # -----------------------------------------------------------------------------
|
|---|
| 136 | my (
|
|---|
| 137 | $mean, $prms, $median, $min, $max,
|
|---|
| 138 | $adev, $rms_n, $rms_e, $rms_u, $rms_trp
|
|---|
| 139 | );
|
|---|
| 140 | my ( $n, $e, $u, $trp, $str_rms_n, $str_rms_e, $str_rms_u, $str_rms_trp );
|
|---|
| 141 | $n = pdl( $file->{'N'} );
|
|---|
| 142 | ( $mean, $prms, $median, $min, $max, $adev, $rms_n ) = stats($n);
|
|---|
| 143 | $e = pdl( $file->{'E'} );
|
|---|
| 144 | ( $mean, $prms, $median, $min, $max, $adev, $rms_e ) = stats($e);
|
|---|
| 145 | $u = pdl( $file->{'U'} );
|
|---|
| 146 | ( $mean, $prms, $median, $min, $max, $adev, $rms_u ) = stats($u);
|
|---|
| 147 | $trp = pdl( $file->{'TRP'} );
|
|---|
| 148 | ( $mean, $prms, $median, $min, $max, $adev, $rms_trp ) = stats($trp);
|
|---|
| 149 | $str_rms_n = sprintf( " %.2f ", $rms_n );
|
|---|
| 150 | $str_rms_e = sprintf( " %.2f ", $rms_e );
|
|---|
| 151 | $str_rms_u = sprintf( " %.2f ", $rms_u );
|
|---|
| 152 | $str_rms_trp = sprintf( " %.2f ", $rms_trp );
|
|---|
| 153 | DEBUG(
|
|---|
| 154 | "RMS: North: $str_rms_n, East: $str_rms_e, Up: $str_rms_u, TRP: $str_rms_trp"
|
|---|
| 155 | );
|
|---|
| 156 |
|
|---|
| 157 | # -----------------------------------------------------------------------------
|
|---|
| 158 | # Plot several data sets
|
|---|
| 159 | # -----------------------------------------------------------------------------
|
|---|
| 160 | my $dataset;
|
|---|
| 161 | ######### NEU #####################
|
|---|
| 162 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 163 | $page = $pdf->page();
|
|---|
| 164 | $page->mediabox('A4');
|
|---|
| 165 | $headline = sprintf( "PPP results for station %s", $station );
|
|---|
| 166 | $headline_text = $page->text;
|
|---|
| 167 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 168 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 169 | $headline_text->text($headline);
|
|---|
| 170 | $y = $y0;
|
|---|
| 171 | DEBUG "Plot NEU ";
|
|---|
| 172 | my $pngNameNEU = sprintf( "%s_NEU.png", $station );
|
|---|
| 173 | my $chartNEU = newChart("$station ($dateStr)");
|
|---|
| 174 | $chartNEU->set(
|
|---|
| 175 | output => $pngNameNEU,
|
|---|
| 176 | ylabel => "Displacements [m]",
|
|---|
| 177 | yrange => [ " -0.5 ", " 0.5 " ],
|
|---|
| 178 | );
|
|---|
| 179 | my $dataN = Chart::Gnuplot::DataSet->new(
|
|---|
| 180 | xdata => $EPOCH_PPP,
|
|---|
| 181 | ydata => $N,
|
|---|
| 182 | title => "Displacements N, RMS + -$str_rms_n m",
|
|---|
| 183 | timefmt => '%s',
|
|---|
| 184 | style => "lines",
|
|---|
| 185 | );
|
|---|
| 186 | my $dataE = Chart::Gnuplot::DataSet->new(
|
|---|
| 187 | xdata => $EPOCH_PPP,
|
|---|
| 188 | ydata => $E,
|
|---|
| 189 | title => "Displacements E, RMS + -$str_rms_e m",
|
|---|
| 190 | timefmt => '%s',
|
|---|
| 191 | style => "lines",
|
|---|
| 192 | );
|
|---|
| 193 | my $dataU = Chart::Gnuplot::DataSet->new(
|
|---|
| 194 | xdata => $EPOCH_PPP,
|
|---|
| 195 | ydata => $U,
|
|---|
| 196 | title => "Displacements U, RMS + -$str_rms_u m",
|
|---|
| 197 | timefmt => '%s',
|
|---|
| 198 | style => "dots",
|
|---|
| 199 | );
|
|---|
| 200 | my @datasets = ( $dataN, $dataE, $dataU );
|
|---|
| 201 | $chartNEU->plot2d(@datasets);
|
|---|
| 202 | $png = $page->gfx();
|
|---|
| 203 | LOGDIE("could not find image file: $!\n") unless -e $pngNameNEU;
|
|---|
| 204 | $png->image( $pdf->image_png($pngNameNEU), $x, $y, $width, $height );
|
|---|
| 205 | }
|
|---|
| 206 | ######### FIX #####################
|
|---|
| 207 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 208 | DEBUG "Plot FIX";
|
|---|
| 209 | my $pngNameFIX = sprintf( "%s_FIX.png", $station );
|
|---|
| 210 | my $chartFIX = newChart("$station ($dateStr)");
|
|---|
| 211 | $chartFIX->set(
|
|---|
| 212 | output => $pngNameFIX,
|
|---|
| 213 | ylabel => "Fixed [%]",
|
|---|
| 214 | yrange => [ "0", "100" ],
|
|---|
| 215 | ytics => 20,
|
|---|
| 216 | );
|
|---|
| 217 | my $dataNUMFIX = Chart::Gnuplot::DataSet->new(
|
|---|
| 218 | xdata => $EPOCH_PPP,
|
|---|
| 219 | ydata => $NUMFIX,
|
|---|
| 220 | timefmt => '%s',
|
|---|
| 221 | style => "impulse",
|
|---|
| 222 | color => "green",
|
|---|
| 223 | );
|
|---|
| 224 | $chartFIX->plot2d($dataNUMFIX);
|
|---|
| 225 | $y = $y - $dy;
|
|---|
| 226 | if ( $y < 30 / mm ) {
|
|---|
| 227 | $page = $pdf->page();
|
|---|
| 228 | $page->mediabox('A4');
|
|---|
| 229 | $y = $y0;
|
|---|
| 230 | }
|
|---|
| 231 | $png = $page->gfx();
|
|---|
| 232 | LOGDIE("could not find image file: $!\n") unless -e $pngNameFIX;
|
|---|
| 233 | $png->image( $pdf->image_png($pngNameFIX), $x, $y, $width, $height );
|
|---|
| 234 | }
|
|---|
| 235 | ######### TRP #####################
|
|---|
| 236 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 237 | DEBUG "Plot TRP";
|
|---|
| 238 | my $pngNameTRP = sprintf( "%s_TRP.png", $station );
|
|---|
| 239 | my $chartTRP = newChart("$station ($dateStr)");
|
|---|
| 240 | $chartTRP->set( output => $pngNameTRP );
|
|---|
| 241 | $chartTRP->set(
|
|---|
| 242 | ylabel => "Tropospheric Delay [m]",
|
|---|
| 243 | yrange => [ " 1.0 ", " 3.0 " ],
|
|---|
| 244 | );
|
|---|
| 245 | my $dataTRP = Chart::Gnuplot::DataSet->new(
|
|---|
| 246 | xdata => $EPOCH_PPP,
|
|---|
| 247 | ydata => $file->{'TRP'},
|
|---|
| 248 | title => "Tropospheric Delay, RMS + -$str_rms_trp m",
|
|---|
| 249 | timefmt => '%s',
|
|---|
| 250 | style => "dots",
|
|---|
| 251 | );
|
|---|
| 252 | $chartTRP->plot2d($dataTRP);
|
|---|
| 253 | $y = $y - $dy;
|
|---|
| 254 |
|
|---|
| 255 | if ( $y < 30 / mm ) {
|
|---|
| 256 | $page = $pdf->page();
|
|---|
| 257 | $page->mediabox('A4');
|
|---|
| 258 | $y = $y0;
|
|---|
| 259 | }
|
|---|
| 260 | $png = $page->gfx();
|
|---|
| 261 | LOGDIE("could not find image file: $!\n") unless -e $pngNameTRP;
|
|---|
| 262 | $png->image( $pdf->image_png($pngNameTRP), $x, $y, $width, $height );
|
|---|
| 263 | }
|
|---|
| 264 | ######### RECCLK #####################
|
|---|
| 265 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 266 | DEBUG "Plot Receiver Clocks";
|
|---|
| 267 | $page = $pdf->page();
|
|---|
| 268 | $page->mediabox('A4');
|
|---|
| 269 | $y = $y0 + $dy;
|
|---|
| 270 | $headline = sprintf( "Receiver Clocks for station %s", $station );
|
|---|
| 271 | $headline_text = $page->text;
|
|---|
| 272 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 273 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 274 | $headline_text->text($headline);
|
|---|
| 275 | my $chartRECCLK = newChart("$station ($dateStr)");
|
|---|
| 276 | $chartRECCLK->set(
|
|---|
| 277 | legend => { position => "outside right" } ,
|
|---|
| 278 | );
|
|---|
| 279 | my @datasets = (); # init datasets
|
|---|
| 280 | my $pngNameRECCLK = sprintf( "%s_RECCLK.png", $station );
|
|---|
| 281 | $chartRECCLK->set( output => $pngNameRECCLK );
|
|---|
| 282 | $chartRECCLK->set( ylabel => "Receiver Clocks [m]" );
|
|---|
| 283 | # SYSTEM
|
|---|
| 284 | foreach my $key_sys ( sort keys %RECCLK ) {
|
|---|
| 285 | $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 286 | xdata => \@{ $RECCLK{$key_sys}{EPOCH_PPP} }, # array of epochs
|
|---|
| 287 | ydata => \@{ $RECCLK{$key_sys}{DATA} }
|
|---|
| 288 | , # array of elevations of one satellite
|
|---|
| 289 | title => "$key_sys",
|
|---|
| 290 | timefmt => '%s',
|
|---|
| 291 | style => "dots",
|
|---|
| 292 | );
|
|---|
| 293 | push( @datasets, $dataset );
|
|---|
| 294 | }
|
|---|
| 295 | $chartRECCLK->plot2d(@datasets);
|
|---|
| 296 | $y = $y - $dy;
|
|---|
| 297 | if ( $y < 30 / mm ) {
|
|---|
| 298 | $page = $pdf->page();
|
|---|
| 299 | $page->mediabox('A4');
|
|---|
| 300 | $y = $y0;
|
|---|
| 301 | }
|
|---|
| 302 | $png = $page->gfx();
|
|---|
| 303 | die("could not find image file: $!") unless -e $pngNameRECCLK;
|
|---|
| 304 | $png->image( $pdf->image_png($pngNameRECCLK), $x, $y, $width, $height );
|
|---|
| 305 | }
|
|---|
| 306 | ######### ELE #####################
|
|---|
| 307 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 308 | DEBUG "Plot Elevations";
|
|---|
| 309 | $page = $pdf->page();
|
|---|
| 310 | $page->mediabox('A4');
|
|---|
| 311 | $y = $y0 + $dy;
|
|---|
| 312 | $headline = sprintf( "Satellite Elevations for station %s", $station );
|
|---|
| 313 | $headline_text = $page->text;
|
|---|
| 314 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 315 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 316 | $headline_text->text($headline);
|
|---|
| 317 | my $chartELE = newChart("$station ($dateStr)");
|
|---|
| 318 | $chartELE->set(
|
|---|
| 319 | legend => { position => "outside right" },
|
|---|
| 320 | );
|
|---|
| 321 | # SYSTEM #print Dumper \%ELE;
|
|---|
| 322 | foreach my $key_sys ( sort keys %ELE ) {
|
|---|
| 323 | # print "$key_sys \n";# print Dumper $ELE{$key_sys};
|
|---|
| 324 | my @datasets = (); # init datasets
|
|---|
| 325 | my $pngNameELE = sprintf( "%s_ELE_%s.png", $station, $key_sys );
|
|---|
| 326 | $chartELE->set( output => $pngNameELE );
|
|---|
| 327 | $chartELE->set(
|
|---|
| 328 | ylabel => "Elevation [°]",
|
|---|
| 329 | yrange => [ " 0.0 ", " 90.0 " ]
|
|---|
| 330 | );
|
|---|
| 331 | # SATELLITE
|
|---|
| 332 | foreach my $key_sat ( sort keys %{ $ELE{$key_sys} } ) { # print "$key_sat = $ELE{$key_sys}{$key_sat} \n";
|
|---|
| 333 | $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 334 | xdata => \@{ $ELE{$key_sys}{$key_sat}{EPOCH_PPP} }
|
|---|
| 335 | , # array of epochs
|
|---|
| 336 | ydata => \@{ $ELE{$key_sys}{$key_sat}{DATA} }
|
|---|
| 337 | , # array of elevations of one satellite
|
|---|
| 338 | title => "$key_sat",
|
|---|
| 339 | timefmt => '%s',
|
|---|
| 340 | style => "dots",
|
|---|
| 341 | );
|
|---|
| 342 | push( @datasets, $dataset );
|
|---|
| 343 | }
|
|---|
| 344 | $chartELE->plot2d(@datasets);
|
|---|
| 345 | $y = $y - $dy;
|
|---|
| 346 | if ( $y < 30 / mm ) {
|
|---|
| 347 | $page = $pdf->page();
|
|---|
| 348 | $page->mediabox('A4');
|
|---|
| 349 | $y = $y0;
|
|---|
| 350 | }
|
|---|
| 351 | $png = $page->gfx();
|
|---|
| 352 | die("could not find image file: $!") unless -e $pngNameELE;
|
|---|
| 353 | $png->image( $pdf->image_png($pngNameELE), $x, $y, $width,
|
|---|
| 354 | $height );
|
|---|
| 355 | }
|
|---|
| 356 | }
|
|---|
| 357 | ######### AMB #####################
|
|---|
| 358 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 359 | DEBUG "Plot Ambiguities";
|
|---|
| 360 | $page = $pdf->page();
|
|---|
| 361 | $page->mediabox('A4');
|
|---|
| 362 | $y = $y0 + $dy;
|
|---|
| 363 | $headline = sprintf( "Ambiguities for station %s", $station );
|
|---|
| 364 | $headline_text = $page->text;
|
|---|
| 365 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 366 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 367 | $headline_text->text($headline);
|
|---|
| 368 | # AMBIGUITY_TYPE #print Dumper \%AMB;
|
|---|
| 369 | foreach my $key_ambType (%AMB) {
|
|---|
| 370 | foreach my $key_sys ( sort keys %{ $AMB{$key_ambType} } ) {
|
|---|
| 371 | my ( @datasets_amb, @datasets_epo ); # init datasets
|
|---|
| 372 | my $pngNameAMB = sprintf( "%s_AMB_%s_%s.png", $station, $key_ambType, $key_sys );
|
|---|
| 373 | my $pngNameEPO = sprintf( "%s_EPO_%s_%s.png", $station, $key_ambType, $key_sys );
|
|---|
| 374 | my $chartAMB = Chart::Gnuplot->new(
|
|---|
| 375 | output => $pngNameAMB,
|
|---|
| 376 | terminal => 'png',
|
|---|
| 377 | title => "$station ($dateStr)",
|
|---|
| 378 | ylabel => "Ambiguities $key_ambType [m]",
|
|---|
| 379 | timeaxis => 'x',
|
|---|
| 380 | xtics => { labelfmt => '%H:%M', rotate => '-270', },
|
|---|
| 381 | legend => { position => "outside right", },
|
|---|
| 382 | grid => 'on',
|
|---|
| 383 | );
|
|---|
| 384 | my $chartEPO = Chart::Gnuplot->new(
|
|---|
| 385 | output => $pngNameEPO,
|
|---|
| 386 | terminal => 'png',
|
|---|
| 387 | title => "$station ($dateStr)",
|
|---|
| 388 | ylabel => "Number of Epochs $key_ambType [-]",
|
|---|
| 389 | timeaxis => 'x',
|
|---|
| 390 | xtics => { labelfmt => '%H:%M', rotate => '-270', },
|
|---|
| 391 | legend => { position => "outside right", },
|
|---|
| 392 | grid => 'on',
|
|---|
| 393 | );
|
|---|
| 394 | # SATELLITE
|
|---|
| 395 | foreach my $key_sat ( sort keys %{ $AMB{$key_ambType}{$key_sys} } ){
|
|---|
| 396 | # ambiguities
|
|---|
| 397 | my $dataset_amb = Chart::Gnuplot::DataSet->new(
|
|---|
| 398 | xdata => $AMB{$key_ambType}{$key_sys}{$key_sat}{EPOCH_PPP} , # array of epochs
|
|---|
| 399 | ydata => $AMB{$key_ambType}{$key_sys}{$key_sat}{DATA} , # array of ambiguities of one satellite
|
|---|
| 400 | title => "$key_sat",
|
|---|
| 401 | timefmt => '%s',
|
|---|
| 402 | style => "dots",
|
|---|
| 403 | );
|
|---|
| 404 | push( @datasets_amb, $dataset_amb );
|
|---|
| 405 | # number of epochs used for ambiguity
|
|---|
| 406 | my $dataset_epo = Chart::Gnuplot::DataSet->new(
|
|---|
| 407 | xdata => $AMB{$key_ambType}{$key_sys}{$key_sat}{EPOCH_PPP} , # array of epochs
|
|---|
| 408 | ydata => $AMB{$key_ambType}{$key_sys}{$key_sat}{NUMEPO} , # array of ambiguities of one satellite
|
|---|
| 409 | title => "$key_sat",
|
|---|
| 410 | timefmt => '%s',
|
|---|
| 411 | style => "dots",
|
|---|
| 412 | );
|
|---|
| 413 | push( @datasets_epo, $dataset_epo );
|
|---|
| 414 | }
|
|---|
| 415 | # ambiguities
|
|---|
| 416 | $chartAMB->plot2d(@datasets_amb);
|
|---|
| 417 | $y = $y - $dy;
|
|---|
| 418 | if ( $y < 30 / mm ) {
|
|---|
| 419 | $page = $pdf->page();
|
|---|
| 420 | $page->mediabox('A4');
|
|---|
| 421 | $y = $y0;
|
|---|
| 422 | }
|
|---|
| 423 | $png = $page->gfx();
|
|---|
| 424 | LOGDIE("could not find image file: $!\n")
|
|---|
| 425 | unless -e $pngNameAMB;
|
|---|
| 426 | $png->image( $pdf->image_png($pngNameAMB), $x, $y, $width, $height );
|
|---|
| 427 | # number of epochs used for ambiguity
|
|---|
| 428 | $chartEPO->plot2d(@datasets_epo);
|
|---|
| 429 | $y = $y - $dy;
|
|---|
| 430 | if ( $y < 30 / mm ) {
|
|---|
| 431 | $page = $pdf->page();
|
|---|
| 432 | $page->mediabox('A4');
|
|---|
| 433 | $y = $y0;
|
|---|
| 434 | }
|
|---|
| 435 | $png = $page->gfx();
|
|---|
| 436 | LOGDIE("could not find image file $pngNameEPO: $!\n")
|
|---|
| 437 | unless -e $pngNameEPO;
|
|---|
| 438 | $png->image( $pdf->image_png($pngNameEPO),
|
|---|
| 439 | $x, $y, $width, $height );
|
|---|
| 440 | }
|
|---|
| 441 | }
|
|---|
| 442 | }
|
|---|
| 443 | ######### ION #####################
|
|---|
| 444 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 445 | DEBUG "Plot ION";
|
|---|
| 446 | $page = $pdf->page();
|
|---|
| 447 | $page->mediabox('A4');
|
|---|
| 448 | $y = $y0 + $dy;
|
|---|
| 449 | $headline = sprintf( "Ionosphere Delay for station %s", $station );
|
|---|
| 450 | $headline_text = $page->text;
|
|---|
| 451 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 452 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 453 | $headline_text->text($headline);
|
|---|
| 454 | my $chartION = newChart("$station ($dateStr)");
|
|---|
| 455 | $chartION->set( ylabel => "Ionophere Delay [m]" );
|
|---|
| 456 | $chartION->set( legend => { position => "outside right" } );
|
|---|
| 457 | # SYSTEM
|
|---|
| 458 | foreach my $ksys ( sort keys %ION ) {
|
|---|
| 459 | my @datasets; # init datasets
|
|---|
| 460 | my $pngNameION = sprintf( "%s_ION_%s.png", $station, $ksys );
|
|---|
| 461 | $chartION->set( output => $pngNameION );
|
|---|
| 462 | # SATELLITE
|
|---|
| 463 | foreach my $sat ( sort keys %{ $ION{$ksys} } ) {
|
|---|
| 464 | my $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 465 | xdata => $ION{$ksys}{$sat}{EPOCH_PPP}, # array of epochs
|
|---|
| 466 | ydata => $ION{$ksys}{$sat}{DATA}
|
|---|
| 467 | , # array of ionvations of one satellite
|
|---|
| 468 | title => "$sat",
|
|---|
| 469 | timefmt => '%s',
|
|---|
| 470 | style => "dots",
|
|---|
| 471 | );
|
|---|
| 472 | push( @datasets, $dataset );
|
|---|
| 473 | }
|
|---|
| 474 | $chartION->plot2d(@datasets); #system ("display $pngName&");
|
|---|
| 475 | $y = $y - $dy;
|
|---|
| 476 | if ( $y < 30 / mm ) {
|
|---|
| 477 | $page = $pdf->page();
|
|---|
| 478 | $page->mediabox('A4');
|
|---|
| 479 | $y = $y0;
|
|---|
| 480 | }
|
|---|
| 481 | $png = $page->gfx();
|
|---|
| 482 | die("could not find image file: $!") unless -e $pngNameION;
|
|---|
| 483 | $png->image( $pdf->image_png($pngNameION), $x, $y, $width,
|
|---|
| 484 | $height );
|
|---|
| 485 | }
|
|---|
| 486 | }
|
|---|
| 487 | ######### BIAS #####################
|
|---|
| 488 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 489 | DEBUG "Plot BIAS";
|
|---|
| 490 | $page = $pdf->page();
|
|---|
| 491 | $page->mediabox('A4');
|
|---|
| 492 | $y = $y0 + $dy;
|
|---|
| 493 | $headline = sprintf( "Receiver Biases for station %s", $station );
|
|---|
| 494 | $headline_text = $page->text;
|
|---|
| 495 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 496 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 497 | $headline_text->text($headline);
|
|---|
| 498 | my $chartBIAS = newChart("$station ($dateStr)");
|
|---|
| 499 | $chartBIAS->set( legend => { position => "outside right" } );
|
|---|
| 500 |
|
|---|
| 501 | # BIAS_TYPE #print Dumper \%BIA;
|
|---|
| 502 | foreach my $key_biasType ( sort keys %BIA ) { #print "key_biasType: $key_biasType \n";
|
|---|
| 503 | foreach my $key_sys ( sort keys %{ $BIA{$key_biasType} } ) { #print "key_sys: $key_sys \n"; #print Dumper $BIA{$key_biasType};
|
|---|
| 504 | my @datasets; # init datasets
|
|---|
| 505 | my $pngNameBIA = sprintf( "%s_BIAS_%s_%s.png",
|
|---|
| 506 | $station, $key_biasType, $key_sys );
|
|---|
| 507 | $chartBIAS->set( output => $pngNameBIA );
|
|---|
| 508 | $chartBIAS->set( ylabel => "Receiver Bias $key_biasType [m]" );
|
|---|
| 509 |
|
|---|
| 510 | my $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 511 | xdata => $BIA{$key_biasType}{$key_sys}{EPOCH_PPP},
|
|---|
| 512 | ydata => $BIA{$key_biasType}{$key_sys}{DATA},
|
|---|
| 513 | title => "$key_sys",
|
|---|
| 514 | timefmt => '%s',
|
|---|
| 515 | style => "dots",
|
|---|
| 516 | );
|
|---|
| 517 | push( @datasets, $dataset );
|
|---|
| 518 |
|
|---|
| 519 | $chartBIAS->plot2d(@datasets);
|
|---|
| 520 | $y = $y - $dy;
|
|---|
| 521 | if ( $y < 30 / mm ) {
|
|---|
| 522 | $page = $pdf->page();
|
|---|
| 523 | $page->mediabox('A4');
|
|---|
| 524 | $y = $y0;
|
|---|
| 525 | }
|
|---|
| 526 | $png = $page->gfx();
|
|---|
| 527 | die("could not find image file: $!") unless -e $pngNameBIA;
|
|---|
| 528 | $png->image( $pdf->image_png($pngNameBIA), $x, $y, $width, $height );
|
|---|
| 529 | }
|
|---|
| 530 | }
|
|---|
| 531 | }
|
|---|
| 532 | ######### RES #####################
|
|---|
| 533 | if ( grep ( $_ eq "PPP", @plotTypes ) ) {
|
|---|
| 534 | DEBUG "Plot Residuals";
|
|---|
| 535 | $page = $pdf->page();
|
|---|
| 536 | $page->mediabox('A4');
|
|---|
| 537 | $y = $y0 + $dy;
|
|---|
| 538 | $headline = sprintf( "Residuals for station %s", $station );
|
|---|
| 539 | $headline_text = $page->text;
|
|---|
| 540 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 541 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 542 | $headline_text->text($headline);
|
|---|
| 543 | my $chartRES = newChart("$station ($dateStr)");
|
|---|
| 544 | $chartRES->set( legend => { position => "outside right" } );
|
|---|
| 545 | # RESIDUAL_TYPE #print Dumper \%RES;
|
|---|
| 546 | foreach my $key_resType ( sort keys %RES ){ #print "key_resType: $key_resType \n";
|
|---|
| 547 | #SYSTEM
|
|---|
| 548 | foreach my $key_sys ( sort keys %{ $RES{$key_resType} } ) { #print "key_sys: $key_sys \n"; #print Dumper $RES{$key_resType};
|
|---|
| 549 | my @datasets;
|
|---|
| 550 | my $pngNameRES = sprintf( "%s_RES_%s_%s.png", $station, $key_resType, $key_sys );
|
|---|
| 551 | $chartRES->set( output => $pngNameRES );
|
|---|
| 552 | $chartRES->set(ylabel => "Residuals $key_resType [m]" );
|
|---|
| 553 | if ( $key_resType =~ /^c/ ) {
|
|---|
| 554 | $chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
|
|---|
| 555 | }
|
|---|
| 556 | elsif ( $key_resType =~ /^l/ ) {
|
|---|
| 557 | $chartRES->set( yrange => [ " -0.06 ", " 0.06 " ] );
|
|---|
| 558 | }
|
|---|
| 559 | elsif ( $key_resType =~ /^GIM/ ) {
|
|---|
| 560 | $chartRES->set( yrange => [ " -6.0 ", " 6.0 " ] );
|
|---|
| 561 | }
|
|---|
| 562 | # SATELLITE
|
|---|
| 563 | foreach my $key_sat ( sort keys %{ $RES{$key_resType}{$key_sys} } ) { #print "$key_sat = $RES{$key_resType}{$key_sys}{$key_sat} \n";
|
|---|
| 564 | $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 565 | xdata => $RES{$key_resType}{$key_sys}{$key_sat}{EPOCH_PPP}, # array of epochs
|
|---|
| 566 | ydata => $RES{$key_resType}{$key_sys}{$key_sat}{DATA}
|
|---|
| 567 | , # array of residuals of one satellite
|
|---|
| 568 | title => "$key_sat",
|
|---|
| 569 | timefmt => '%s',
|
|---|
| 570 | style => "dots",
|
|---|
| 571 | );
|
|---|
| 572 | push( @datasets, $dataset );
|
|---|
| 573 | }
|
|---|
| 574 | $chartRES->plot2d(@datasets);
|
|---|
| 575 | $y = $y - $dy;
|
|---|
| 576 | if ( $y < 30 / mm ) {
|
|---|
| 577 | $page = $pdf->page();
|
|---|
| 578 | $page->mediabox('A4');
|
|---|
| 579 | $y = $y0;
|
|---|
| 580 | }
|
|---|
| 581 | $png = $page->gfx();
|
|---|
| 582 | LOGDIE("could not find image file: $!\n")
|
|---|
| 583 | unless -e $pngNameRES;
|
|---|
| 584 | $png->image( $pdf->image_png($pngNameRES), $x, $y, $width, $height );
|
|---|
| 585 | }
|
|---|
| 586 | }
|
|---|
| 587 | }
|
|---|
| 588 | ######### CLKCORR #####################
|
|---|
| 589 | if ( grep ( $_ eq "SSR", @plotTypes ) ) {
|
|---|
| 590 | DEBUG "Plot CLKCORR";
|
|---|
| 591 | $page = $pdf->page();
|
|---|
| 592 | $page->mediabox('A4');
|
|---|
| 593 | $y = $y0 + $dy;
|
|---|
| 594 | $headline = sprintf( "Clock Corrections from %s", $ssrData );
|
|---|
| 595 | $headline_text = $page->text;
|
|---|
| 596 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 597 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 598 | $headline_text->text($headline);
|
|---|
| 599 | my $chartCLKCORR = newChart("$ssrData ($dateStr)");
|
|---|
| 600 | $chartCLKCORR->set( ylabel => "Clock Corrections [m]" );
|
|---|
| 601 | $chartCLKCORR->set( legend => { position => "outside right" } );
|
|---|
| 602 | # SYSTEM
|
|---|
| 603 | foreach my $ksys ( sort keys %CLKCORR ) { #print "$key_sys \n"; #print Dumper $CLKCORR{$key_sys};
|
|---|
| 604 | my @datasets;
|
|---|
| 605 | my $pngNameCLKCORR = sprintf( "%s_CLKCORR_%s.png", $station, $ksys );
|
|---|
| 606 | $chartCLKCORR->set( output => $pngNameCLKCORR );
|
|---|
| 607 | # SATELLITE
|
|---|
| 608 | foreach my $sat ( sort keys %{ $CLKCORR{$ksys} } ) { #print "$key_sat = $CLKCORR{$key_sys}{$key_sat} \n";
|
|---|
| 609 | my $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 610 | xdata => $CLKCORR{$ksys}{$sat}{EPOCH_SSR}, # array of epochs
|
|---|
| 611 | ydata => $CLKCORR{$ksys}{$sat}{DATA}, # array of ionvations of one satellite
|
|---|
| 612 | title => "$sat",
|
|---|
| 613 | timefmt => '%s',
|
|---|
| 614 | style => "dots",
|
|---|
| 615 | );
|
|---|
| 616 | push( @datasets, $dataset );
|
|---|
| 617 | }
|
|---|
| 618 | $chartCLKCORR->plot2d(@datasets); #system ("display $pngName&");
|
|---|
| 619 | $y = $y - $dy;
|
|---|
| 620 | if ( $y < 30 / mm ) {
|
|---|
| 621 | $page = $pdf->page();
|
|---|
| 622 | $page->mediabox('A4');
|
|---|
| 623 | $y = $y0;
|
|---|
| 624 | }
|
|---|
| 625 | $png = $page->gfx();
|
|---|
| 626 | die("could not find image file: $!") unless -e $pngNameCLKCORR;
|
|---|
| 627 | $png->image( $pdf->image_png($pngNameCLKCORR),
|
|---|
| 628 | $x, $y, $width, $height );
|
|---|
| 629 | }
|
|---|
| 630 | }
|
|---|
| 631 | ######### YAW ANGLE #####################
|
|---|
| 632 | if ( grep ( $_ eq "SSR", @plotTypes ) ) {
|
|---|
| 633 | DEBUG "Plot YAW";
|
|---|
| 634 | $page = $pdf->page();
|
|---|
| 635 | $page->mediabox('A4');
|
|---|
| 636 | $y = $y0 + $dy;
|
|---|
| 637 | $headline =
|
|---|
| 638 | sprintf( "Yaw angle from %s versus Standard Model", $ssrData );
|
|---|
| 639 | $headline_text = $page->text;
|
|---|
| 640 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 641 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 642 | $headline_text->text($headline);
|
|---|
| 643 | # SATELLITE
|
|---|
| 644 | foreach my $sat ( sort keys %YAW_SSR ) {
|
|---|
| 645 | my @datasets;
|
|---|
| 646 | my $chartYAW = newChart("Yaw Angle Satellite $sat ($dateStr)");
|
|---|
| 647 | $chartYAW->set( ylabel => "Yaw Angle [°]" );
|
|---|
| 648 | #$chartYAW->set( legend => { position => "outside right" } );
|
|---|
| 649 | my $pngNameYAW = sprintf( "%s_YAW_%s.png", $station, $sat );
|
|---|
| 650 | $chartYAW->set( output => $pngNameYAW );
|
|---|
| 651 | # YAW from SSR data
|
|---|
| 652 | my $datasetYAW_SSR = Chart::Gnuplot::DataSet->new(
|
|---|
| 653 | xdata => $YAW_SSR{$sat}{EPOCH_SSR}, # array of epochs
|
|---|
| 654 | ydata => $YAW_SSR{$sat}{DATA} , # array of ionvations of one satellite
|
|---|
| 655 | title => $ssrData,
|
|---|
| 656 | timefmt => '%s',
|
|---|
| 657 | style => "line",
|
|---|
| 658 | );
|
|---|
| 659 | push( @datasets, $datasetYAW_SSR );
|
|---|
| 660 | # YAW from standard model
|
|---|
| 661 | my $datasetYAW_DEF = Chart::Gnuplot::DataSet->new(
|
|---|
| 662 | xdata => $YAW_DEF{$sat}{EPOCH_SSR}, # array of epochs
|
|---|
| 663 | ydata => $YAW_DEF{$sat}{DATA} , # array of ionvations of one satellite
|
|---|
| 664 | title => "Standard Model",
|
|---|
| 665 | timefmt => '%s',
|
|---|
| 666 | style => "line",
|
|---|
| 667 | );
|
|---|
| 668 | push( @datasets, $datasetYAW_DEF );
|
|---|
| 669 | $chartYAW->plot2d(@datasets);
|
|---|
| 670 | $y = $y - $dy;
|
|---|
| 671 | if ( $y < 30 / mm ) {
|
|---|
| 672 | $page = $pdf->page();
|
|---|
| 673 | $page->mediabox('A4');
|
|---|
| 674 | $y = $y0;
|
|---|
| 675 | }
|
|---|
| 676 | $png = $page->gfx();
|
|---|
| 677 | die("could not find image file: $!") unless -e $pngNameYAW;
|
|---|
| 678 | $png->image( $pdf->image_png($pngNameYAW), $x, $y, $width, $height );
|
|---|
| 679 | }
|
|---|
| 680 | }
|
|---|
| 681 | ######### CODE BIASES #####################
|
|---|
| 682 | if ( grep ( $_ eq "SSR", @plotTypes ) ) {
|
|---|
| 683 | DEBUG "Plot Code Biases";
|
|---|
| 684 | $page = $pdf->page();
|
|---|
| 685 | $page->mediabox('A4');
|
|---|
| 686 | $y = $y0 + $dy;
|
|---|
| 687 | $headline = sprintf( "Code Biases from %s ", $ssrData );
|
|---|
| 688 | $headline_text = $page->text;
|
|---|
| 689 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 690 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 691 | $headline_text->text($headline);
|
|---|
| 692 | my $chartCB = newChart("$ssrData ($dateStr)");
|
|---|
| 693 | $chartCB->set( legend => { position => "outside right" } );
|
|---|
| 694 | foreach my $key_type ( sort keys %CODEBIAS ) {
|
|---|
| 695 | #SYSTEM
|
|---|
| 696 | foreach my $key_sys ( sort keys %{ $CODEBIAS{$key_type} } ) {
|
|---|
| 697 | my @datasets;
|
|---|
| 698 | my $pngNameCB = sprintf( "%s_CB_%s_%s.png", $station, $key_type, $key_sys );
|
|---|
| 699 | $chartCB->set( output => $pngNameCB );
|
|---|
| 700 | $chartCB->set( ylabel => "Code Biases $key_type [m]" );
|
|---|
| 701 | # SATELLITE
|
|---|
| 702 | foreach my $key_sat ( sort keys %{ $CODEBIAS{$key_type}{$key_sys} } ) {
|
|---|
| 703 | $dataset = Chart::Gnuplot::DataSet->new(
|
|---|
| 704 | xdata => $CODEBIAS{$key_type}{$key_sys}{$key_sat}{EPOCH_SSR}, # array of epochs
|
|---|
| 705 | ydata => $CODEBIAS{$key_type}{$key_sys}{$key_sat}{DATA} , # array of residuals of one satellite
|
|---|
| 706 | title => "$key_sat",
|
|---|
| 707 | timefmt => '%s',
|
|---|
| 708 | style => "dots",
|
|---|
| 709 | );
|
|---|
| 710 | push( @datasets, $dataset );
|
|---|
| 711 | }
|
|---|
| 712 | $chartCB->plot2d(@datasets);
|
|---|
| 713 | $y = $y - $dy;
|
|---|
| 714 | if ( $y < 30 / mm ) {
|
|---|
| 715 | $page = $pdf->page();
|
|---|
| 716 | $page->mediabox('A4');
|
|---|
| 717 | $y = $y0;
|
|---|
| 718 | }
|
|---|
| 719 | $png = $page->gfx();
|
|---|
| 720 | LOGDIE("could not find image file: $!\n")
|
|---|
| 721 | unless -e $pngNameCB;
|
|---|
| 722 | $png->image( $pdf->image_png($pngNameCB),$x, $y, $width, $height );
|
|---|
| 723 | }
|
|---|
| 724 | }
|
|---|
| 725 | }
|
|---|
| 726 | ######### PHASE BIASES #####################
|
|---|
| 727 | if ( grep ( $_ eq "SSR", @plotTypes ) ) {
|
|---|
| 728 | DEBUG "Plot Phase Biases";
|
|---|
| 729 | $page = $pdf->page();
|
|---|
| 730 | $page->mediabox('A4');
|
|---|
| 731 | $y = $y0 + $dy;
|
|---|
| 732 | $headline = sprintf( "Phase Biases from %s ", $ssrData );
|
|---|
| 733 | $headline_text = $page->text;
|
|---|
| 734 | $headline_text->font( $font1, 11 / pt );
|
|---|
| 735 | $headline_text->translate( 15 / mm, 280 / mm );
|
|---|
| 736 | $headline_text->text($headline);
|
|---|
| 737 | foreach my $key_type ( sort keys %PHASEBIAS ) {
|
|---|
| 738 | #SYSTEM
|
|---|
| 739 | foreach my $key_sys ( sort keys %{ $PHASEBIAS{$key_type} } ) {
|
|---|
| 740 | my (@datasetsPB, $datasetPB);
|
|---|
| 741 | my (@datasetsJC, $datasetJC);
|
|---|
| 742 | my $pngNamePB = sprintf( "%s_PB_%s_%s.png", $station, $key_type, $key_sys );
|
|---|
| 743 | my $pngNameJC = sprintf( "%s_JC_%s_%s.png", $station, $key_type, $key_sys );
|
|---|
| 744 | my $chartPB = newChart("$ssrData ($dateStr)");
|
|---|
| 745 | $chartPB->set( legend => { position => "outside right" } );
|
|---|
| 746 | $chartPB->set( output => $pngNamePB );
|
|---|
| 747 | $chartPB->set( ylabel => "Phase Biases $key_type [m]" );
|
|---|
| 748 | my $chartJC = newChart("$ssrData ($dateStr)");
|
|---|
| 749 | $chartJC->set( legend => { position => "outside right" } );
|
|---|
| 750 | $chartJC->set( output => $pngNameJC );
|
|---|
| 751 | $chartJC->set( ylabel => "Counter Value $key_type " );
|
|---|
| 752 | # SATELLITE
|
|---|
| 753 | foreach my $key_sat ( sort keys %{ $PHASEBIAS{$key_type}{$key_sys} } ) {
|
|---|
| 754 | $datasetPB = Chart::Gnuplot::DataSet->new(
|
|---|
| 755 | xdata => $PHASEBIAS{$key_type}{$key_sys}{$key_sat}{EPOCH_SSR}, # array of epochs
|
|---|
| 756 | ydata => $PHASEBIAS{$key_type}{$key_sys}{$key_sat}{DATA}, # array of residuals of one satellite
|
|---|
| 757 | title => "$key_sat",
|
|---|
| 758 | timefmt => '%s',
|
|---|
| 759 | style => "linespoints",
|
|---|
| 760 | );
|
|---|
| 761 | push( @datasetsPB, $datasetPB );
|
|---|
| 762 | $datasetJC = Chart::Gnuplot::DataSet->new(
|
|---|
| 763 | xdata => $JUMPCOUNT{$key_type}{$key_sys}{$key_sat}{EPOCH_SSR}, # array of epochs
|
|---|
| 764 | ydata => $JUMPCOUNT{$key_type}{$key_sys}{$key_sat}{DATA}, # array of residuals of one satellite
|
|---|
| 765 | title => "$key_sat",
|
|---|
| 766 | timefmt => '%s',
|
|---|
| 767 | style => "linespoints",
|
|---|
| 768 | );
|
|---|
| 769 | push( @datasetsJC, $datasetJC );
|
|---|
| 770 | }
|
|---|
| 771 | #phase biases
|
|---|
| 772 | $chartPB->plot2d(@datasetsPB);
|
|---|
| 773 | $y = $y - $dy;
|
|---|
| 774 | if ( $y < 30 / mm ) {
|
|---|
| 775 | $page = $pdf->page();
|
|---|
| 776 | $page->mediabox('A4');
|
|---|
| 777 | $y = $y0;
|
|---|
| 778 | }
|
|---|
| 779 | $png = $page->gfx();
|
|---|
| 780 | LOGDIE("could not find image file: $!\n")
|
|---|
| 781 | unless -e $pngNamePB;
|
|---|
| 782 | $png->image( $pdf->image_png($pngNamePB),$x, $y, $width, $height );
|
|---|
| 783 | #jump counter
|
|---|
| 784 | $chartJC->plot2d(@datasetsJC);
|
|---|
| 785 | $y = $y - $dy;
|
|---|
| 786 | if ( $y < 30 / mm ) {
|
|---|
| 787 | $page = $pdf->page();
|
|---|
| 788 | $page->mediabox('A4');
|
|---|
| 789 | $y = $y0;
|
|---|
| 790 | }
|
|---|
| 791 | $png = $page->gfx();
|
|---|
| 792 | LOGDIE("could not find image file: $!\n")
|
|---|
| 793 | unless -e $pngNameJC;
|
|---|
| 794 | $png->image( $pdf->image_png($pngNameJC),$x, $y, $width, $height );
|
|---|
| 795 | }
|
|---|
| 796 | }
|
|---|
| 797 | }
|
|---|
| 798 |
|
|---|
| 799 | $pdf->save();
|
|---|
| 800 | $pdf->end();
|
|---|
| 801 |
|
|---|
| 802 | system("rm *.png");
|
|---|
| 803 | if (Common::amInteractiv) {
|
|---|
| 804 | system("evince $inputDir/$pdf_name");
|
|---|
| 805 | }
|
|---|
| 806 |
|
|---|
| 807 | } # ----- next logfile -----
|
|---|
| 808 |
|
|---|
| 809 | # newChart returns a default chart.
|
|---|
| 810 | sub newChart {
|
|---|
| 811 | my $title = shift;
|
|---|
| 812 | return Chart::Gnuplot->new(
|
|---|
| 813 | terminal => 'png',
|
|---|
| 814 | title => $title,
|
|---|
| 815 | timeaxis => 'x',
|
|---|
| 816 | xlabel => "Time [h]",
|
|---|
| 817 | xtics => { labelfmt => '%H:%M', rotate => '-270' },
|
|---|
| 818 | #xtics => { labelfmt => '%H:%M\n%m-%d', rotate => '-270'},
|
|---|
| 819 | grid => 'on',
|
|---|
| 820 | );
|
|---|
| 821 | }
|
|---|
| 822 |
|
|---|
| 823 | sub HELP_MESSAGE {
|
|---|
| 824 | print <<EOI_HILFE;
|
|---|
| 825 | $prog - plot BNC's PPP results using gnuplot
|
|---|
| 826 |
|
|---|
| 827 | USAGE:
|
|---|
| 828 | $prog [OPTIONS]
|
|---|
| 829 |
|
|---|
| 830 | OPTIONS:
|
|---|
| 831 | -p, --plotTypes PPP or SSR (requires PPP files in debug mode)
|
|---|
| 832 | -l, --logFiles comma separated list of BNC's PPP logfiles
|
|---|
| 833 | -s, --sampling sampling interval in seconds for the logfile data (default: 1); for a daily logfile <30> seconds should be usefull
|
|---|
| 834 | -h, --help show help contents
|
|---|
| 835 |
|
|---|
| 836 | EXAMPLES:
|
|---|
| 837 | $prog --plotTypes PPP -s 30 -l /path/to/FFMJ186730.ppp
|
|---|
| 838 |
|
|---|
| 839 | 2021 andrea.stuerze\@bkg.bund.de
|
|---|
| 840 | EOI_HILFE
|
|---|
| 841 | exit;
|
|---|
| 842 | }
|
|---|