pyBADA 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyBADA/TCL.py +391 -341
- pyBADA/aircraft.py +81 -131
- pyBADA/bada3.py +269 -312
- pyBADA/bada4.py +212 -260
- pyBADA/badaH.py +84 -169
- pyBADA/configuration.py +60 -0
- {pybada-0.1.1.dist-info → pybada-0.1.2.dist-info}/METADATA +5 -7
- {pybada-0.1.1.dist-info → pybada-0.1.2.dist-info}/RECORD +11 -11
- {pybada-0.1.1.dist-info → pybada-0.1.2.dist-info}/WHEEL +1 -1
- {pybada-0.1.1.dist-info → pybada-0.1.2.dist-info}/licenses/AUTHORS +0 -0
- {pybada-0.1.1.dist-info → pybada-0.1.2.dist-info}/licenses/LICENCE.txt +0 -0
pyBADA/bada4.py
CHANGED
|
@@ -20,7 +20,7 @@ from pyBADA import constants as const
|
|
|
20
20
|
from pyBADA import conversions as conv
|
|
21
21
|
from pyBADA import atmosphere as atm
|
|
22
22
|
from pyBADA import configuration as configuration
|
|
23
|
-
from pyBADA.aircraft import Airplane, BadaFamily
|
|
23
|
+
from pyBADA.aircraft import Airplane, BadaFamily, Bada
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def proper_round(num, dec=0):
|
|
@@ -44,32 +44,7 @@ class Parser:
|
|
|
44
44
|
pass
|
|
45
45
|
|
|
46
46
|
@staticmethod
|
|
47
|
-
def
|
|
48
|
-
"""
|
|
49
|
-
Lists all subfolders within a specified directory.
|
|
50
|
-
|
|
51
|
-
:param folderPath: Path to the directory where subfolders are to be listed.
|
|
52
|
-
:type folderPath: str
|
|
53
|
-
:returns: A list of subfolder names within the specified directory.
|
|
54
|
-
:rtype: list of str
|
|
55
|
-
|
|
56
|
-
This function retrieves all entries in the given directory and filters out
|
|
57
|
-
the ones that are not directories. Only the names of the subfolders are returned.
|
|
58
|
-
"""
|
|
59
|
-
# List all entries in the directory
|
|
60
|
-
entries = os.listdir(folderPath)
|
|
61
|
-
|
|
62
|
-
# Filter out entries that are directories
|
|
63
|
-
subfolders = [
|
|
64
|
-
entry
|
|
65
|
-
for entry in entries
|
|
66
|
-
if os.path.isdir(os.path.join(folderPath, entry))
|
|
67
|
-
]
|
|
68
|
-
|
|
69
|
-
return subfolders
|
|
70
|
-
|
|
71
|
-
@staticmethod
|
|
72
|
-
def readMappingFile(filePath, badaVersion):
|
|
47
|
+
def readMappingFile(filePath):
|
|
73
48
|
"""
|
|
74
49
|
Parses the BADA4 mapping XML file and stores a dictionary of aircraft code names and their corresponding XML file paths.
|
|
75
50
|
|
|
@@ -78,18 +53,14 @@ class Parser:
|
|
|
78
53
|
for the specified BADA version.
|
|
79
54
|
|
|
80
55
|
:param filePath: The path to the directory containing the BADA4 mapping XML file.
|
|
81
|
-
:param badaVersion: The BADA version (e.g., "4.3") for which the mapping file is to be parsed.
|
|
82
56
|
:type filePath: str
|
|
83
|
-
:type badaVersion: str
|
|
84
57
|
:raises IOError: If the XML file cannot be found or parsed.
|
|
85
58
|
|
|
86
59
|
:return: A dictionary with aircraft code names as keys and corresponding file names as values.
|
|
87
60
|
:rtype: dict
|
|
88
61
|
"""
|
|
89
62
|
|
|
90
|
-
filename = os.path.join(
|
|
91
|
-
filePath, "BADA4", badaVersion, "aircraft_model_default.xml"
|
|
92
|
-
)
|
|
63
|
+
filename = os.path.join(filePath, "aircraft_model_default.xml")
|
|
93
64
|
|
|
94
65
|
code_fileName = {}
|
|
95
66
|
|
|
@@ -109,7 +80,7 @@ class Parser:
|
|
|
109
80
|
return code_fileName
|
|
110
81
|
|
|
111
82
|
@staticmethod
|
|
112
|
-
def parseMappingFile(filePath,
|
|
83
|
+
def parseMappingFile(filePath, acName):
|
|
113
84
|
"""
|
|
114
85
|
Retrieves the file name for a given aircraft name from the parsed BADA4 mapping file.
|
|
115
86
|
|
|
@@ -117,16 +88,14 @@ class Parser:
|
|
|
117
88
|
associated with the given aircraft name (acName).
|
|
118
89
|
|
|
119
90
|
:param filePath: The path to the directory containing the BADA4 mapping XML file.
|
|
120
|
-
:param badaVersion: The BADA version (e.g., "4.3") for which the mapping file is to be parsed.
|
|
121
91
|
:param acName: The aircraft code name for which the corresponding file is being requested.
|
|
122
92
|
:type filePath: str
|
|
123
|
-
:type badaVersion: str
|
|
124
93
|
:type acName: str
|
|
125
94
|
:return: The file name corresponding to the aircraft code, or None if the aircraft code is not found.
|
|
126
95
|
:rtype: str or None
|
|
127
96
|
"""
|
|
128
97
|
|
|
129
|
-
code_fileName = Parser.readMappingFile(filePath
|
|
98
|
+
code_fileName = Parser.readMappingFile(filePath)
|
|
130
99
|
if acName in code_fileName:
|
|
131
100
|
fileName = code_fileName[acName]
|
|
132
101
|
return fileName
|
|
@@ -134,7 +103,7 @@ class Parser:
|
|
|
134
103
|
return None
|
|
135
104
|
|
|
136
105
|
@staticmethod
|
|
137
|
-
def parseXML(filePath,
|
|
106
|
+
def parseXML(filePath, acName):
|
|
138
107
|
"""
|
|
139
108
|
Parses the BADA4 XML file for a specific aircraft model and extracts various parameters.
|
|
140
109
|
|
|
@@ -142,10 +111,8 @@ class Parser:
|
|
|
142
111
|
general information about the aircraft, engine type, aerodynamic configurations, performance parameters, and more.
|
|
143
112
|
|
|
144
113
|
:param filePath: The path to the folder containing the BADA4 XML file.
|
|
145
|
-
:param badaVersion: The version of BADA (e.g., "4.3") being used.
|
|
146
114
|
:param acName: The aircraft code name for which the XML file is being parsed.
|
|
147
115
|
:type filePath: str
|
|
148
|
-
:type badaVersion: str
|
|
149
116
|
:type acName: str
|
|
150
117
|
:raises IOError: If the XML file cannot be found or parsed.
|
|
151
118
|
|
|
@@ -153,10 +120,7 @@ class Parser:
|
|
|
153
120
|
:rtype: pd.DataFrame
|
|
154
121
|
"""
|
|
155
122
|
|
|
156
|
-
acXmlFile = (
|
|
157
|
-
os.path.join(filePath, "BADA4", badaVersion, acName, acName)
|
|
158
|
-
+ ".xml"
|
|
159
|
-
)
|
|
123
|
+
acXmlFile = os.path.join(filePath, acName, acName) + ".xml"
|
|
160
124
|
|
|
161
125
|
try:
|
|
162
126
|
tree = ET.parse(acXmlFile)
|
|
@@ -572,7 +536,7 @@ class Parser:
|
|
|
572
536
|
return df_single
|
|
573
537
|
|
|
574
538
|
@staticmethod
|
|
575
|
-
def parseGPF(filePath
|
|
539
|
+
def parseGPF(filePath):
|
|
576
540
|
"""
|
|
577
541
|
Parses the BADA4 GPF XML file and extracts key performance factors.
|
|
578
542
|
|
|
@@ -580,16 +544,14 @@ class Parser:
|
|
|
580
544
|
climb/descent speeds, maximum altitude limits for different phases of flight, and speed schedules for climb and descent.
|
|
581
545
|
|
|
582
546
|
:param filePath: The path to the directory containing the BADA4 GPF XML file.
|
|
583
|
-
:param badaVersion: The version of BADA (e.g., "4.3") for which the GPF file is to be parsed.
|
|
584
547
|
:type filePath: str
|
|
585
|
-
:type badaVersion: str
|
|
586
548
|
:raises IOError: If the GPF XML file cannot be found or parsed.
|
|
587
549
|
|
|
588
550
|
:return: A pandas DataFrame containing the parsed GPF data.
|
|
589
551
|
:rtype: pd.DataFrame
|
|
590
552
|
"""
|
|
591
553
|
|
|
592
|
-
filename = os.path.join(filePath, "
|
|
554
|
+
filename = os.path.join(filePath, "GPF.xml")
|
|
593
555
|
|
|
594
556
|
tree = ET.parse(filename)
|
|
595
557
|
|
|
@@ -685,20 +647,20 @@ class Parser:
|
|
|
685
647
|
"""
|
|
686
648
|
|
|
687
649
|
if filePath == None:
|
|
688
|
-
filePath = configuration.
|
|
650
|
+
filePath = configuration.getBadaVersionPath(
|
|
651
|
+
badaFamily="BADA4", badaVersion=badaVersion
|
|
652
|
+
)
|
|
689
653
|
else:
|
|
690
654
|
filePath = filePath
|
|
691
655
|
|
|
692
656
|
# parsing GPF file
|
|
693
|
-
GPFparsedDataframe = Parser.parseGPF(filePath
|
|
657
|
+
GPFparsedDataframe = Parser.parseGPF(filePath)
|
|
694
658
|
|
|
695
659
|
# retrieving mapping data
|
|
696
|
-
code_fileName = Parser.readMappingFile(filePath
|
|
660
|
+
code_fileName = Parser.readMappingFile(filePath)
|
|
697
661
|
|
|
698
662
|
# get names of all the folders in the main BADA model folder to search for XML files
|
|
699
|
-
subfolders =
|
|
700
|
-
os.path.join(filePath, "BADA4", badaVersion)
|
|
701
|
-
)
|
|
663
|
+
subfolders = configuration.list_subfolders(filePath)
|
|
702
664
|
|
|
703
665
|
# Initialize an empty list to collect DataFrames
|
|
704
666
|
mapping_dfs = []
|
|
@@ -709,7 +671,7 @@ class Parser:
|
|
|
709
671
|
|
|
710
672
|
if file in subfolders:
|
|
711
673
|
# Parse the original XML of a model
|
|
712
|
-
df = Parser.parseXML(filePath,
|
|
674
|
+
df = Parser.parseXML(filePath, file)
|
|
713
675
|
|
|
714
676
|
# Rename 'acName' in the DataFrame to match the code model name
|
|
715
677
|
df.at[0, "acName"] = code
|
|
@@ -735,7 +697,7 @@ class Parser:
|
|
|
735
697
|
|
|
736
698
|
for file in subfolders:
|
|
737
699
|
# Parse the original XML of a model
|
|
738
|
-
df = Parser.parseXML(filePath,
|
|
700
|
+
df = Parser.parseXML(filePath, file)
|
|
739
701
|
|
|
740
702
|
# Combine data with GPF data (temporary solution)
|
|
741
703
|
combined_df = pd.concat(
|
|
@@ -766,72 +728,8 @@ class Parser:
|
|
|
766
728
|
|
|
767
729
|
return merged_final_df
|
|
768
730
|
|
|
769
|
-
@staticmethod
|
|
770
|
-
def getBADAParameters(df, acName, parameters):
|
|
771
|
-
"""
|
|
772
|
-
Retrieves specified parameters for a given aircraft name from a DataFrame.
|
|
773
|
-
|
|
774
|
-
:param df: DataFrame containing BADA aircraft data.
|
|
775
|
-
:param acName: Name of the aircraft or list of aircraft names to search for.
|
|
776
|
-
:param parameters: List of column names (or a single column name) to retrieve.
|
|
777
|
-
:type df: pd.DataFrame
|
|
778
|
-
:type acName: list or str
|
|
779
|
-
:type parameters: list or str
|
|
780
|
-
:returns: A DataFrame containing the specified parameters for the given aircraft.
|
|
781
|
-
:rtype: pd.DataFrame
|
|
782
|
-
:raises ValueError: If any of the specified columns or aircraft names are not found.
|
|
783
|
-
"""
|
|
784
|
-
|
|
785
|
-
# Ensure parameters is a list
|
|
786
|
-
if isinstance(parameters, str):
|
|
787
|
-
parameters = [parameters]
|
|
788
|
-
|
|
789
|
-
# Ensure acName is a list
|
|
790
|
-
if isinstance(acName, str):
|
|
791
|
-
acName = [acName]
|
|
792
|
-
|
|
793
|
-
# Ensure all requested parameters exist in the DataFrame
|
|
794
|
-
missing_cols = [col for col in parameters if col not in df.columns]
|
|
795
|
-
if missing_cols:
|
|
796
|
-
raise ValueError(
|
|
797
|
-
f"The following parameters are not in the DataFrame columns: {missing_cols}"
|
|
798
|
-
)
|
|
799
|
-
|
|
800
|
-
# Filter rows where 'acName' matches any of the specified aircraft names
|
|
801
|
-
filtered_df = df[df["acName"].isin(acName)]
|
|
802
|
-
|
|
803
|
-
# Check if any rows were found
|
|
804
|
-
if filtered_df.empty:
|
|
805
|
-
raise ValueError(f"No entries found for aircraft(s): {acName}.")
|
|
806
|
-
else:
|
|
807
|
-
# Select the required columns
|
|
808
|
-
result_df = filtered_df[["acName"] + parameters].reset_index(
|
|
809
|
-
drop=True
|
|
810
|
-
)
|
|
811
|
-
return result_df
|
|
812
|
-
|
|
813
|
-
@staticmethod
|
|
814
|
-
def safe_get(df, column_name, default_value=None):
|
|
815
|
-
"""
|
|
816
|
-
Safely retrieves a column's value from a DataFrame, returning a default value if the column does not exist.
|
|
817
|
-
|
|
818
|
-
:param df: DataFrame to retrieve the value from.
|
|
819
|
-
:param column_name: Name of the column to retrieve.
|
|
820
|
-
:param default_value: Value to return if the column does not exist. Default is None.
|
|
821
|
-
:type df: pd.DataFrame
|
|
822
|
-
:type column_name: str
|
|
823
|
-
:type default_value: any
|
|
824
|
-
:returns: The value from the specified column or the default value if the column is missing.
|
|
825
|
-
:rtype: any
|
|
826
|
-
"""
|
|
827
|
-
|
|
828
|
-
if column_name in df.columns:
|
|
829
|
-
return df[column_name].iloc[0]
|
|
830
|
-
else:
|
|
831
|
-
return default_value
|
|
832
731
|
|
|
833
|
-
|
|
834
|
-
class BADA4(Airplane):
|
|
732
|
+
class BADA4(Airplane, Bada):
|
|
835
733
|
"""This class implements the part of BADA4 performance model that will be used in other classes following the BADA4 manual.
|
|
836
734
|
|
|
837
735
|
:param AC: Aircraft object {BADA4}.
|
|
@@ -3903,8 +3801,6 @@ class Optimization(BADA4):
|
|
|
3903
3801
|
|
|
3904
3802
|
filename = os.path.join(
|
|
3905
3803
|
self.AC.filePath,
|
|
3906
|
-
"BADA4",
|
|
3907
|
-
self.AC.BADAVersion,
|
|
3908
3804
|
self.AC.acName,
|
|
3909
3805
|
optParam + ".OPT",
|
|
3910
3806
|
)
|
|
@@ -5799,7 +5695,9 @@ class Bada4Aircraft(BADA4):
|
|
|
5799
5695
|
self.acName = acName
|
|
5800
5696
|
|
|
5801
5697
|
if filePath == None:
|
|
5802
|
-
self.filePath = configuration.
|
|
5698
|
+
self.filePath = configuration.getBadaVersionPath(
|
|
5699
|
+
badaFamily="BADA4", badaVersion=badaVersion
|
|
5700
|
+
)
|
|
5803
5701
|
else:
|
|
5804
5702
|
self.filePath = filePath
|
|
5805
5703
|
|
|
@@ -5807,74 +5705,96 @@ class Bada4Aircraft(BADA4):
|
|
|
5807
5705
|
if allData is not None and acName in allData["acName"].values:
|
|
5808
5706
|
filtered_df = allData[allData["acName"] == acName]
|
|
5809
5707
|
|
|
5810
|
-
self.model =
|
|
5811
|
-
self.engineType =
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
self.
|
|
5815
|
-
self.
|
|
5816
|
-
self.
|
|
5817
|
-
self.
|
|
5818
|
-
self.
|
|
5819
|
-
self.
|
|
5820
|
-
self.
|
|
5821
|
-
self.
|
|
5822
|
-
self.
|
|
5823
|
-
self.
|
|
5824
|
-
self.
|
|
5825
|
-
self.
|
|
5826
|
-
self.
|
|
5827
|
-
self.
|
|
5828
|
-
self.
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
self.
|
|
5832
|
-
self.
|
|
5833
|
-
self.
|
|
5834
|
-
self.
|
|
5835
|
-
self.
|
|
5836
|
-
self.
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
self.
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
self.
|
|
5843
|
-
self.
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
self.
|
|
5847
|
-
self.
|
|
5848
|
-
self.
|
|
5849
|
-
self.
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
self.
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
self.
|
|
5856
|
-
self.
|
|
5857
|
-
self.
|
|
5858
|
-
self.
|
|
5859
|
-
self.
|
|
5860
|
-
self.
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
self.
|
|
5864
|
-
self.
|
|
5865
|
-
self.
|
|
5866
|
-
self.
|
|
5867
|
-
self.
|
|
5868
|
-
|
|
5708
|
+
self.model = configuration.safe_get(filtered_df, "model", None)
|
|
5709
|
+
self.engineType = configuration.safe_get(
|
|
5710
|
+
filtered_df, "engineType", None
|
|
5711
|
+
)
|
|
5712
|
+
self.engines = configuration.safe_get(filtered_df, "engines", None)
|
|
5713
|
+
self.WTC = configuration.safe_get(filtered_df, "WTC", None)
|
|
5714
|
+
self.ICAO = configuration.safe_get(filtered_df, "ICAO", None)
|
|
5715
|
+
self.MREF = configuration.safe_get(filtered_df, "MREF", None)
|
|
5716
|
+
self.WREF = configuration.safe_get(filtered_df, "WREF", None)
|
|
5717
|
+
self.LHV = configuration.safe_get(filtered_df, "LHV", None)
|
|
5718
|
+
self.n_eng = configuration.safe_get(filtered_df, "n_eng", None)
|
|
5719
|
+
self.rho = configuration.safe_get(filtered_df, "rho", None)
|
|
5720
|
+
self.TFA = configuration.safe_get(filtered_df, "TFA", None)
|
|
5721
|
+
self.p_delta = configuration.safe_get(filtered_df, "p_delta", None)
|
|
5722
|
+
self.p_theta = configuration.safe_get(filtered_df, "p_theta", None)
|
|
5723
|
+
self.kink = configuration.safe_get(filtered_df, "kink", None)
|
|
5724
|
+
self.b = configuration.safe_get(filtered_df, "b", None)
|
|
5725
|
+
self.c = configuration.safe_get(filtered_df, "c", None)
|
|
5726
|
+
self.max_power = configuration.safe_get(
|
|
5727
|
+
filtered_df, "max_power", None
|
|
5728
|
+
)
|
|
5729
|
+
self.p = configuration.safe_get(filtered_df, "p", None)
|
|
5730
|
+
self.a = configuration.safe_get(filtered_df, "a", None)
|
|
5731
|
+
self.f = configuration.safe_get(filtered_df, "f", None)
|
|
5732
|
+
self.ti = configuration.safe_get(filtered_df, "ti", None)
|
|
5733
|
+
self.fi = configuration.safe_get(filtered_df, "fi", None)
|
|
5734
|
+
self.throttle = configuration.safe_get(
|
|
5735
|
+
filtered_df, "throttle", None
|
|
5736
|
+
)
|
|
5737
|
+
self.prop_dia = configuration.safe_get(
|
|
5738
|
+
filtered_df, "prop_dia", None
|
|
5739
|
+
)
|
|
5740
|
+
self.max_eff = configuration.safe_get(filtered_df, "max_eff", None)
|
|
5741
|
+
self.Hd_turbo = configuration.safe_get(
|
|
5742
|
+
filtered_df, "Hd_turbo", None
|
|
5743
|
+
)
|
|
5744
|
+
self.CPSFC = configuration.safe_get(filtered_df, "CPSFC", None)
|
|
5745
|
+
self.P = configuration.safe_get(filtered_df, "P", None)
|
|
5746
|
+
self.S = configuration.safe_get(filtered_df, "S", None)
|
|
5747
|
+
self.HLPosition = configuration.safe_get(
|
|
5748
|
+
filtered_df, "HLPosition", None
|
|
5749
|
+
)
|
|
5750
|
+
self.configName = configuration.safe_get(
|
|
5751
|
+
filtered_df, "configName", None
|
|
5752
|
+
)
|
|
5753
|
+
self.VFE = configuration.safe_get(filtered_df, "VFE", None)
|
|
5754
|
+
self.d = configuration.safe_get(filtered_df, "d", None)
|
|
5755
|
+
self.CL_max = configuration.safe_get(filtered_df, "CL_max", None)
|
|
5756
|
+
self.bf = configuration.safe_get(filtered_df, "bf", None)
|
|
5757
|
+
self.HLids = configuration.safe_get(filtered_df, "HLids", None)
|
|
5758
|
+
self.CL_clean = configuration.safe_get(
|
|
5759
|
+
filtered_df, "CL_clean", None
|
|
5760
|
+
)
|
|
5761
|
+
self.M_max = configuration.safe_get(filtered_df, "M_max", None)
|
|
5762
|
+
self.scalar = configuration.safe_get(filtered_df, "scalar", None)
|
|
5763
|
+
self.Mmin = configuration.safe_get(filtered_df, "Mmin", None)
|
|
5764
|
+
self.Mmax = configuration.safe_get(filtered_df, "Mmax", None)
|
|
5765
|
+
self.CL_Mach0 = configuration.safe_get(
|
|
5766
|
+
filtered_df, "CL_Mach0", None
|
|
5767
|
+
)
|
|
5768
|
+
self.MTOW = configuration.safe_get(filtered_df, "MTOW", None)
|
|
5769
|
+
self.OEW = configuration.safe_get(filtered_df, "OEW", None)
|
|
5770
|
+
self.MFL = configuration.safe_get(filtered_df, "MFL", None)
|
|
5771
|
+
self.MTW = configuration.safe_get(filtered_df, "MTW", None)
|
|
5772
|
+
self.MZFW = configuration.safe_get(filtered_df, "MZFW", None)
|
|
5773
|
+
self.MPL = configuration.safe_get(filtered_df, "MPL", None)
|
|
5774
|
+
self.MLW = configuration.safe_get(filtered_df, "MLW", None)
|
|
5775
|
+
self.hmo = configuration.safe_get(filtered_df, "hmo", None)
|
|
5776
|
+
self.mfa = configuration.safe_get(filtered_df, "mfa", None)
|
|
5777
|
+
self.MMO = configuration.safe_get(filtered_df, "MMO", None)
|
|
5778
|
+
self.MLE = configuration.safe_get(filtered_df, "MLE", None)
|
|
5779
|
+
self.VLE = configuration.safe_get(filtered_df, "VLE", None)
|
|
5780
|
+
self.VMO = configuration.safe_get(filtered_df, "VMO", None)
|
|
5781
|
+
self.span = configuration.safe_get(filtered_df, "span", None)
|
|
5782
|
+
self.length = configuration.safe_get(filtered_df, "length", None)
|
|
5783
|
+
self.aeroConfig = configuration.safe_get(
|
|
5784
|
+
filtered_df, "aeroConfig", None
|
|
5785
|
+
)
|
|
5786
|
+
self.speedSchedule = configuration.safe_get(
|
|
5869
5787
|
filtered_df, "speedSchedule", None
|
|
5870
5788
|
)
|
|
5871
5789
|
|
|
5872
5790
|
# GPF data (temporary)
|
|
5873
|
-
self.CVminTO =
|
|
5874
|
-
self.CVmin =
|
|
5875
|
-
self.HmaxPhase =
|
|
5876
|
-
|
|
5877
|
-
|
|
5791
|
+
self.CVminTO = configuration.safe_get(filtered_df, "CVminTO", None)
|
|
5792
|
+
self.CVmin = configuration.safe_get(filtered_df, "CVmin", None)
|
|
5793
|
+
self.HmaxPhase = configuration.safe_get(
|
|
5794
|
+
filtered_df, "HmaxPhase", None
|
|
5795
|
+
)
|
|
5796
|
+
self.V_des = configuration.safe_get(filtered_df, "V_des", None)
|
|
5797
|
+
self.V_cl = configuration.safe_get(filtered_df, "V_cl", None)
|
|
5878
5798
|
|
|
5879
5799
|
self.flightEnvelope = FlightEnvelope(self)
|
|
5880
5800
|
self.ARPM = ARPM(self)
|
|
@@ -5890,8 +5810,6 @@ class Bada4Aircraft(BADA4):
|
|
|
5890
5810
|
# check if SYNONYM file exist - since for BADA4 this is not a standard procedure (yet)
|
|
5891
5811
|
synonymFile = os.path.join(
|
|
5892
5812
|
self.filePath,
|
|
5893
|
-
"BADA4",
|
|
5894
|
-
badaVersion,
|
|
5895
5813
|
"aircraft_model_default.xml",
|
|
5896
5814
|
)
|
|
5897
5815
|
|
|
@@ -5901,7 +5819,6 @@ class Bada4Aircraft(BADA4):
|
|
|
5901
5819
|
# if SYNONYM exist - look for synonym based on defined acName
|
|
5902
5820
|
self.SearchedACName = Parser.parseMappingFile(
|
|
5903
5821
|
filePath=self.filePath,
|
|
5904
|
-
badaVersion=badaVersion,
|
|
5905
5822
|
acName=acName,
|
|
5906
5823
|
)
|
|
5907
5824
|
|
|
@@ -5918,8 +5835,6 @@ class Bada4Aircraft(BADA4):
|
|
|
5918
5835
|
acXmlFile = (
|
|
5919
5836
|
os.path.join(
|
|
5920
5837
|
self.filePath,
|
|
5921
|
-
"BADA4",
|
|
5922
|
-
badaVersion,
|
|
5923
5838
|
self.SearchedACName,
|
|
5924
5839
|
self.SearchedACName,
|
|
5925
5840
|
)
|
|
@@ -5934,12 +5849,9 @@ class Bada4Aircraft(BADA4):
|
|
|
5934
5849
|
|
|
5935
5850
|
XMLDataFrame = Parser.parseXML(
|
|
5936
5851
|
filePath=self.filePath,
|
|
5937
|
-
badaVersion=badaVersion,
|
|
5938
5852
|
acName=self.SearchedACName,
|
|
5939
5853
|
)
|
|
5940
|
-
GPFDataframe = Parser.parseGPF(
|
|
5941
|
-
filePath=self.filePath, badaVersion=badaVersion
|
|
5942
|
-
)
|
|
5854
|
+
GPFDataframe = Parser.parseGPF(filePath=self.filePath)
|
|
5943
5855
|
|
|
5944
5856
|
combined_df = Parser.combineXML_GPF(
|
|
5945
5857
|
XMLDataFrame, GPFDataframe
|
|
@@ -5947,106 +5859,146 @@ class Bada4Aircraft(BADA4):
|
|
|
5947
5859
|
|
|
5948
5860
|
self.acName = self.SearchedACName
|
|
5949
5861
|
|
|
5950
|
-
self.model =
|
|
5951
|
-
|
|
5862
|
+
self.model = configuration.safe_get(
|
|
5863
|
+
combined_df, "model", None
|
|
5864
|
+
)
|
|
5865
|
+
self.engineType = configuration.safe_get(
|
|
5952
5866
|
combined_df, "engineType", None
|
|
5953
5867
|
)
|
|
5954
|
-
self.engines =
|
|
5868
|
+
self.engines = configuration.safe_get(
|
|
5955
5869
|
combined_df, "engines", None
|
|
5956
5870
|
)
|
|
5957
|
-
self.WTC =
|
|
5958
|
-
self.ICAO =
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
self.
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
self.
|
|
5965
|
-
|
|
5871
|
+
self.WTC = configuration.safe_get(combined_df, "WTC", None)
|
|
5872
|
+
self.ICAO = configuration.safe_get(
|
|
5873
|
+
combined_df, "ICAO", None
|
|
5874
|
+
)
|
|
5875
|
+
self.MREF = configuration.safe_get(
|
|
5876
|
+
combined_df, "MREF", None
|
|
5877
|
+
)
|
|
5878
|
+
self.WREF = configuration.safe_get(
|
|
5879
|
+
combined_df, "WREF", None
|
|
5880
|
+
)
|
|
5881
|
+
self.LHV = configuration.safe_get(combined_df, "LHV", None)
|
|
5882
|
+
self.n_eng = configuration.safe_get(
|
|
5883
|
+
combined_df, "n_eng", None
|
|
5884
|
+
)
|
|
5885
|
+
self.rho = configuration.safe_get(combined_df, "rho", None)
|
|
5886
|
+
self.TFA = configuration.safe_get(combined_df, "TFA", None)
|
|
5887
|
+
self.p_delta = configuration.safe_get(
|
|
5966
5888
|
combined_df, "p_delta", None
|
|
5967
5889
|
)
|
|
5968
|
-
self.p_theta =
|
|
5890
|
+
self.p_theta = configuration.safe_get(
|
|
5969
5891
|
combined_df, "p_theta", None
|
|
5970
5892
|
)
|
|
5971
|
-
self.kink =
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
self.
|
|
5893
|
+
self.kink = configuration.safe_get(
|
|
5894
|
+
combined_df, "kink", None
|
|
5895
|
+
)
|
|
5896
|
+
self.b = configuration.safe_get(combined_df, "b", None)
|
|
5897
|
+
self.c = configuration.safe_get(combined_df, "c", None)
|
|
5898
|
+
self.max_power = configuration.safe_get(
|
|
5975
5899
|
combined_df, "max_power", None
|
|
5976
5900
|
)
|
|
5977
|
-
self.p =
|
|
5978
|
-
self.a =
|
|
5979
|
-
self.f =
|
|
5980
|
-
self.ti =
|
|
5981
|
-
self.fi =
|
|
5982
|
-
self.throttle =
|
|
5901
|
+
self.p = configuration.safe_get(combined_df, "p", None)
|
|
5902
|
+
self.a = configuration.safe_get(combined_df, "a", None)
|
|
5903
|
+
self.f = configuration.safe_get(combined_df, "f", None)
|
|
5904
|
+
self.ti = configuration.safe_get(combined_df, "ti", None)
|
|
5905
|
+
self.fi = configuration.safe_get(combined_df, "fi", None)
|
|
5906
|
+
self.throttle = configuration.safe_get(
|
|
5983
5907
|
combined_df, "throttle", None
|
|
5984
5908
|
)
|
|
5985
|
-
self.prop_dia =
|
|
5909
|
+
self.prop_dia = configuration.safe_get(
|
|
5986
5910
|
combined_df, "prop_dia", None
|
|
5987
5911
|
)
|
|
5988
|
-
self.max_eff =
|
|
5912
|
+
self.max_eff = configuration.safe_get(
|
|
5989
5913
|
combined_df, "max_eff", None
|
|
5990
5914
|
)
|
|
5991
|
-
self.Hd_turbo =
|
|
5915
|
+
self.Hd_turbo = configuration.safe_get(
|
|
5992
5916
|
combined_df, "Hd_turbo", None
|
|
5993
5917
|
)
|
|
5994
|
-
self.CPSFC =
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
self.
|
|
5918
|
+
self.CPSFC = configuration.safe_get(
|
|
5919
|
+
combined_df, "CPSFC", None
|
|
5920
|
+
)
|
|
5921
|
+
self.P = configuration.safe_get(combined_df, "P", None)
|
|
5922
|
+
self.S = configuration.safe_get(combined_df, "S", None)
|
|
5923
|
+
self.HLPosition = configuration.safe_get(
|
|
5998
5924
|
combined_df, "HLPosition", None
|
|
5999
5925
|
)
|
|
6000
|
-
self.configName =
|
|
5926
|
+
self.configName = configuration.safe_get(
|
|
6001
5927
|
combined_df, "configName", None
|
|
6002
5928
|
)
|
|
6003
|
-
self.VFE =
|
|
6004
|
-
self.d =
|
|
6005
|
-
self.CL_max =
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
self.
|
|
5929
|
+
self.VFE = configuration.safe_get(combined_df, "VFE", None)
|
|
5930
|
+
self.d = configuration.safe_get(combined_df, "d", None)
|
|
5931
|
+
self.CL_max = configuration.safe_get(
|
|
5932
|
+
combined_df, "CL_max", None
|
|
5933
|
+
)
|
|
5934
|
+
self.bf = configuration.safe_get(combined_df, "bf", None)
|
|
5935
|
+
self.HLids = configuration.safe_get(
|
|
5936
|
+
combined_df, "HLids", None
|
|
5937
|
+
)
|
|
5938
|
+
self.CL_clean = configuration.safe_get(
|
|
6009
5939
|
combined_df, "CL_clean", None
|
|
6010
5940
|
)
|
|
6011
|
-
self.M_max =
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
self.
|
|
6015
|
-
|
|
5941
|
+
self.M_max = configuration.safe_get(
|
|
5942
|
+
combined_df, "M_max", None
|
|
5943
|
+
)
|
|
5944
|
+
self.scalar = configuration.safe_get(
|
|
5945
|
+
combined_df, "scalar", None
|
|
5946
|
+
)
|
|
5947
|
+
self.Mmin = configuration.safe_get(
|
|
5948
|
+
combined_df, "Mmin", None
|
|
5949
|
+
)
|
|
5950
|
+
self.Mmax = configuration.safe_get(
|
|
5951
|
+
combined_df, "Mmax", None
|
|
5952
|
+
)
|
|
5953
|
+
self.CL_Mach0 = configuration.safe_get(
|
|
6016
5954
|
combined_df, "CL_Mach0", None
|
|
6017
5955
|
)
|
|
6018
|
-
self.MTOW =
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
self.
|
|
6022
|
-
self.
|
|
6023
|
-
self.
|
|
6024
|
-
self.
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
self.
|
|
6028
|
-
self.
|
|
6029
|
-
self.
|
|
6030
|
-
self.
|
|
6031
|
-
self.
|
|
6032
|
-
self.
|
|
6033
|
-
self.
|
|
5956
|
+
self.MTOW = configuration.safe_get(
|
|
5957
|
+
combined_df, "MTOW", None
|
|
5958
|
+
)
|
|
5959
|
+
self.OEW = configuration.safe_get(combined_df, "OEW", None)
|
|
5960
|
+
self.MFL = configuration.safe_get(combined_df, "MFL", None)
|
|
5961
|
+
self.MTW = configuration.safe_get(combined_df, "MTW", None)
|
|
5962
|
+
self.MZFW = configuration.safe_get(
|
|
5963
|
+
combined_df, "MZFW", None
|
|
5964
|
+
)
|
|
5965
|
+
self.MPL = configuration.safe_get(combined_df, "MPL", None)
|
|
5966
|
+
self.MLW = configuration.safe_get(combined_df, "MLW", None)
|
|
5967
|
+
self.hmo = configuration.safe_get(combined_df, "hmo", None)
|
|
5968
|
+
self.mfa = configuration.safe_get(combined_df, "mfa", None)
|
|
5969
|
+
self.MMO = configuration.safe_get(combined_df, "MMO", None)
|
|
5970
|
+
self.MLE = configuration.safe_get(combined_df, "MLE", None)
|
|
5971
|
+
self.VLE = configuration.safe_get(combined_df, "VLE", None)
|
|
5972
|
+
self.VMO = configuration.safe_get(combined_df, "VMO", None)
|
|
5973
|
+
self.span = configuration.safe_get(
|
|
5974
|
+
combined_df, "span", None
|
|
5975
|
+
)
|
|
5976
|
+
self.length = configuration.safe_get(
|
|
5977
|
+
combined_df, "length", None
|
|
5978
|
+
)
|
|
5979
|
+
self.aeroConfig = configuration.safe_get(
|
|
6034
5980
|
combined_df, "aeroConfig", None
|
|
6035
5981
|
)
|
|
6036
|
-
self.speedSchedule =
|
|
5982
|
+
self.speedSchedule = configuration.safe_get(
|
|
6037
5983
|
combined_df, "speedSchedule", None
|
|
6038
5984
|
)
|
|
6039
5985
|
|
|
6040
5986
|
# GPF data (temporary)
|
|
6041
|
-
self.CVminTO =
|
|
5987
|
+
self.CVminTO = configuration.safe_get(
|
|
6042
5988
|
combined_df, "CVminTO", None
|
|
6043
5989
|
)
|
|
6044
|
-
self.CVmin =
|
|
6045
|
-
|
|
5990
|
+
self.CVmin = configuration.safe_get(
|
|
5991
|
+
combined_df, "CVmin", None
|
|
5992
|
+
)
|
|
5993
|
+
self.HmaxPhase = configuration.safe_get(
|
|
6046
5994
|
combined_df, "HmaxPhase", None
|
|
6047
5995
|
)
|
|
6048
|
-
self.V_des =
|
|
6049
|
-
|
|
5996
|
+
self.V_des = configuration.safe_get(
|
|
5997
|
+
combined_df, "V_des", None
|
|
5998
|
+
)
|
|
5999
|
+
self.V_cl = configuration.safe_get(
|
|
6000
|
+
combined_df, "V_cl", None
|
|
6001
|
+
)
|
|
6050
6002
|
|
|
6051
6003
|
# BADA4.__init__(self, AC_parsed)
|
|
6052
6004
|
self.flightEnvelope = FlightEnvelope(self)
|