-
Notifications
You must be signed in to change notification settings - Fork 2
/
graph.py
executable file
·10923 lines (9624 loc) · 722 KB
/
graph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#############################################################################
# Copyright & License:
# ====================
#
# Copyright 2009-2020 gAGE/UPC & ESA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#############################################################################
#############################################################################
# Copyright: gAGE/UPC & ESA
# Project: EDUNAV GNSS Lab Tool
# Supervisor: Jaume Sanz Subirana (group of Astronomy and GEomatics - gAGE/UPC)
# Authors: Adria Rovira-Garcia (group of Astronomy and GEomatics - gAGE/UPC)
# Pere Ramos-Bosch (group of Astronomy and GEomatics - gAGE/UPC)
# Curator: Adria Rovira-Garcia ( gAGE/UPC )
# Developer: Deimos Ibanez Segura ( gAGE/UPC )
# Yixie Shao ( gAGE/UPC )
# glab.gage @ upc.edu
# File: graph.py
# Code Management Tool File Version: 5.5 Revision: 1
# Date: 2020/12/11
#############################################################################
#############################################################################
# MODULE DESCRIPTION
#
# Name: graph
# Language: python
#
# Purpose:
# The purpose of this module is to generate a plot for a set of specified
# input data.
#
# Function:
# This program creates a window which will show a plot for the specified
# columns in a file. It allows to include conditions to select which files
# to plot.
#
# Dependencies:
# None
#
# Files modified:
# .plot.lock
#
# Files read:
# None
#
# Resources usage:
# See Design Document
#############################################################################
#############################################################################
# RELEASE_HISTORY
# -------------
# gLAB v1.3.0
# Release: 2009/12/10
# Change Log: First public version.
# -------------
# gLAB v1.4.0
# Release: 2010/06/21
# Change Log: Save figure function added.
# -------------
# gLAB v1.4.1
# Release: 2010/07/09
# Change Log: No changes in this file.
# -------------
# gLAB v1.4.2
# Release: 2010/07/31
# Change Log: No changes in this file.
# -------------
# gLAB v1.4.3
# Release: 2010/08/31
# Change Log: No changes in this file.
# -------------
# gLAB v1.4.4
# Release: 2010/09/22
# Change Log: No changes in this file.
# -------------
# gLAB v1.4.5
# Release: 2010/10/31
# Change Log: Minor Changes in help
# -------------
# gLAB v2.0.0
# Release: 2012/12/31
# Change Log: gLAB version released together with the Educational Book:
# "GNSS Data Processing" (Vol. 1 and Vol. 2). ESA TM-23.
# Authors: J. Sanz Subirana, J.M. Juan Zornoza and M. Hernandez-Pajares
# ISBN: 978-92-9221-885-0 (two volumes)
# ISSN: 1013-7076
# December 2012.
# -------------
# gLAB v2.2.0
# Release: 2014/09/22
# Change Log: No changes in this file.
# -------------
# gLAB v2.2.1
# Release: 2014/12/23
# Change Log: No changes in this file.
# -------------
# gLAB v2.2.2
# Release: 2015/03/02
# Change Log: No changes in this file.
# -------------
# gLAB v2.2.3
# Release: 2015/05/28
# Change Log: No changes in this file.
# -------------
# gLAB v2.2.4
# Release: 2015/07/01
# Change Log: No changes in this file.
# -------------
# gLAB v2.2.5
# Release: 2015/10/20
# Change Log: When plot fails due to non-decimal values, the file .plot.lock is erased,
# so gLAB_GUI.py "Plot" button doesn't get locked during 60 seconds. Also,
# the error message has been clarified
# In the Windows version (.exe binary), stdout has been redirected to stderr
# so the help message is not lost
# -------------
# gLAB v3.0.0
# Release: 2016/09/05
# Change Log: Added stanford plots and stanford-ESA plots
# Added worst integrity ratio plots
# Display environment in linux is not necessary when plot is saved to a file
# It is now compatible with python 3
# NOTE: The new plots (stanford and worst integrity ratio) need additional
# python libraries (numpy and basemap), but they are not mandatory
# if these plots are not used (for compatibility with previous versions)
# -------------
# gLAB v3.1.0
# Release: 2016/09/26
# Change Log: Fixed a bug with input parameters due to bad space indentation
# -----------
# gLAB v3.1.1
# Release: 2016/10/21
# Change Log: Changed title name in Stanford-ESA plots from '# epochs' to '# samples'.
# Fixed Stanford-ESA plots, which was horizontal protection levels from vertical plots and viceversa.
# Added quantization check in Stanford plots generation for points greater than the
# maximum X and Y. For example, (60,100) and (100,60) with a max X and Y of 50,
# would both result in the plot in the point (50,50) or (Xmax,Ymax), which made
# it impossible to distinguish the MI from the non-MI. Now, MI points will result
# in (Xmax,Ymax) while non MI will result in (Xmax-1,Ymax)
# -----------
# gLAB v4.0.0
# Release: 2017/03/03
# Change Log: Added SBAS plots.
# Added option to make a map with the station names in WIR maps mode.
# Added many checks to prevent errors from user input.
# Added check of X Display in Linux when not saving picture to file.
# Added option to change the number of points shown in the label.
# Added option to change the label position.
# Added option to show number of MIs in worst integrity plot with coloured rings,
# using parameters '--mih' and --miv'.
# Added new plot: World maps. Worst Integrity Plots are now a special case for world maps.
# Added option for plotting user defined watermark in all plots.
# Changed Worst Integrity Ratio colourbar and scale to a fixed one.
# Parameter '-z' from worst integrity ratio plot has changes to '--rh' and '--rv', so
# in one call to the program both horizontal and vertical ratio plots can be shown.
# Changed default alarm limit in Stanford plots from 35 to 40 metres.
# Changed default both X and Y axis maximum to 60 metres in Stanford plots
# Changed default horizontal label in Stanford-ESA plots from "HPE","VPE" to
# "Horizontal Positioning Error (metres)","Vertical Positioning Error (metres)" respectively.
# Changed default vertical label in Stanford-ESA plots from "HPL","VPL" to
# "Horizontal Protection Level (metres)","Vertical Protection Level (metres)" respectively.
# Changed default title in Stanford-ESA plots from "StanfordESA" to "Stanford-ESA".
# Changed reading of Stanford-ESA files in order to skip comment headers.
# Fixed Stanford plots bug that always set maximum values to 50 metres.
# Updated help messages.
# -----------
# gLAB v4.1.0
# Release: 2017/04/07
# Change Log: Added option to set user defined ticks (for both X and Y) in standard plots.
# Added option to adjust figure to margin, so there is the minimum white space margin left.
# This option applies to all modes except for world maps or integrity ratio maps.
# Fixed all errors when executing graph.py with python3.
# -----------
# gLAB v4.2.0
# Release: 2017/05/22
# Change Log: Changed default title of SBAS iono map from 'SBAS Iono Correction Map' to
# 'SBAS Iono Correction Availability Map'.
# Added unicode text transformation in WaterMark text input when running under Python 2.
# -----------
# gLAB v5.0.0
# Release: 2017/06/30
# Change Log: Added two new modes for setting ticks in the plots:
# With parameters '--XticksStep' and '--YticksStep', the ticks are set at the rate given by the user.
# With parameters '--XticksList' and '--YticksList', the user set the ticks by giving a list of ticks.
# Added options '--percentileX' and '--percentileY' in Stanford Plots mode for setting ticks when the
# 68%, 95% and 99.9% of the values are reached in each axe.
# Added option '--CbarLabel' in SBAS Availability map plots for setting a label next to the colourbar.
# Added option '--NoCbarPercent' n SBAS Availability map plots for not printing the '%' on top of the colourbar.
# Setting ticks manually now work in all plot modes.
# Vertical and horizontal label can now be set in World maps, Worst Integrity Ratio maps and SBAS maps.
# Colorbar in SBAS Availability plots now has the same height as the plot.
# -----------
# gLAB v5.1.0
# Release: 2017/11/24
# Change Log: In Mac and Linux, if the ".plot.lock" cannot be created in the current directory,
# then this file will be created in the home directory. This is to make graph
# work in Mac when gLAB is opened by double clicking in the gLAB logo after
# opening the ".dmg" file (i.e. without installing gLAB). In this case, gLAB
# files were mounted on a read-only filesystem.
# Changed title name in Stanford-ESA plots from '# samples' to '# geometries'.
# Disabled warning deprecated messages in windows and Mac.
# Removed the "Qt: Untested Windows version 6.2 detected!" warning message
# in Windows 10 from the Qt4 library used by python.
# Fixed watermark being printed over the colourbarlabels in SBAS plots mode.
# Fixed error in Stanford plots mode which made the image title get erased
# when the user provided a title which had a newline in the middle of the text.
# -----------
# gLAB v5.1.1
# Release: 2017/12/22
# Change Log: No changes in this file.
# -----------
# gLAB v5.1.2
# Release: 2018/01/12
# Change Log: No changes in this file.
# -----------
# gLAB v5.1.3
# Release: 2018/01/19
# Change Log: Removed text "PRN 0" in default ionosphere availability maps title when GEO PRN was 0
# (PRN 0 means data was read from several GEOs).
# -----------
# gLAB v5.2.0
# Release: 2018/03/09
# Change Log: The "os.remove(LockFile)" instruction is now inside a try/catch. This is to avoid a
# rare race condition that occurs when multiple instances of "graph.py" are executed
# in parallel and one of them erases the "LockFile" (.plot.lock) after the check that
# the "LockFile" exists but before the "os.remove(LockFile)" instruction is executed.
# When this race condition ocurred, the program crashed before creating the plot.
# Added option '--no-lock-file' for not creating the ".plot.lock" file.
# Added option '--SBASSystemname' (or '--sbassystemname') for changing the "SBAS" word
# in the SBAS maps default title for any user defined SBAS system name.
# Added option '--PRNtext' (or '--prntext') for changing the text "PRN #" in the
# SBAS maps default title. This is useful when multiple GEO were used and the PRN in
# the file header is 0.
# Added option '--PRNtextnewline' (or '--prntextnewline') for moving the the text "PRN #"
# in the SBAS maps default title to the line below. Useful when many GEO were used.
# Added option '--wmc' (or '--watermarkcolor') for changing the colour of the watermark.
# Added option '--wms' (or '--watermarksize') for changing the size of the watermark.
# Added option '--wmp' (or '--watermarkposition') for changing the position of the watermark.
# Changed default position of the watermark in SBAS maps. Now it will situated in the
# top right side of the image (outside the plot and over the colourbar) instead of the bottom
# right side of the plot.
# Changed default size of the watermark in SBAS maps. The size has been changed from 8 to 15.
# -----------
# gLAB v5.3.0
# Release: 2018/06/08
# Change Log: Added option '--stanetwithnames' to enable showing station names in the station map (in previous
# version, station map only showed station names. Now it can show the station name, a marker or both)
# Added options '--stanetdefaultnamesize', '--stanetdefaultnamecolor' and '--stanetdefaultnamealign' for
# setting the station name default size, colour and alignment respectively.
# Added option '--stanetwithmarkers' for adding a marker in the station map.
# Added options '--stanetdefaultmarkertype', '--stanetdefaultmarkersize' and '--stanetdefaultmarkercolor'
# for setting the station marker default type, size and colour respectively.
# Added option '--stanet' for setting the input file column number for reading the station network name.
# Added option '--stanetautolabel' for enabling a label for each station network in the station map.
# Added option '--stanetdefaultlabel' for setting the default label for the station network.
# Added option '--stanetlabel' for setting a label on a specific station network in the station map.
# Added options '--stanetmarkertype', '--stanetmarkercolor', '--stanetmarkersize' for setting a marker type,
# marker colour or marker size (respectively) on a specific station network in the station map.
# Added options '--stanetnamecolor', '--stanetnamesize', '--stanetnamealign' for setting a name colour,
# name size or name alignment (respectively) on a specific station network in the station map.
# Added new plots for SBAS plots: Maritime Continuity Risk, HDOP, PDOP and GDOP.
# Added option '--bineqcond' for setting the bin threshold to be "greater equal" or "less equal" instead of
# "greater" or "less" in SBAS plots.
# Added options '--availmapbins', '--contriskmapbins', '--contriskmarmapbins', '--ionoavailmapbins',
# '--hdopmapbins', '--pdopmapbins', '--gdopmapbins' for manually setting the number of bins and its
# thresholds values for SBAS Availability, Continuity Risk, Maritime Continuity Risk, Iono Availability,
# HDOP, PDOP and GDOP maps respectively.
# Added options '--availcontourlevels', '--contriskcontourlevels', '--contriskmarcontourlevels' for setting
# the contour levels for SBAS Availability, Continuity Risk and Maritime Continuity Risk respectively.
# Added options '--availbincolors', '--contriskbincolors', '--contriskmarbincolors', '--ionoavailbincolors',
# '--hdopbincolors', '--pdopbincolors' and --gdopbincolors' for changing the colourbar bin colours for SBAS
# Availability, Continuity Risk, Maritime Continuity Risk, Iono Availability, HDOP, PDOP and GDOP maps respectively.
# Maritime Continuity Risk, Iono Availability, HDOP, PDOP and GDOP maps respectively.
# Added option '--doppercentileplot' for making the percentile HDOP, PDOP and GDOP plots (in addition to the
# HDOP, PDOP and GDOP median plots).
# Added option '--fireu' in order to draw the European FIR area in World Maps/Station Maps/SBAS plots.
# Added option '--firuser' in order to draw a user defined FIR area (though a text file with the coordinates) in
# World Maps/Station Maps/SBAS plots.
# Added options '--firlinetype', '--firlinewidth', '--firlinecolor' and '--firmarkersize' for setting the line
# type, line width, line colour and marker size of the FIR line delimeter.
# Added option '--firdegradation' for computing and showing the availability degradation inside the FIR area.
# Added option '--firdegtext', '--firdegtextsize', '--firdegtextcolor' and '--firdegtextposition' for setting
# the text to be written, the text size, the text colour and the text position for the FIR degradation.
# -----------
# gLAB v5.4.0
# Release: 2018/11/16
# Change Log: Added option '--stanetlabelnumsta' for automatically adding the number of stations read
# for each network in the label.
# Added option '--sbasplotsize' for manually setting the plotting size
# (in centimetres) of the SBAS plot.
# Added options '--sbastopfiguremargin', '--sbasbottomfiguremargin',
# '--sbasleftfiguremargin', '--sbasrightfiguremargin' for manually setting the SBAS plot
# top, bottom, left and right margins respectively.
# Added "NA" (Not Available) bin in all SBAS plots. Points in this bin will the ones with
# 0 epochs (column NUMEPOCHS with value equal to zero), or values that go outside the
# maximum or minimum (for example, for continuity risk maps, values below 0 or above 1).
# Added option '--disablenotavailbin' for disabling the "NA" (Not Available) bin in the
# SBAS plots.
# Added option '--notavailbincolor' for changing the colour of the "NA" (Not Available) bin.
# Added option '--notavailbintext' for changing the text of the "NA" (Not Available) bin.
# Added options '--availmapbinstext', '--contriskmapbinstext', '--contriskmarmapbinstext',
# '--ionoavailmapbinstext', '--hdopmapbinstext', '--pdopmapbinstext' and '--gdopmapbinstext'
# for setting the text to be shown in the colourbar bins for SBAS Availability, Continuity
# Risk, Maritime Continuity Risk, Iono Availability, HDOP, PDOP and GDOP maps respectively.
# Added options '--availcbartitle', '--contriskcbartitle', '--contriskmarcbartitle',
# '--ionoavailcbartitle', '--hdopcbartitle', '--pdopcbartitle' and '--gdopcbartitle' for
# setting a user defined title on the top of the colourbar for SBAS Availability, Continuity
# Risk, Maritime Continuity Risk, Iono Availability, HDOP, PDOP and GDOP maps respectively.
# Added option '--firconus' for plotting the CONUS FIR area in SBAS and world maps.
# Added option '--firalaska' for plotting the Alaska FIR area in SBAS and world maps.
# Added option '--fircanada' for plotting the Canada FIR area in SBAS and world maps.
# Added option '--firmexico' for plotting the Mexico FIR area in SBAS and world maps.
# Added options '--firlinetypeeu', '--firlinetypeconus', '--firlinetypealaska',
# '--firlinetypecanada' and '--firlinetypemexico', for changing the line type for the European
# FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added options '--firlinewidtheu', '--firlinewidthconus', '--firlinewidthalaska',
# '--firlinewidthcanada' and '--firlinewidthmexico' for changing the line width for the
# European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added options '--firlinecoloreu', '--firlinecolorconus', '--firlinecoloralaska',
# '--firlinecolorcanada' and '--firlinecolormexico' for changing the line colour for the
# European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added options '--firmarkersizeeu', '--firmarkersizeconus', '--firmarkersizealaska',
# '--firmarkersizecanada' and '--firmarkersizemexico' for changing the marker size for the
# European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added option '--firdegtextheader' to add a header to the FIR degradation text for the user
# defined FIR areas. This option has to be set for each user defined FIR area.
# Added options '--firdegtextheadereu', '--firdegtextheaderconus', '--firdegtextheaderalaska',
# '--firdegtextheadercanada' and '--firdegtextheadercanada' for adding a header to the
# FIR degradation text for the European FIR, CONUS FIR, Alaska FIR, Canada FIR and
# Mexico FIR respectively.
# Added option '--nofirborder' for not plotting the user defined FIR area borders in the plot.
# This option is useful for the case that the user only wants the degradation percentage, but
# the FIR itself.
# Added options '--nofirbordereu', '--nofirborderconus', --nofirborderalaska', '--nofirbordercanada',
# '--nofirbordermexico' for not plotting borders of the European FIR, CONUS FIR, Alaska FIR,
# Canada FIR and Mexico FIR respectively in the map.
# Added option '--firdegtextfooter' to add a footer to the FIR degradation text for the user
# defined FIR areas. This option has to be set for each user defined FIR area.
# Added options '--firdegtextfootereu', '--firdegtextfooterconus', '--firdegtextfooteralaska',
# '--firdegtextfootercanada' and '--firdegtextfootermexico' for adding a footer to the
# FIR degradation text for the European FIR, CONUS FIR, Alaska FIR, Canada FIR and
# Mexico FIR respectively.
# Added options '--firdegtexteu', '--firdegtextconus', '--firdegtextalaska',
# '--firdegtextcanada' and '--firdegtextmexico' for changing the degradation FIR text of the
# European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added option '--firdegtextbins' for setting the list of bins for which the availability shall be
# computed. For each bin in the list, a line with the values will be printed.
# defined FIR areas. This option has to be set for each user defined FIR area.
# Added options '--firdegtextbinseu', '--firdegtextbinsconus', '--firdegtextbinsalaska',
# '--firdegtextbinscanada' and '--firdegtextbinsmexico' for setting the list of bins for which
# the availability shall be computed for the European FIR, CONUS FIR, Alaska FIR, Canada FIR and
# Mexico FIR respectively.
# Added options '--firdegtextsizeeu', '--firdegtextsizeconus', '--firdegtextsizealaska',
# '--firdegtextsizecanada' and '--firdegtextsizemexico' for changing the FIR degradation text
# size for the European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added options '--firdegtextcoloreu', '--firdegtextcolorconus', '--firdegtextcoloralaska',
# '--firdegtextcolorcanada' and '--firdegtextcolormexico' for changing the FIR degradation text
# colour for the European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added options '--firdegtextpositioneu', '--firdegtextpositionconus', '--firdegtextpositionalaska',
# '--firdegtextpositioncanada' and '--firdegtextpositionmexico' for changing the FIR degradation
# text position for the European FIR, CONUS FIR, Alaska FIR, Canada FIR and Mexico FIR respectively.
# Added option '--nofirdegtext' for not printing the user defined FIR degradation text in the plot.
# Added options '--nofirdegtexteu', '--nofirdegtextconus', --nofirdegtextalaska', '--nofirdegtextcanada',
# '--nofirdegtextmexico' for not printing the European FIR, CONUS FIR, Alaska FIR,
# Canada FIR and Mexico FIR degradation text respectively in the map.
# Added option '--firdegtexttable' for printing the FIR degradation text values in a table. This is
# useful when multiple FIR areas are shown.
# Added option '--printfirdegtext' for printing to standard output the FIR degradation text. If
# option '--firdegtexttable' is set, the whole table will be printed.
# Added option '--writetofilefirdegtext' for writing to a file the FIR degradation text. If
# option '--firdegtexttable' is set, the whole table will be written to the file.
# Added option '--onlyprintfirdegtext' for making the program to exit after printing the FIR degradation
# text but without showing the SBAS availability maps (useful for batch processing).
# Added option '--sbasserviceformat' for automatically setting an alternative format for SBAS maps.
# Added option '--sbasservicemaritimeformat' for automatically setting an alternative format for SBAS
# maritime maps.
# Added option '--sbasservicebinaryformat' for automatically setting an alternative format for SBAS maps
# which has only one two bins (plus the 'Not Avail' bin).
# Added option '--sbasservicemaritimebinaryformat' for automatically setting an alternative format for
# SBAS maritime maps which has only one two bins (plus the 'Not Avail' bin).
# Added option '--disablebineqcond' for disabling the condition in "greater equal" or "less equal"
# (option '--bineqcond') which is enabled by default when using options '--sbasserviceformat',
# '--sbasservicemaritimeformat', '--sbasservicebinaryformat' or '--sbasservicemaritimebinaryformat'.
# Added option '--contriskaspercentage' for showing the bin values in the continuity risk and
# maritime continuity risk as percentages instead of unitary values.
# Added option '--countries' for drawing the country borders in SBAS availability maps and
# world maps/integrity maps/station maps.
# Added option '--usastates' for drawing the USA state borders in SBAS availability maps and
# world maps/integrity maps/station maps.
# Added option '--textmark' for adding a text mark in the plot. Multiple text marks can be set
# by providing this option as many times as necessary.
# Added option '--textmarkcolor' for setting the colour of the text mark. Set this option for
# each text mark.
# Added option '--textmarksize' for setting the size of the text mark. Set this option for
# each text mark.
# Added option '--textmarkposition' for setting the position of the text mark. Set this option for
# each text mark.
# Added check for empty input files. If input file is empty, it will show an error message
# and exit, instead of showing empty plots or crashing.
# Added check for values for the colourbar bins. Now values outside the nominal ranges will not
# be accepted ([0-100] for availability and ionosphere availability maps, [0-1] for continuity
# risk and maritime continuity risk and [0-infinite] for DOP maps).
# Added missing check for assuring that the number of colours provided for the SBAS ionosphere
# availability map matches the number of bins in the colourbar.
# Added checks for the contour lines to be computed. Now it will not let you set the value of the
# smallest bin (as this makes the python function to crash). Furthermore, if one of the defined
# bins does not appear in any of the positions in the map, the contour line for this bin will
# be skipped, as this case made the python function to show incorrect contour lines.
# Added check for Python versions >=2.7.15 and >=3.6 in SBAS availability maps. In these versions
# it is necessary to set greater margins in order to fit the horizontal legend or the colourbar
# bin texts.
# In 64 bit Windows, python is now distributed with Python 3.6.6 64bit, instead of Python 2.6 32 bit
# (in Windows 32-bit still remains Python 2.6 32 bit).
# Help message now shows explicitly the values that must be provided to the parameters (if required),
# by showing next to the parameter '<text>' (a text is required), '#' (a numerical value is required),
# '#,#,...' (a list of numerical values is required), etc.
# Option '--bineqcond' is now also accepted as '--BinEqCond'.
# Option '--fireu' is now also accepted as '--FIREu'.
# It is possible to define as many user defined FIR areas as needed, instead of just one, by
# using the parameter '--firuser' as many times as necessary. Each user defined FIR area
# properties can be defined independently, by providing the parameters for setting the user
# defined FIR area properties as many times as necessary (in the same order as given in
# option '--firuser').
# User defined FIRs are now also plotted in worst integrity maps.
# European FIR area or used defined FIR area can now be set both at the same time. Moreover,
# any hard-coded FIR area can be set independently from any other FIR area set (including
# its drawing properties).
# Option '--firdegtext' now can also print the number of points over the bin value inside the
# FIR area, the number of points below below the bin value inside the FIR area, the total
# number of points inside the FIR area and the total number of points in the whole plot.
# If the bin with value '100' in SBAS availability or ionosphere availability map is set and
# the option '--bineqcond' is set, this bin will appear with the default of text '=100'
# instead of '≥100'.
# If the bin with value '0' in SBAS continuity risk, maritime continuity risk or DOP maps is set
# and the option '--bineqcond' is set, this bin will appear with the default of text '=0'
# instead of '≤0'.
# In standard 2D plots, space for a title with up to three lines will be left even if option
# '--atm' is disabled (before the space was left only if '--atm' option was enabled).
# If option '--firdegtext' is provided, FIR degradation computation will be automatically
# enabled (so it matches the behaviour of options '--firdegtextsize', '--firdegtextcolor'
# and '--firdegtextposition', which automatically enabled the FIR degradation computation).
# Error messages due to invalid values in parameters or in input files will now always show
# the invalid value in the error message (except for user defined column numbers).
# Errors due to incorrect colour or line type are now captured and show in an error message,
# instead of printing the Python's full traceback (except in Windows).
# Parameter '--availcontourlevels' now can also be called as '--availcontourlines'. Both options
# are equally valid.
# Parameter '--contriskcontourlevels' now can also be called as '--contriskcontourlines'. Both
# options are equally valid.
# Parameter '--contriskmarcontourlevels' now can also be called as '--contriskmarcontourlines'.
# Both options are equally valid.
# Parameter '--nocontourlines' now can also be called as '--nocontourlevels'. Both options are
# equally valid.
# Changed behaviour when an invalid parameter is given. Now, instead of printing the help and
# the error message, it will just print the error message.
# If user sends SIGINT signal (Ctrl+c in Unix terminal), the program will terminate without
# printing the traceback (except on Windows).
# Changed option name from '--FIRDegrafation' to '--FIRDegradation' due to it was a typo in the
# name, as the lower case option is '-firdegradation'. The previous name '--FIRDegrafation'
# will still be accepted for backwards compatibility.
# Changed slightly the input of parameter '--contriskmarbincolors', as now the colour of the
# "NA" (Not Available) bin must not be provided, where as before it had to be provided.
# The colour of the "NA" bin is now changed with parameter '--notavailbincolor'.
# Changed value formatting in error message when checking user defined contour values for
# continuity risk and maritime continuity risk maps. The offending value will be printed
# with exponential format instead of decimal format, in order to prevent that values
# smaller than 0.1 (such as 1e-3) is not shown as '0.0'.
# String formatting in all the graph.py code now uses the new python formatting style
# ("{0:s}".format(val)) instead of the old formatting style ("%s" %val).
# Changed the reference coordinate system to 'axes fraction' (that is, coordenate origin is at
# the bottom left of the figure) for all user defined positions for watermark, textmark and
# SBAS maps degradation text.
# If user sets bins over 99.9 (99.99, 99.999,...) the plot margins will auto adjust to fit
# the number in the colourbar text.
# Fixed bin "100.0" text in colourbar going out of the borders when user manually selected
# the "100.0" bin in SBAS availability and ionosphere availability maps.
# Fixed user defined FIR text (option '--firdegtext') not working when using Python3.
# Fixed world maps/integrity maps/station maps not working with old Linux distributions
# using Python 2.6 (e.g. Ubuntu 10.04).
# Fixed division by zero when computing the degradation values when there were no points
# inside the European FIR or user defined FIR area.
# Fixed legend not appearing in station maps when only the station name was printed.
# Fixed the string "DOP" being replaced for the DOP map type when the title has been defined
# the user (it had to occur only when the title was automatically set).
# Fixed error in Python 2 when station names was a number. Now the number will read as the
# name, instead of crashing.
# In SBAS DOP plots, if the number of epochs were 0, then the mean and percentile DOP was
# also 0, therefore this points were plotted to be under the minimum DOP threshold set
# (by default, shown in red colour), which was incorrect. Now, when the number of epochs
# is 0, this points will be internally set as "999", so they are shown in the greatest bin.
# SBAS plots with an aspect ratio of 1.4 or below (defined as (MaxLon-MinLon)/(MaxLat-MinLon)
# or the relation with the width and height) were plotted incorrectly (labels, title or
# even the image was out of bounds) due to an incorrect size handling inside Python libraries.
# It has been fixed by forcing to leave margins in the plots.
# For default SBAS plots (EGNOS default coverage area), if option '--prntextnewline' was
# enabled, the title would go out of bounds. Now the margin will increase in order to
# leave space for the extra line.
# Fixed bug that made European FIR in station maps use the properties from the user defined
# FIRs, instead of the European FIR properties.
# Fixed bug that made to apply maritime continuity risk contour levels to non maritime Continuity
# risk.
# Some parameters which were expected to be provided only once (in concrete '--availbincolors',
# '--contriskbincolors', '--contriskmarbincolors', '--ionoavailbincolors', '--hdopbincolors',
# '--pdopbincolors', '--gdopbincolors', '--firdegtextbinseu', '--xtickslist' and '--ytickslist')
# would mess up the results or crash the program if they were provided more than once, as it
# mixed all the data provided each time the parameter was provided. Now it will only use the
# data given the last time the parameter is read.
# Fixed "IOError: [Errno 32] Broken pipe" exception when the help was shown ('-h' parameter) and
# the output was redirected to a pipe (for instance, a pipe to the 'less' command), and the pipe
# was closed before reaching the end of the help.
# -----------
# gLAB v5.4.1
# Release: 2019/02/15
# Change Log: Added option '--firsumdeg' for computing the total degradation percentage
# in all or some of the FIRs enabled in the SBAS plots. By default it
# selects all of them, but if user selects one or more FIRs, only the
# selected FIRs will be used for the total degradation computation.
# Added options '--firsumdegeu', '--firsumdegconus', '--firsumdegalaska',
# '--firsumdegcanada', '--firsumdegmexico' and '--firsumdeguserfir' for
# controlling which FIRs want to be used for the total degradation computation.
# Added options '--firdegtextheaderfirsum', '--firdegtextfooterfirsum',
# '--firdegtextfirsum', '--firdegtextsizefirsum', '--firdegtextcolorfirsum'
# and '--firdegtextpositionfirsum' for controlling the output text and its
# properties for the total degradation computation.
# Parameter '--nofirdegtext' now accepts a comma separated list of FIR numbers.
# Fixed an error when printing the number of points below the bin value
# inside the FIR area for user defined FIR areas.
#
# -----------
# gLAB v5.4.2
# Release: 2019/03/08
# Change Log: Fixed bug in Stanford plots mode that made to appear false MIs when
# the difference between the error and the protection level was smaller
# than the resolution step for quantization and both values were not
# greater than the maximum value in their axis.
# -----------
# gLAB v5.4.3
# Release: 2019/03/20
# Change Log: Added options '--nogeometriesintitle', '--NoGeometriesInTitle',
# '--noepochsintitle' and '--NoEpochsInTitle'. All of them have the
# same effect: not to add the number of epochs or geometries in the
# title in Stanford or Stanford-ESA modes.
# Added option '--sfesawithregions' in Stanford-ESA mode to plot the
# five regions (available, MI, HMI, Unavailable, Unavailable and MI)
# as in Stanford plot mode. With this option, the user can now create
# a Stanford Plot from a quantized file already created by the user
# (e.g. a file created from epochs of several years).
# Added option '--sfesawithepochs' to write 'Epochs' instead of geometries
# in the Stanford-ESA plot.
# Added capability to set the number of epochs/geometries, number of
# points that are not MI, the number of points that are MI and the
# number of points of each of the five regions (available, MI,
# HMI, Unavailable, Unavailable and MI).
# Added options '--hal' and '--val' for setting the alarm limits in the
# horizontal and vertical axis respectively in Stanford-ESA plots.
# Added options '--availepochpos', '--unavailepochpos', '--hmiepochpos',
# '--miavailepochpos' and '--miunavailepochpos' in Stanford and
# Stanford-ESA modes for setting the position for the text printed
# in each of the regions (available, MI, HMI, Unavailable,
# Unavailable and MI) respectively.
# Options '--percentilex', '--percentiley', '--percentilexlist' and
# '--percentileylist' from Stanford mode now also work in
# Stanford-ESA mode.
# Fixed some geometries not counted as MIs in Stanford-ESA mode when
# the quantized protection level value was 0.
# Fixed crash in Stanford-ESA mode when the total number of geometries
# in any of the axis was 0 or 1.
# Fixed incorrect plotting size in Stanford mode when user set a title
# with two newlines and option 'adjust to margin' was not set.
# Fixed "System unavailable" number of epochs in Stanford plots, which
# was also counting the epochs with MIs and over the alarm limit,
# when it should only count the number of epochs over the alarm but
# not MI.
# -----------
# gLAB v5.4.4
# Release: 2019/05/10
# Change Log: Changed error message from "ERROR: One of the column number provided does
# not exist in line number {0:d} of SBAS maps data file" to
# "ERROR: One of the column number provided does not exist in line number
# {0:d} of data file". That is, the "SBAS map" words have been removed,
# as the error could also occur with non SBAS map data files.
# -----------
# gLAB v5.5.0
# Release: 2020/10/30
# Change Log: Fixed exception when the INFO lines contained filepaths with non-ascii characters.
# These encoding errors will be ignored as these INFO lines are the only one that
# may contain non ASCII characters and are not used by the plotting tool.
# -----------
# gLAB v5.5.1
# Release: 2020/12/11
# Change Log: No changes in this file.
# -----------
# END_RELEASE_HISTORY
#############################################################################
import sys,os,matplotlib,math,optparse,re,warnings,errno
import traceback
import signal
#Ignore all deprecated warnings
warnings.filterwarnings("ignore");
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from optparse import OptionParser
if (sys.platform[:3].lower() == "win"):
sys.stdout=sys.stderr
global PythonVersion
global PythonVersionDecimal
global legend
global LockFile
global CreateLockFile
legend=False
PythonVersion=sys.version_info[0]
PythonVersionDecimal=float(str(sys.version_info[0])+"."+str(sys.version_info[1]))
LockFile=".plot.lock"
CreateLockFile=True
if (sys.platform[:3].lower() != "win"):
#Tkinter when has an error shows an exception, but is not caught by the try/except
#A function in needed to be called when tkinter has an error
#In Windows, when compiled into a self-executable, this code makes the program
#instantaneously close without giving an error
def tkinter_show_error(self,*args):
err = str(traceback.format_exception(*args))
if "rgb" in err:
err = err.split("\\n")
err = err[len(err)-3].split('"')
#Color is the only exception possible, as all other user input has been checked before
print ("ERROR: User defined colour '{0:s}' is not a valid colour".format(err[1]))
else:
#Unknown error
print (err.replace("\\n","\n"))
removeLockFile()
sys.exit()
if PythonVersion == 2:
import Tkinter
#With this command, when Tkinter has an error it will call this function
Tkinter.Tk.report_callback_exception = tkinter_show_error
else:
import tkinter
#With this command, when Tkinter has an error it will call this function
tkinter.Tk.report_callback_exception = tkinter_show_error
if (sys.platform[:3].lower() != "win"):
#Function to capture SIGINT signal (Ctr+C)
#In Windows, when compiled into a self-executable, the process automatically goes into background,
#so we cannot send the signal through the terminal
def signal_SIGINT_handler(sig, frame):
removeLockFile()
sys.exit(1)
#Capture SIGINT signal (Ctr+C), so it exits without printing the python trace
signal.signal(signal.SIGINT, signal_SIGINT_handler)
class Plot:
def __init__(self):
self.FileName = ""
self.ColX = "var[0]"
self.ColY = "var[1]"
self.Cond = ""
self.Label = ""
self.Xvar = []
self.Yvar = []
self.Style = "."
self.MarkerSize = 5
self.LineWidth = 0
self.PlotColor = ""
self.PlotColorAuto = True
class Graphic:
def __init__(self):
self.PlotList=[]
self.PlotCounter = 0
self.Title = ""
self.Xlabel = ""
self.Ylabel = ""
self.FractionalTitle = ""
self.WaterMark = ""
self.WaterMarkColour = 'k'
self.WaterMarkSize = 8
self.WaterMarkSizeSetbyUser = 0
self.WaterMarkPositionX = -999
self.WaterMarkPositionY = -999
self.WaterMarkPositionSetbyUser = 0
self.TextMark = []
self.TextMarkColour = []
self.TextMarkSize = []
self.TextMarkPositionX = []
self.TextMarkPositionY = []
self.NumTextMark = 0
self.NumTextMarkColour = 0
self.NumTextMarkSize = 0
self.NumTextMarkPosition = 0
self.TextMarkColourDefault = 'k'
self.TextMarkSizeDefault = 15
self.TextMarkPositionXDefault = 0.5
self.TextMarkPositionYDefault = 0.5
self.Cbarlabel = ""
self.SupportedStylesCharactersList=['.','-','--','-.','.-',':',',','o','s','p','+','x','^','>','<','v','*','h','H','D','d','|','_','1','2','3','4']
self.ColXUser = False
self.ColYUser = False
self.Xmin = 0.0
self.Xmax = 0.0
self.Ymin = 0.0
self.Ymax = 0.0
self.XminAuto = True
self.XmaxAuto = True
self.YminAuto = True
self.YmaxAuto = True
self.XTicsUser = False
self.YTicsUser = False
self.XTicsStepUser = False
self.YTicsStepUser = False
self.XTicsListUser = False
self.YTicsListUser = False
self.XTicsMax = 0.0
self.XTicsMin = 0.0
self.XTicsNum = 0
self.YTicsMax = 0.0
self.YTicsMin = 0.0
self.YTicsNum = 0
self.XTicsStep = 0.0
self.YTicsStep = 0.0
self.XTicksList = []
self.YTicksList = []
self.AdjustToMargin = False
self.SaveFigure = False
self.SaveFigurePath = []
self.grid = True
self.NumPointsLabelUser = False
self.NumPointsLabel = 2
self.LabelPosition = 1
self.LabelPositionX = ""
self.LabelPositionY = ""
self.stanford = False
self.ALAuto = True
self.NoEpochsInTitle = False
self.StfdPercentileX = False
self.StfdPercentileY = False
self.StfdPercentileDefaultX = [0.68,0.95,0.999]
self.StfdPercentileDefaultY = [0.68,0.95,0.999]
self.StfdPercentileListX = []
self.StfdPercentileListY = []
self.AvailEpochPosX = 999.
self.AvailEpochPosY = 999.
self.UnAvailEpochPosX = 999.
self.UnAvailEpochPosY = 999.
self.MIAvailEpochPosX = 999.
self.MIAvailEpochPosY = 999.
self.HMIAvailEpochPosX = 999.
self.HMIAvailEpochPosY = 999.
self.MIUnAvailEpochPosX = 999.
self.MIUnAvailEpochPosY = 999.
self.stanfordESA = False
self.sfESAwithRegions = False
self.resolution_x_auto = True
self.resolution_y_auto = True
self.sfESAHAL = 40
self.sfESAVAL = 50
self.textGeometriesLarge = "Geometries"
self.textGeometriesShort = "Geom"
self.maxpoints_auto = True
self.worstIntegrityRatio = False
self.worstIntegrityRatioColorbar = False
self.SBASmaps = False
self.ColName = ""
self.ColLabelName = ""
self.ColRatioV = ""
self.ColRatioH = ""
self.ColMIsV = ""
self.ColMIsH = ""
self.projection = "cyl"
self.cbarAutoMin = True
self.cbarAutoMax = True
self.cbarAutoN = True
self.StaNetAddLabel = False
self.StaNetAddNumStations = False
self.StaNetWorkWithNames = False
self.StaNetWorkWithMarkers = False
self.StaNetWorkDefName = 'Other'
self.StaNetWorkDefNameSize = 9
self.StaNetWorkDefNameColor = 'blue'
self.StaNetWorkDefNameHorAlign = 'center'
self.StaNetWorkDefNameVerAlign = 'bottom' #Note: Vertical alignment is inverted when applied by annotate function, so this is 'top' alignment
self.StaNetWorkDefMarkerType = 'o'
self.StaNetWorkDefMarkerSize = 5
self.StaNetWorkDefMarkerColor = 'blue'
self.StaLabelListName = []
self.StaLabelListValue = []
self.StaMarkerTypeListName = []
self.StaMarkerTypeListValue = []
self.StaMarkerColorListName = []
self.StaMarkerColorListValue = []
self.StaMarkerSizeListName = []
self.StaMarkerSizeListValue = []
self.StaLetterSizeListName = []
self.StaLetterSizeListValue = []
self.StaLetterColorListName = []
self.StaLetterColorListValue = []
self.StaLetterHorAlignListName = []
self.StaLetterHorAlignListValue = []
self.StaLetterVerAlignListName = []
self.StaLetterVerAlignListValue = []
self.Countries = False
self.USAStates = False
self.continentColor = ""
self.lakeColor = ""
self.boundaryColor = ""
self.MapResolution = "l"
self.ColorMap = ""
self.BinsEqualCondition = False
self.DisableBinsEqualCondition = False
self.ContRiskAsPercentage = False
self.ServiceFormat = False
self.ServiceBinaryFormat = False
self.ServiceFormatMaritime = False
self.ServiceBinaryFormatMaritime = False
self.NotAvailBin = True
self.NotAvailColour = "#000000"
self.NotAvailText = "NA"
self.contourlines = True
self.CbarPercentage = True
self.AvailCbarTitle = ""
self.ContRiskCbarTitle = ""
self.ContRiskMarCbarTitle = ""
self.IonoAvailCbarTitle = ""
self.HDOPCbarTitle = ""
self.PDOPCbarTitle = ""
self.GDOPCbarTitle = ""
self.DOPPercentilePlot = False
self.SBASsystemName = ""
self.PRNtext = ""
self.PRNtextNewline = False
self.UserSetAvailBins = False
self.UserSetIonoBins = False
self.UserSetRiskBins = False
self.UserSetRiskMarBins = False
self.UserSetHDOPBins = False
self.UserSetPDOPBins = False
self.UserSetGDOPBins = False
self.AvailBins = [19.9,20.0,50.0,75.0,90.0,95.0,97.5,99.0,99.5,99.9]
self.IonoAvailBins = [19.9,20.0,50.0,75.0,90.0,95.0,97.5,99.0,99.5,99.9]
self.RiskBins = [7.6e-3,7.5e-3,5e-3,2.5e-3,1e-3,7.5e-4,5e-4,2.5e-4,1e-4,1e-5]
self.RiskMarBins = [7.6e-3,7.5e-3,5e-3,2.5e-3,1e-3,7.5e-4,5e-4,2.5e-4,1e-4,1e-5]
self.HDOPBins = [4.1,4,2]
self.PDOPBins = [6.1,6,3.5]
self.GDOPBins = [7.1,7,5]
self.AvailBinsText = []
self.IonoAvailBinsText = []
self.RiskBinsText = []
self.RiskMarBinsText = []
self.HDOPBinsText = []
self.PDOPBinsText = []
self.GDOPBinsText = []
self.AvailContourLevels = [95.0,97.5,99.9]
self.RiskContourLevels = [1e-3,1e-5]
self.RiskMarContourLevels = [1e-3,1e-5]
self.AvailColorList = []
self.ContRiskColorList = []
self.ContRiskMarColorList = []
self.IonoAvailColorList = []
self.HDOPColorList = []
self.PDOPColorList = []
self.GDOPColorList = []
self.TopMargin = -1
self.BottomMargin = -1
self.LeftMargin = -1
self.RightMargin = -1
self.SBASplotUserSetSize = False
self.FigHorSize = -1
self.FigVerSize = -1
self.UserDefinedBinsOrContours = False
self.UserDefinedAvailContourlevels = False
self.UserDefinedRiskContourlevels = False
self.UserDefinedRiskMarContourlevels = False
self.FIREurope = False
self.FIRCONUS = False
self.FIRAlaska = False
self.FIRCanada = False
self.FIRMexico = False
self.FIRDegradation = False
self.FIRNumUserFile = 0
self.FIRUserFile = []
self.latFIR = [[]]
self.lonFIR = [[]]
self.latFIREur = []
self.lonFIREur = []
self.latFIRCONUS = []
self.lonFIRCONUS = []
self.latFIRAlaska = []
self.lonFIRAlaska = []
self.latFIRCanada = []
self.lonFIRCanada = []
self.latFIRMexico = []
self.lonFIRMexico = []
self.FIRUserSelLineColorEur = False
self.FIRUserSelLineColorCONUS = False
self.FIRUserSelLineColorAlaska = False
self.FIRUserSelLineColorCanada = False
self.FIRUserSelLineColorMexico = False
self.FIRShowBorder = [1]
self.FIRShowBorderEur = True
self.FIRShowBorderCONUS = True
self.FIRShowBorderAlaska = True
self.FIRShowBorderCanada = True
self.FIRShowBorderMexico = True
self.FIRNumLineColor = 0
self.FIRLineColorDefault = 'w'
self.FIRLineColor = []
self.FIRLineColorEur = self.FIRLineColorDefault
self.FIRLineColorCONUS = self.FIRLineColorDefault
self.FIRLineColorAlaska = self.FIRLineColorDefault
self.FIRLineColorCanada = self.FIRLineColorDefault
self.FIRLineColorMexico = self.FIRLineColorDefault
self.FIRNumMarkerSize = 0
self.FIRMarkerSizeDefault = 5
self.FIRMarkerSize = []
self.FIRMarkerSizeEur = self.FIRMarkerSizeDefault
self.FIRMarkerSizeCONUS = self.FIRMarkerSizeDefault
self.FIRMarkerSizeAlaska = self.FIRMarkerSizeDefault
self.FIRMarkerSizeCanada = self.FIRMarkerSizeDefault
self.FIRMarkerSizeMexico = self.FIRMarkerSizeDefault
self.FIRNumLineStyle = 0
self.FIRLineStyleDefault = '--'
self.FIRLineStyle = []
self.FIRLineStyleEur = self.FIRLineStyleDefault
self.FIRLineStyleCONUS = self.FIRLineStyleDefault
self.FIRLineStyleAlaska = self.FIRLineStyleDefault
self.FIRLineStyleCanada = self.FIRLineStyleDefault
self.FIRLineStyleMexico = self.FIRLineStyleDefault
self.FIRNumLineWidth = 0
self.FIRLineWidthDefault = 2
self.FIRLineWidth = []
self.FIRLineWidthEur = self.FIRLineWidthDefault
self.FIRLineWidthCONUS = self.FIRLineWidthDefault
self.FIRLineWidthAlaska = self.FIRLineWidthDefault
self.FIRLineWidthCanada = self.FIRLineWidthDefault
self.FIRLineWidthMexico = self.FIRLineWidthDefault
self.FIRShowDegText = [1]
self.FIRShowDegTextEur = True
self.FIRShowDegTextCONUS = True
self.FIRShowDegTextAlaska = True
self.FIRShowDegTextCanada = True
self.FIRShowDegTextMexico = True
self.FIRNumDegText = 0
self.FIRDegTextTable = False
self.FIRDegTextHeader = []
self.FIRNumDegTextHeader = 0
self.FIRDegTextHeaderEur = "]]]]]]]]][[[[[[[[[[[" #Random text to check that user did not set any header or empty header
self.FIRDegTextHeaderCONUS = "]]]]]]]]][[[[[[[[[[["
self.FIRDegTextHeaderAlaska = "]]]]]]]]][[[[[[[[[[["
self.FIRDegTextHeaderCanada = "]]]]]]]]][[[[[[[[[[["
self.FIRDegTextHeaderMexico = "]]]]]]]]][[[[[[[[[[["
self.FIRDegTextHeaderFIRSum = "]]]]]]]]][[[[[[[[[[["
self.FIRDegTextFooter = []
self.FIRNumDegTextFooter = 0
self.FIRDegTextFooterEur = ""
self.FIRDegTextFooterCONUS = ""
self.FIRDegTextFooterAlaska = ""
self.FIRDegTextFooterCanada = ""
self.FIRDegTextFooterMexico = ""