-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclassSES.py
8382 lines (7835 loc) · 423 KB
/
classSES.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
#! python3
#
# Copyright 2020-2024, Ewan Bennett
#
# All rights reserved.
#
# Released under the BSD 2-clause licence (SPDX identifier: BSD-2-Clause)
#
# email: [email protected]
#
# A class for manipulating SES data from binary files generated by the
# SESconv.py program (which processes .PRN, .TMP and .OUT files written
# out by several versions of SES).
# Note that classSES needs the Python libraries "numpy" and "pandas"
# to be installed on the machine.
#
# The class has methods for the following:
# * getting transient data at one point in an SES geometry:
# GetTransientData().
#
# * getting transient data (e.g. velocity) along an SES route at one time:
# GetProfileTransient().
#
# * getting fixed data (e.g. perimeter) along an SES route at one time:
# GetProfileFixed().
#
# * getting train performance data, plottable against distance and
# time: GetTrainData().
#
# * writing a new SES input file from the contents stored in the
# class: WriteInputFile().
# Input files can be generated for SES v4.1, OpenSES 4.3 and
# offline-SES 204.5.
#
# * Printing the contents of the variables in the binary file in a
# way that makes sense to human eyes (I think): PrettyClassPrint().
#
# * Printing a list of the names of all the variables in the binary.
# Use self.PrettyClassPrint("x")
#
# * Describing the variables. For example, use self.Describe("sec_DPs")
# to show the contents of the pandas Dataframe called sec_DPs (it
# holds the pressure drops in sections.
#
# Most of the methods have been written in ways that make it easy
# to call them from the script "Hobyah.py", and if you are considering
# using SESconv.py for something you may want to look at that file.
#
# Various other routines exist to do ancillary stuff like checking that
# the location to plot at is valid.
#
#
import sys
import os
import math
import re # regular expressions
import generics as gen # general routines
import UScustomary as USc # imperial to metric conversion
import pickle
try:
import numpy as np
except ModuleNotFoundError:
print("> Ugh, can't process this run because Python's\n"
'> "numpy" library is not installed on this computer.\n'
'> Please get your local IT guru to install it, then\n'
'> try again. If you are your IT guru, good luck!\n'
)
if __name__ == "__main__":
# Only call sys.exit() if we are running it directly (unlikely).
sys.exit()
try:
import pandas as pd
except ModuleNotFoundError:
print("> Ugh, can't process this run because Python's\n"
'> "pandas" library is not installed on this computer.\n'
'> Please get your local IT guru to install it, then\n'
'> try again. If you are your IT guru, good luck!\n'
)
if __name__ == "__main__":
sys.exit()
class SESdata:
'''A Python 3 class for holding the fixed and transient data from
an SES run.
It returns a class that holds the following:
* All the fixed properties of the segments, subsegments, nodes,
routes, fires, fans, jet fans, trains etc.
* All the transient data of conditions in sections, segments and
subsegments.
* Transient data of area, velocity and volume flow in each subpoint.
A "subpoint" may be at the back end, midpoint or forward end of a
subsegment.
The area, velocity and volume flow account for the presence of
moving trains (i.e. annulus area, air velocity in the annulus,
volume flow in the annulus: these are very handy).
* All the transient data of train performance.
* All the transient data for ECZ estimates (changes to wall
temperatures and mean temperatures in uncontrolled zones,
heat flows in controlled zones).
Various errors are written to the screen and to the logfile.
This class is mostly used in programs that have a logfile already
open and which have called the class while reading a line of input;
the error messages require a line number and line text so that when
something goes wrong the error messages are informative.
'''
# Initialize the data.
def __init__(self, bin_path, bin_name, log,
line_number = 1, line_text = "no line of input"):
'''Take a folder name, a file name, an already open log file,
an optional Boolean and a couple of arguments that can be
used in error messages.
Read the contents into dictionaries and pandas DataFrames. If
the binary file is misformed, return an error message that
points to the line number and line text in the file that created
the class instance.
If the Boolean 'silentsulk' is True, the routine will not
write an error message if it is passed the name of a Hobyah
binary file, it will just return None.
Parameters:
bin_path str The name of a folder
bin_name str The name of an .sbn file
log handle The handle of a log file that is open
and that the class has permission to
write to.
line_number int The line number that was read that
prompted this call to open the file
(used in error messages). If you are
using the class from an interpreter,
don't include it.
line_text str The text of the line being read that
prompted this call to open the file
(used in error messages). If you are
using the class from an interpreter,
don't include it.
Returns:
SESdata class All the fixed and transient data
in the .sbn file if we successfully
read the file. None if an error
occurred.
'''
# Set the file path. We do some cleaning up and add a trailing
# slash if needed (I keep forgetting it when running in the
# interpreter).
if bin_path == '':
# Set the current directory as the file path.
self.bin_path = os.getcwd()
else:
self.bin_path = bin_path
# Add a trailing directory separator, if needed.
if len(self.bin_path) > 1 and self.bin_path[-1] not in "/\\":
self.bin_path = self.bin_path + '/'
self.bin_name = bin_name
self.log = log
# Read the fixed and transient data from the file. The routine
# returns a value identifying if this file was read successfully or not.
# (None if faulty, True if OK).
self.success = self._ReadSESData()
if self.success is None:
return(None)
else:
# Make a dictionary of the settable SES options. The result is
# a description that can be used in error messages. These are
# all settings from form 1C or form 1G, now held in
# self.settings_dict.
# We don't include the flywheel option because when there are
# no flywheels the flywheel values are printed as zero.
self.opt_descrip = {"tpot": "train performance option (form 1C)",
"tempopt": "temperature simulation option (form 1C)",
"eczopt": "environmental control option (form 1C)",
"supopt": "supplementary print option (form 1C)",
"firopt": "fire simulation option (form 1G)",
}
# Make a set of conversion factor names for the conversions
# that involve Joules, as there are two types of Joule: the
# one used by SES v4.1 and the one used by anyone writing a
# program from scratch (the IT BTU).
if gen.CheckSESVer(self.prog_type):
# We want to use the conversion factors based on the
# SES v4.1 BTU (1 BTU = 1054.118 J ).
energy_fac = "v4_1energy"
watt1_fac = "v41_watt1"
watt2_fac = "v41_watt2"
kwatt_fac = "v41_kwatt"
Mwatt_fac = "v41_Mwatt"
thcon_fac = "v41_thcon"
specheat_fac = "v41_specheat"
SHTC_fac = "v41_SHTC"
SHTC2_fac = "v41_SHTC2"
wattpua_fac = "v41_wattpua"
wperm_fac = "v41_wperm"
else:
# We want to use the conversion factors involving the
# IT BTU (1 BTU = 1055.056 J). We use this in Hobyah
# conversions, but it may come in useful if someone
# ends up using this class on SVS v6 output files (as
# IP2SI2IP.EXE seems to use the IT BTU instead of the
# SES v4.1 BTU.
energy_fac = "IT_energy"
watt1_fac = "IT_watt1"
watt2_fac = "IT_watt2"
kwatt_fac = "IT_kwatt"
Mwatt_fac = "IT_Mwatt"
thcon_fac = "IT_thcon"
specheat_fac = "IT_specheat"
SHTC_fac = "IT_SHTC"
SHTC2_fac = "IT_SHTC2"
wattpua_fac = "IT_wattpua"
wperm_fac = "IT_wperm"
# This class can handle a number of different versions of SES
# and the properties that can be plotted from them varies.
# The list below is the base set of SES versions that can
# plot everything. Where a new version of SES is available
# that plots additional stuff (such as runtime jet fan thrust)
# it is added to this base list of program types that can
# plot the basic properties.
basic = ["SES 4.10",
"OpenSES 4.2", "OpenSES 4.3",
"SES 204.2", "SES 204.3",
"SES 204.4", "SES 204.5", ]
# Make a dictionary of requirements and data for each plot type.
# These include the version numbers of SES that can plot them,
# the options that must be set in an SES file in order for the
# property to be available in the output, and a definition of
# where the property is plotted (e.g. pressures are in sections,
# temperatures are in subsegments, annulus air velocities are
# in three points inside each subsegment (back end, midpoint
# and forward end), called "subpoints".
# This also records if they are signed (i.e. they need to be
# multiplied by -1 if they are back-to-front in routes).
# Temperatures are not signed, air velocities and volume
# flows are.
self.properties = {
"dp": {"versions": basic,
"place": "section",
"descrip": "total pressure",
"conversion": "press1",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.sec_DPs,
"open_air": 0.0, # The value to plot if outside the tunnel
# Pressure is only available with supplementary
# print options 3 and 5.
"supopt": (3, 5),
},
"dp_indiv": {"versions": basic,
"place": "section",
"descrip": "pressure drop in sections",
"conversion": "press1",
"signed": True,
"transient": True,
"curve_types": ("profile",),
"var_name": self.sec_DPs,
"open_air": 0.0,
"supopt": (3, 5),
},
"qses": {"versions": basic,
"place": "segment",
"descrip": "SES volume flow",
"conversion": "volflow",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.seg_flows,
"open_air": 0.0,
# This property is always available so we
# have no entries for supplementary print
# option (unlike the previous entry, "dp").
},
"vses": {"versions": basic,
"place": "segment",
"descrip": "SES air velocity",
"conversion": "speed1",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.seg_vels,
"open_air": 0.0,
},
"wall_temp":{"versions": basic,
"place": "subseg",
"descrip": "wall temperature",
"conversion": "temp",
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_walltemps,
"open_air": 0.0,
"tempopt": (1, 2),
},
"db": {"versions": basic,
"place": "subseg",
"descrip": "air temperature",
"conversion": "temp",
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_temps,
"open_air": self.settings_dict["ext_DB"],
"tempopt": (1, 2),
},
"w": {"versions": basic,
"place": "subseg",
"descrip": "water content",
"conversion": "W",
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_humids,
"open_air": self.settings_dict["ext_W"],
"tempopt": (1, 2),
},
"sens": {"versions": basic,
"place": "subseg",
"descrip": "sensible heat gain",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_sens,
"open_air": 0.0,
"tempopt": (1, 2),
},
"lat": {"versions": basic,
"place": "subseg",
"descrip": "latent heat gain",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_lat,
"open_air": 0.0,
"tempopt": (1, 2),
},
"sens_pul": {"versions": basic,
"place": "subseg",
"descrip": "sensible heat gain per m", # m or ft
"conversion": wperm_fac,
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_sens,
"open_air": 0.0,
"tempopt": (1, 2),
},
"lat_pul": {"versions": basic,
"place": "subseg",
"descrip": "latent heat gain per m", # m or ft
"conversion": wperm_fac,
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subseg_lat,
"open_air": 0.0,
"tempopt": (1, 2),
},
"annulus": {"versions": basic,
"place": "subpoint",
"descrip": "annulus area",
"conversion": "area",
"signed": False,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subpoint_areas,
"open_air": 0.0,
},
"qcold": {"versions": basic,
"place": "subpoint",
"descrip": "cold volume flow",
"conversion": "volflow",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subpoint_coldflows,
"open_air": 0.0,
},
"qwarm": {"versions": basic,
"place": "subpoint",
"descrip": "warm volume flow",
"conversion": "volflow",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subpoint_warmflows,
"open_air": 0.0,
},
"vcold": {"versions": basic,
"place": "subpoint",
"descrip": "cold air velocity",
"conversion": "speed1",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subpoint_coldvels,
"open_air": 0.0,
},
"vwarm": {"versions": basic,
"place": "subpoint",
"descrip": "warm air velocity",
"conversion": "speed1",
"signed": True,
"transient": True,
"curve_types": ("transient", "profile"),
"var_name": self.subpoint_warmvels,
"open_air": 0.0,
},
# The definitions of train properties start here.
#
"route": {"versions": basic,
"place": "train",
"descrip": "route of",
"conversion": "nulldash",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.route_num,
"tpopt": (1, 2, 3),
},
"type": {"versions": basic,
"place": "train",
"descrip": "type of",
"conversion": "nulldash",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_type,
"tpopt": (1, 2, 3),
},
# Chainage is a special property in one respect, in that
# it can only be plotted against time, not against distance.
"chainage": {"versions": basic,
"place": "train",
"descrip": "down end chainage of",
"conversion": "dist1",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_locn,
"tpopt": (1, 2, 3),
},
# "time" is equivalent to "chainage" above but with the
# axes switched over.
"time": {"versions": basic,
"place": "train",
"descrip": "down end chainage of",
"conversion": "seconds",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_locn,
"tpopt": (1, 2, 3),
},
"speed": {"versions": basic,
"place": "train",
"descrip": "speed of",
"conversion": "speed2",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_speed,
"tpopt": (1, 2, 3),
},
"qtrains": {"versions": basic,
"place": "train",
"descrip": "volume flow of",
"conversion": "volflow",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_speed,
"tpopt": (1, 2, 3),
},
"accel": {"versions": basic,
"place": "train",
"descrip": "acceleration of",
"conversion": "accel",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_accel,
"tpopt": (1, 2, 3),
},
"aerodrag": {"versions": basic,
"place": "train",
"descrip": "aero drag of",
"conversion": "Force1",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_aerodrag,
"tpopt": (1, 2, 3),
},
"cd": {"versions": basic,
"place": "train",
"descrip": "drag coefficient of",
"conversion": "nulldash",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_coeff,
"tpopt": (1, 2, 3),
},
"te": {"versions": basic,
"place": "train",
"descrip": "tractive effort of",
"conversion": "Force1",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_TE,
"tpopt": (1, 2, 3),
},
"motoramps":{"versions": basic,
"place": "train",
"descrip": "amps/motor on",
"conversion": "Amotor",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.motor_amps,
"tpopt": (1, 2, 3),
},
"lineamps": {"versions": basic,
"place": "train",
"descrip": "amps/(powered car) on",
"conversion": "Acar",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.line_amps,
"tpopt": (1, 2, 3),
},
"flywh_rpm":{"versions": basic,
"place": "train",
"descrip": "flywheel speed on",
"conversion": "rpm",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.flywh_rpm,
"tpopt": (1, 2, 3),
},
"acceltemp":{"versions": basic,
"place": "train",
# "descrip": "acceleration grid temp of",
"descrip": "temp. of traction thermal mass on",
"conversion": "temp",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.accel_temp,
"tpopt": (1, 2, 3),
},
"deceltemp":{"versions": basic,
"place": "train",
# "descrip": "deceleration grid temp of",
"descrip": "temp. of brake thermal mass on",
"conversion": "temp",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.decel_temp,
"tpopt": (1, 2, 3),
},
"pwr_all": {"versions": basic,
"place": "train",
"descrip": "power wasted by",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_all,
"tpopt": (1, 2, 3),
},
"heat2air": {"versions": basic,
"place": "train",
"descrip": "heat to air by",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.heat_reject,
"tpopt": (1, 2, 3),
},
"mode": {"versions": basic,
"place": "train",
"descrip": "travel mode of", # 0 to 7, see below.
# MODEV(NUMV) IS THE ARRAY THAT CONTAINS THE TRAIN PERFORMANCE
# OPERATING MODE OF EACH TRAIN.
# 0 = STOPPED AT A STATION
# 1 = MAINTAINING CONSTANT SPEED
# 2 = ACCELERATING AT FULL AVAILABLE POWER
# 3 = BRAKING FOR EITHER A SPEED RESTRICTION OR A STATION
# (VARIABLE DECELERATION RATE)
# 4 = BRAKING FOR EITHER A SPEED RESTRICTION OR A STATION
# (CONSTANT DECELERATION RATE)
# 5 = COASTING
# 6 = MAINTAINING MINIMUM SPEED IN A TRACK SECTION WHERE
# COASTING IS PERMITTED
# 7 = ATTEMPTING TO MAINTAIN CONSTANT MINIMUM SPEED IN A
# TRACK SECTION WHERE COASTING IS PERMITTED
# The above description is from the SES v4.1 file "Record.txt".
"conversion": "nulldash",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_modev,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_aux": {"versions": basic,
"place": "train",
"descrip": "auxiliary power drawn by",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_aux,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_prop": {"versions": basic,
"place": "train",
"descrip": "traction power drawn by",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_prop,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_regen":{"versions": basic,
"place": "train",
"descrip": "traction power regenerated by",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_regen,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_flywh":{"versions": basic,
"place": "train",
"descrip": "power from flywheels on",
"conversion": watt1_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_flywh,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_accel":{"versions": basic,
"place": "train",
"descrip": "power to traction thermal mass on",
"conversion": watt2_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_accel,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_decel":{"versions": basic,
"place": "train",
"descrip": "power to brake thermal mass on",
"conversion": watt2_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_decel,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"pwr_mech": {"versions": basic,
"place": "train",
"descrip": "power to overcome mechanical losses on",
"conversion": watt2_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.pwr_mech,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"heat_adm":{"versions": basic,
"place": "train",
"descrip": "propulsion heat to air on",
"conversion": wperm_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.heat_adm,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"heat_sens":{"versions": basic,
"place": "train",
"descrip": "auxiliary sensible heat to air on",
"conversion": wperm_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.heat_sens,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"heat_lat": {"versions": basic,
"place": "train",
"descrip": "auxiliary latent heat to air on",
"conversion": wperm_fac,
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.heat_lat,
"tpopt": (1, 2, 3),
# This is only available with supplementary print
# options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
"effic1": {"versions": basic,
"place": "train",
"descrip": "traction efficiency of",
"conversion": "nulldash",
"signed": False,
"transient": True,
"curve_types": ("transient",),
"var_name": self.train_eff,
"tpopt": (1, 2, 3),
# Traction efficiency is only available with
# supplementary print options 2, 3, 4 and 5.
"supopt": (2, 3, 4, 5),
},
# These are the properties that return data that can be
# used by Hobyah.py to plot icons as gnuplot objects
# (polygons, arrows, labels) instead of curves.
"trains": {"versions": basic,
"place": "route_icons",
"descrip": "train icons on ",
"conversion": "null",
"signed": False,
"transient": True,
"curve_types": ("icons",),
"var_name": self.train_locn,
"open_air": "not used",
},
"fires": {"versions": basic,
"place": "route_icons",
"descrip": "fire icons on ",
"conversion": "null",
"signed": False,
"transient": True,
"curve_types": ("icons",),
"var_name": self.form4_dict,
"open_air": "not used",
},
"jetfans": {"versions": basic,
"place": "route_icons",
"descrip": "jet fan icons on ",
"conversion": "null",
"signed": False,
"transient": True,
"curve_types": ("icons",),
"var_name": self.form3_dict,
"open_air": "not used",
},
# These are properties that are fixed and are defined in the
# route definitions. Because we do not have a pandas database
# for these, we give pointers to the dictionary keys that
# return the relevant lists of X values and lists of Y values.
"elevations":{"versions": basic,
"place": "route",
"descrip": "route elevations",
"conversion": "dist1",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "single_chs",
"y_list": "elevations",
"open_air": "not used",
"tpopt": (1, 2),
},
"gradients":{"versions": basic,
"place": "route",
"descrip": "route gradients",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "paired_chs",
"y_list": "gradient2",
"open_air": "not used",
# When we plot SES gradients in Hobyah we want
# to show fraction -1 to +1, not percentage -100
# to +100. In the binary file they are stored
# as percentages.
"multiplier" : 0.01,
"tpopt": (1, 2),
},
"stacks": {"versions": basic,
"place": "route",
"descrip": "stack elevations",
"conversion": "dist1",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "seg_chs",
"y_list": "seg_elevs",
"open_air": "not used",
},
"stackgrads":{"versions": basic,
"place": "route",
"descrip": "stack gradients",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "stack_chs",
"y_list": "stack_grads",
# When we plot SES gradients in Hobyah we want
# to show fraction -1 to +1, not percentage -100
# to +100. In the binary file they are stored
# as percentages.
"multiplier" : 0.01,
"open_air": "not used",
},
"speedlimits":{"versions": basic,
"place": "route",
"descrip": "speed limits",
"conversion": "speed2",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "paired_chs",
"y_list": "speedlimit2",
"open_air": "not used",
"tpopt": (1,),
},
"radius": {"versions": basic,
"place": "route",
"descrip": "track radius",
"conversion": "dist1",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "paired_chs",
"y_list": "radius2",
"open_air": "not used",
"tpopt": (1, 2),
},
"sectors": {"versions": basic,
"place": "route",
"descrip": "track sectors",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "paired_chs",
"y_list": "sector2",
"open_air": "not used",
"tpopt": (1, 2),
},
"coasting": {"versions": basic,
"place": "route",
"descrip": "coasting rule",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "simple",
"var_name": self.form8_dict,
"x_list": "paired_chs",
"y_list": "coasting2",
"open_air": "not used",
"tpopt": (1,),
},
"sections": {"versions": basic,
"place": "route",
"descrip": "section numbers",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "double_up1",
"var_name": self.form8_dict,
"x_list": "sec_chs",
"y_list": "sec_list",
"open_air": "not used",
},
"segments": {"versions": basic,
"place": "route",
"descrip": "segment numbers",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "double_up1",
"var_name": self.form8_dict,
"x_list": "seg_chs",
"y_list": "seg_list",
"open_air": "not used",
},
"subsegs": {"versions": basic,
"place": "route",
"descrip": "count of subsegments",
"conversion": "null",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "double_up2",
"var_name": self.form8_dict,
"x_list": "seg_chs",
"y_list": "seg_nums",
"sub_dict": self.form3_dict,
"sub_key": "subsegs",
"open_air": "not used",
},
"sublength": {"versions": basic,
"place": "route",
"descrip": "subsegment length",
"conversion": "dist1",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "double_up2",
"var_name": self.form8_dict,
"x_list": "seg_chs",
"y_list": "seg_nums",
"sub_dict": self.form3_dict,
"sub_key": "sublength",
"open_air": "not used",
},
# This next keyword is the area in the segment definitions.
# If you want to see the area change as trains move through
# the tunnels, use the "annulus" keyword instead.
"area": {"versions": basic,
"place": "route",
"descrip": "segment areas",
"conversion": "area",
"signed": False,
"transient": False,
"curve_types": ("profile",),
"complexity": "double_up2",
"var_name": self.form8_dict,
"x_list": "seg_chs",
"y_list": "seg_nums",
"sub_dict": self.form3_dict,
"sub_key": "area",
"open_air": "not used",