pyBADA 0.1.2__py3-none-any.whl → 0.1.4__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/bada3.py CHANGED
@@ -1,10 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- pyBADA
4
- Generic BADA3 aircraft performance module
5
- Developped @EUROCONTROL (EIH)
6
- 2024
7
- """
1
+ """Generic BADA3 aircraft performance module."""
8
2
 
9
3
  from math import sqrt, isnan, asin, atan
10
4
  import numpy as np
@@ -35,25 +29,27 @@ def checkArgument(argument, **kwargs):
35
29
  raise TypeError("Missing " + argument + " argument")
36
30
 
37
31
 
38
- class Parser(object):
39
- """This class implements the BADA3 parsing mechanism to parse APF, OPF and GPF BADA3 files."""
32
+ class Parser:
33
+ """This class implements the BADA3 parsing mechanism to parse APF, OPF and
34
+ GPF BADA3 files."""
40
35
 
41
36
  def __init__(self):
42
37
  pass
43
38
 
44
39
  @staticmethod
45
40
  def parseXML(filePath, acName):
46
- """
47
- Parses a BADA3 XML formatted file for aircraft performance data.
41
+ """Parses a BADA3 XML formatted file for aircraft performance data.
48
42
 
49
43
  :param filePath: Path to the XML file containing BADA data.
50
- :param acName: Name of the aircraft for which data is being parsed from the XML file.
44
+ :param acName: Name of the aircraft for which data is being parsed
45
+ from the XML file.
51
46
  :type filePath: str
52
47
  :type acName: str
53
48
  :raises IOError: If the file cannot be found or read.
54
- :raises ValueError: If the BADA version is unsupported or if parsing fails.
55
-
56
- :returns: A pandas DataFrame containing the parsed aircraft performance data.
49
+ :raises ValueError: If the BADA version is unsupported or if parsing
50
+ fails.
51
+ :returns: A pandas DataFrame containing the parsed aircraft
52
+ performance data.
57
53
  :rtype: pd.DataFrame
58
54
  """
59
55
 
@@ -62,7 +58,7 @@ class Parser(object):
62
58
  try:
63
59
  tree = ET.parse(filename)
64
60
  root = tree.getroot()
65
- except:
61
+ except Exception:
66
62
  raise IOError(filename + " not found or in correct format")
67
63
 
68
64
  modificationDateOPF = "UNKNOWN"
@@ -139,7 +135,6 @@ class Parser(object):
139
135
  if (
140
136
  LGDN is not None
141
137
  ): # Landing gear NOT allowed in clean configuration
142
-
143
138
  d[HLid]["LGDN"] = []
144
139
  for i in LGDN.find("DPM").find("CD").findall("d"):
145
140
  d[HLid]["LGDN"].append(float(i.text))
@@ -293,7 +288,6 @@ class Parser(object):
293
288
  "Ct": [Ct],
294
289
  "CTdeslow": [CTdeslow],
295
290
  "CTdeshigh": [CTdeshigh],
296
- "CTdeshigh": [CTdeshigh],
297
291
  "CTdesapp": [CTdesapp],
298
292
  "CTdesld": [CTdesld],
299
293
  "HpDes": [HpDes],
@@ -309,7 +303,6 @@ class Parser(object):
309
303
  "Hmax": [Hmax],
310
304
  "tempGrad": [tempGrad],
311
305
  "massGrad": [massGrad],
312
- "mass": [mass],
313
306
  "MMO": [MMO],
314
307
  "VMO": [VMO],
315
308
  "MTOW": [MTOW],
@@ -319,14 +312,11 @@ class Parser(object):
319
312
  "LDL": [LDL],
320
313
  "span": [span],
321
314
  "length": [length],
322
- "span": [span],
323
- "length": [length],
324
315
  "aeroConfig": [aeroConfig],
325
316
  "speedSchedule": [speedSchedule],
326
317
  "V1": [V1],
327
318
  "V2": [V2],
328
319
  "M": [M],
329
- "speedSchedule": [speedSchedule],
330
320
  "xmlFiles": [xmlFiles],
331
321
  }
332
322
  df_single = pd.DataFrame(data)
@@ -335,17 +325,17 @@ class Parser(object):
335
325
 
336
326
  @staticmethod
337
327
  def findData(f):
338
- """
339
- Searches for specific data lines in an open file stream.
328
+ """Searches for specific data lines in an open file stream.
340
329
 
341
330
  :param f: An open file object from which lines are read.
342
331
  :type f: file object
343
- :returns: A tuple containing the file object and a parsed line split into a list, or None if no relevant line is found.
344
- :rtype: tuple(file object, list of str or None)
345
-
346
- This function reads the file line by line until it finds a line that starts with "CD".
347
- Once found, the line is stripped of extra spaces, split into a list, and returned.
348
- If no such line is found, it returns None for the line.
332
+ :returns: A tuple containing the file object and a parsed line split
333
+ into a list, or None if no relevant line is found.
334
+ :rtype: tuple(file object, list of str or None) This function reads
335
+ the file line by line until it finds a line that starts with "CD".
336
+ Once found, the line is stripped of extra spaces, split into a
337
+ list, and returned. If no such line is found, it returns None for
338
+ the line.
349
339
  """
350
340
 
351
341
  line = f.readline()
@@ -361,15 +351,16 @@ class Parser(object):
361
351
 
362
352
  @staticmethod
363
353
  def parseOPF(filePath, acName):
364
- """
365
- Parses a BADA3 OPF (Operational Performance File) ASCII formatted file for aircraft performance data.
354
+ """Parses a BADA3 OPF (Operational Performance File) ASCII formatted
355
+ file for aircraft performance data.
366
356
 
367
357
  :param filePath: Path to the BADA3 OPF ASCII formatted file.
368
358
  :param acName: ICAO aircraft designation (e.g., 'A320').
369
359
  :type filePath: str
370
360
  :type acName: str
371
361
  :raises IOError: If the file cannot be opened or read.
372
- :returns: A pandas DataFrame containing the parsed aircraft performance data.
362
+ :returns: A pandas DataFrame containing the parsed aircraft
363
+ performance data.
373
364
  :rtype: pd.DataFrame
374
365
  """
375
366
 
@@ -545,7 +536,6 @@ class Parser(object):
545
536
  "ICAO": [ICAO],
546
537
  "WTC": [WTC],
547
538
  "modificationDateOPF": [modificationDateOPF],
548
- "modificationDateOPF": [modificationDateOPF],
549
539
  "S": [S],
550
540
  "MREF": [MREF],
551
541
  "mass": [mass],
@@ -560,7 +550,6 @@ class Parser(object):
560
550
  "Ct": [Ct],
561
551
  "CTdeslow": [CTdeslow],
562
552
  "CTdeshigh": [CTdeshigh],
563
- "CTdeshigh": [CTdeshigh],
564
553
  "CTdesapp": [CTdesapp],
565
554
  "CTdesld": [CTdesld],
566
555
  "HpDes": [HpDes],
@@ -570,7 +559,6 @@ class Parser(object):
570
559
  "hmo": [hmo],
571
560
  "Hmax": [Hmax],
572
561
  "tempGrad": [tempGrad],
573
- "mass": [mass],
574
562
  "MMO": [MMO],
575
563
  "VMO": [VMO],
576
564
  "massGrad": [massGrad],
@@ -581,8 +569,6 @@ class Parser(object):
581
569
  "LDL": [LDL],
582
570
  "span": [span],
583
571
  "length": [length],
584
- "span": [span],
585
- "length": [length],
586
572
  }
587
573
  df_single = pd.DataFrame(data)
588
574
 
@@ -590,15 +576,16 @@ class Parser(object):
590
576
 
591
577
  @staticmethod
592
578
  def parseAPF(filePath, acName):
593
- """
594
- Parses a BADA3 APF ASCII formatted file for aircraft performance data.
579
+ """Parses a BADA3 APF ASCII formatted file for aircraft performance
580
+ data.
595
581
 
596
582
  :param filePath: Path to the BADA3 APF ASCII formatted file.
597
583
  :param acName: ICAO aircraft designation (e.g., 'A320').
598
584
  :type filePath: str
599
585
  :type acName: str
600
586
  :raises IOError: If the file cannot be opened or read.
601
- :returns: A pandas DataFrame containing the parsed aircraft performance data.
587
+ :returns: A pandas DataFrame containing the parsed aircraft
588
+ performance data.
602
589
  :rtype: pd.DataFrame
603
590
  """
604
591
 
@@ -665,11 +652,12 @@ class Parser(object):
665
652
 
666
653
  @staticmethod
667
654
  def combineOPF_APF(OPFDataFrame, APFDataFrame):
668
- """
669
- Combines data from OPF and APF DataFrames.
655
+ """Combines data from OPF and APF DataFrames.
670
656
 
671
- :param OPFDataFrame: DataFrame containing parsed data from the OPF file.
672
- :param APFDataFrame: DataFrame containing parsed data from the APF file.
657
+ :param OPFDataFrame: DataFrame containing parsed data from the OPF
658
+ file.
659
+ :param APFDataFrame: DataFrame containing parsed data from the APF
660
+ file.
673
661
  :type OPFDataFrame: pd.DataFrame
674
662
  :type APFDataFrame: pd.DataFrame
675
663
  :returns: A single DataFrame combining both OPF and APF data.
@@ -689,12 +677,13 @@ class Parser(object):
689
677
 
690
678
  @staticmethod
691
679
  def readSynonym(filePath):
692
- """
693
- Reads a BADA3 SYNONYM.NEW ASCII file and returns a dictionary of model-synonym pairs.
680
+ """Reads a BADA3 SYNONYM.NEW ASCII file and returns a dictionary of
681
+ model-synonym pairs.
694
682
 
695
683
  :param filePath: Path to the directory containing BADA3 files.
696
684
  :type filePath: str
697
- :returns: A dictionary where the keys are aircraft models and the values are the corresponding file names.
685
+ :returns: A dictionary where the keys are aircraft models and the
686
+ values are the corresponding file names.
698
687
  :rtype: dict
699
688
  """
700
689
 
@@ -724,17 +713,18 @@ class Parser(object):
724
713
 
725
714
  @staticmethod
726
715
  def readSynonymXML(filePath):
727
- """
728
- Reads a BADA3 SYNONYM.xml file and returns a dictionary of model-synonym pairs.
716
+ """Reads a BADA3 SYNONYM.xml file and returns a dictionary of model-
717
+ synonym pairs.
729
718
 
730
719
  :param filePath: Path to the directory containing BADA3 files.
731
720
  :type filePath: str
732
- :returns: A dictionary where the keys are aircraft models (codes) and the values are the corresponding file names.
721
+ :returns: A dictionary where the keys are aircraft models (codes) and
722
+ the values are the corresponding file names.
733
723
  :rtype: dict
734
- :raises IOError: If the XML file is not found or cannot be read.
735
-
736
- This function parses the 'SYNONYM.xml' file to extract aircraft model codes and their associated file names.
737
- If the XML file is not found or is improperly formatted, an IOError is raised.
724
+ :raises IOError: If the XML file is not found or cannot be read. This
725
+ function parses the 'SYNONYM.xml' file to extract aircraft model
726
+ codes and their associated file names. If the XML file is not
727
+ found or is improperly formatted, an IOError is raised.
738
728
  """
739
729
 
740
730
  filename = os.path.join(filePath, "SYNONYM.xml")
@@ -746,7 +736,7 @@ class Parser(object):
746
736
  try:
747
737
  tree = ET.parse(filename)
748
738
  root = tree.getroot()
749
- except:
739
+ except Exception:
750
740
  raise IOError(filename + " not found or in correct format")
751
741
 
752
742
  for child in root.iter("SYN"):
@@ -761,19 +751,21 @@ class Parser(object):
761
751
 
762
752
  @staticmethod
763
753
  def parseSynonym(filePath, acName):
764
- """
765
- Parses either the ASCII or XML synonym file and returns the file name corresponding to the aircraft.
754
+ """Parses either the ASCII or XML synonym file and returns the file
755
+ name corresponding to the aircraft.
766
756
 
767
757
  :param filePath: Path to the directory containing BADA3 files.
768
- :param acName: ICAO aircraft designation for which the file name is needed.
758
+ :param acName: ICAO aircraft designation for which the file name is
759
+ needed.
769
760
  :type filePath: str
770
761
  :type acName: str
771
- :returns: The file name corresponding to the aircraft, or None if not found.
772
- :rtype: str or None
773
-
774
- This function first attempts to read the aircraft synonym from the ASCII file ('SYNONYM.NEW').
775
- If the synonym is not found, it then tries to read the XML version ('SYNONYM.xml').
776
- It returns the associated file name or None if the aircraft synonym is not found.
762
+ :returns: The file name corresponding to the aircraft, or None if not
763
+ found.
764
+ :rtype: str or None This function first attempts to read the aircraft
765
+ synonym from the ASCII file ('SYNONYM.NEW'). If the synonym is not
766
+ found, it then tries to read the XML version ('SYNONYM.xml'). It
767
+ returns the associated file name or None if the aircraft synonym
768
+ is not found.
777
769
  """
778
770
 
779
771
  synonym_fileName = Parser.readSynonym(filePath)
@@ -790,13 +782,13 @@ class Parser(object):
790
782
 
791
783
  @staticmethod
792
784
  def readGPF(filePath):
793
- """
794
- Parses a BADA3 GPF ASCII formatted file.
785
+ """Parses a BADA3 GPF ASCII formatted file.
795
786
 
796
787
  :param filePath: Path to the directory containing BADA3 files.
797
788
  :type filePath: str
798
789
  :raises IOError: If the GPF file cannot be opened or read.
799
- :returns: A list of dictionaries, each containing GPF parameters like engine type, flight phase, and parameter values.
790
+ :returns: A list of dictionaries, each containing GPF parameters like
791
+ engine type, flight phase, and parameter values.
800
792
  :rtype: list of dict
801
793
  """
802
794
 
@@ -828,18 +820,18 @@ class Parser(object):
828
820
 
829
821
  @staticmethod
830
822
  def readGPFXML(filePath):
831
- """
832
- Parses a BADA3 GPF XML formatted file.
823
+ """Parses a BADA3 GPF XML formatted file.
833
824
 
834
825
  :param filePath: Path to the directory containing BADA3 files.
835
826
  :type filePath: str
836
827
  :raises IOError: If the XML file is not found or cannot be read.
837
- :returns: A list of dictionaries, each containing GPF parameters such as engine type, flight phase, and performance values.
838
- :rtype: list of dict
839
-
840
- This function reads the 'GPF.xml' file and extracts general performance parameters for the aircraft,
841
- including maximum acceleration, bank angles, thrust coefficients, speed limits, and more.
842
- It parses the XML structure and returns a list of dictionaries representing these parameters.
828
+ :returns: A list of dictionaries, each containing GPF parameters such
829
+ as engine type, flight phase, and performance values.
830
+ :rtype: list of dict This function reads the 'GPF.xml' file and
831
+ extracts general performance parameters for the aircraft,
832
+ including maximum acceleration, bank angles, thrust coefficients,
833
+ speed limits, and more. It parses the XML structure and returns a
834
+ list of dictionaries representing these parameters.
843
835
  """
844
836
 
845
837
  filename = os.path.join(filePath, "GPF.xml")
@@ -850,7 +842,7 @@ class Parser(object):
850
842
  try:
851
843
  tree = ET.parse(filename)
852
844
  root = tree.getroot()
853
- except:
845
+ except Exception:
854
846
  raise IOError(filename + " not found or in correct format")
855
847
 
856
848
  allEngines = ["JET", "TURBOPROP", "PISTON", "ELECTRIC"]
@@ -1001,7 +993,6 @@ class Parser(object):
1001
993
 
1002
994
  HmaxList = {}
1003
995
  for phase in root.find("HmaxList").findall("HmaxPhase"):
1004
-
1005
996
  HmaxList[phase.find("Phase").text] = float(
1006
997
  phase.find("Hmax").text
1007
998
  )
@@ -1052,7 +1043,6 @@ class Parser(object):
1052
1043
 
1053
1044
  VdList = {}
1054
1045
  for vdphase in root.find("VdList").findall("VdPhase"):
1055
-
1056
1046
  Phase = vdphase.find("Phase")
1057
1047
  name = Phase.find("name").text
1058
1048
  index = int(Phase.find("index").text)
@@ -1234,7 +1224,6 @@ class Parser(object):
1234
1224
 
1235
1225
  VList = {}
1236
1226
  for vphase in root.find("VList").findall("VPhase"):
1237
-
1238
1227
  Phase = vphase.find("Phase")
1239
1228
  name = Phase.find("name").text
1240
1229
  index = int(Phase.find("index").text)
@@ -1384,8 +1373,7 @@ class Parser(object):
1384
1373
 
1385
1374
  @staticmethod
1386
1375
  def parseGPF(filePath):
1387
- """
1388
- Parses a BADA3 (GPF) from either ASCII or XML format.
1376
+ """Parses a BADA3 (GPF) from either ASCII or XML format.
1389
1377
 
1390
1378
  :param filePath: Path to the directory containing BADA3 files.
1391
1379
  :type filePath: str
@@ -1407,20 +1395,24 @@ class Parser(object):
1407
1395
 
1408
1396
  @staticmethod
1409
1397
  def getGPFValue(GPFdata, name, engine="JET", phase="cr", flight="civ"):
1410
- """
1411
- Retrieves the value of a specified GPF parameter based on engine type, flight phase, and flight type.
1398
+ """Retrieves the value of a specified GPF parameter based on engine
1399
+ type, flight phase, and flight type.
1412
1400
 
1413
1401
  :param GPFdata: List of dictionaries containing GPF parameters.
1414
1402
  :param name: Name of the GPF parameter to retrieve.
1415
- :param engine: Engine type to filter by (e.g., 'JET', 'TURBOPROP', 'PISTON', 'ELECTRIC'). Default is 'JET'.
1416
- :param phase: Flight phase to filter by (e.g., 'cr', 'cl', 'des'). Default is 'cr'.
1417
- :param flight: Flight type to filter by ('civ' or 'mil'). Default is 'civ'.
1403
+ :param engine: Engine type to filter by (e.g., 'JET', 'TURBOPROP',
1404
+ 'PISTON', 'ELECTRIC'). Default is 'JET'.
1405
+ :param phase: Flight phase to filter by (e.g., 'cr', 'cl', 'des').
1406
+ Default is 'cr'.
1407
+ :param flight: Flight type to filter by ('civ' or 'mil'). Default is
1408
+ 'civ'.
1418
1409
  :type GPFdata: list
1419
1410
  :type name: str
1420
1411
  :type engine: str
1421
1412
  :type phase: str
1422
1413
  :type flight: str
1423
- :returns: The value of the specified GPF parameter or None if not found.
1414
+ :returns: The value of the specified GPF parameter or None if not
1415
+ found.
1424
1416
  :rtype: float or None
1425
1417
  """
1426
1418
 
@@ -1470,19 +1462,21 @@ class Parser(object):
1470
1462
 
1471
1463
  @staticmethod
1472
1464
  def parseAll(badaVersion, filePath=None):
1473
- """
1474
- Parses all BADA3 formatted files and combines them into a final DataFrame.
1465
+ """Parses all BADA3 formatted files and combines them into a final
1466
+ DataFrame.
1475
1467
 
1476
1468
  :param badaVersion: BADA version being used.
1477
- :param filePath: Path to the BADA3 formatted files. If not provided, the default path is used.
1469
+ :param filePath: Path to the BADA3 formatted files. If not provided,
1470
+ the default path is used.
1478
1471
  :type badaVersion: str
1479
1472
  :type filePath: str, optional
1480
1473
  :returns: A pandas DataFrame containing all parsed BADA3 data.
1481
1474
  :rtype: pd.DataFrame
1482
- :raises IOError: If any of the required files cannot be opened or read.
1475
+ :raises IOError: If any of the required files cannot be opened or
1476
+ read.
1483
1477
  """
1484
1478
 
1485
- if filePath == None:
1479
+ if filePath is None:
1486
1480
  filePath = configuration.getBadaVersionPath(
1487
1481
  badaFamily="BADA3", badaVersion=badaVersion
1488
1482
  )
@@ -1556,7 +1550,8 @@ class Parser(object):
1556
1550
 
1557
1551
 
1558
1552
  class BADA3(Airplane, Bada):
1559
- """This class implements the part of BADA3 performance model that will be used in other classes following the BADA3 manual.
1553
+ """This class implements the part of BADA3 performance model that will be
1554
+ used in other classes following the BADA3 manual.
1560
1555
 
1561
1556
  :param AC: Aircraft object {BADA3}.
1562
1557
  :type AC: bada3Aircraft.
@@ -1567,13 +1562,13 @@ class BADA3(Airplane, Bada):
1567
1562
  self.AC = AC
1568
1563
 
1569
1564
  def CL(self, sigma, mass, tas, nz=1.0):
1570
- """
1571
- Computes the lift coefficient for the aircraft.
1565
+ """Computes the lift coefficient for the aircraft.
1572
1566
 
1573
1567
  :param sigma: Normalized air density [-].
1574
1568
  :param mass: Aircraft mass in kilograms [kg].
1575
1569
  :param tas: True airspeed in meters per second [m/s].
1576
- :param nz: Load factor [-], default is 1.0 (straight and level flight).
1570
+ :param nz: Load factor [-], default is 1.0 (straight and level
1571
+ flight).
1577
1572
  :type sigma: float
1578
1573
  :type mass: float
1579
1574
  :type tas: float
@@ -1597,13 +1592,16 @@ class BADA3(Airplane, Bada):
1597
1592
  expedite=False,
1598
1593
  speedBrakes={"deployed": False, "value": 0.03},
1599
1594
  ):
1600
- """
1601
- Computes the drag coefficient based on the lift coefficient and aircraft configuration.
1595
+ """Computes the drag coefficient based on the lift coefficient and
1596
+ aircraft configuration.
1602
1597
 
1603
1598
  :param CL: Lift coefficient [-].
1604
- :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC', 'TO', 'AP', 'LD').
1605
- :param expedite: Flag indicating if expedite descent is used (default is False).
1606
- :param speedBrakes: Dictionary indicating if speed brakes are deployed and their effect.
1599
+ :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
1600
+ 'TO', 'AP', 'LD').
1601
+ :param expedite: Flag indicating if expedite descent is used (default
1602
+ is False).
1603
+ :param speedBrakes: Dictionary indicating if speed brakes are deployed
1604
+ and their effect.
1607
1605
  :type CL: float
1608
1606
  :type config: str
1609
1607
  :type expedite: bool
@@ -1628,7 +1626,6 @@ class BADA3(Airplane, Bada):
1628
1626
  and self.AC.CD2[HLid_LD][LG_LD] == 0.0
1629
1627
  and self.AC.DeltaCD == 0.0
1630
1628
  ):
1631
-
1632
1629
  CD = self.AC.CD0[HLid_CR][LG_CR] + self.AC.CD2[HLid_CR][
1633
1630
  LG_CR
1634
1631
  ] * (CL * CL)
@@ -1694,8 +1691,7 @@ class BADA3(Airplane, Bada):
1694
1691
  return CD
1695
1692
 
1696
1693
  def D(self, sigma, tas, CD):
1697
- """
1698
- Computes the aerodynamic drag force.
1694
+ """Computes the aerodynamic drag force.
1699
1695
 
1700
1696
  :param sigma: Normalized air density [-].
1701
1697
  :param tas: True airspeed in meters per second [m/s].
@@ -1710,8 +1706,7 @@ class BADA3(Airplane, Bada):
1710
1706
  return 0.5 * sigma * const.rho_0 * tas * tas * self.AC.S * CD
1711
1707
 
1712
1708
  def L(self, sigma, tas, CL):
1713
- """
1714
- Computes the aerodynamic lift force.
1709
+ """Computes the aerodynamic lift force.
1715
1710
 
1716
1711
  :param sigma: Normalized air density [-].
1717
1712
  :param tas: True airspeed in meters per second [m/s].
@@ -1726,14 +1721,16 @@ class BADA3(Airplane, Bada):
1726
1721
  return 0.5 * sigma * const.rho_0 * tas * tas * self.AC.S * CL
1727
1722
 
1728
1723
  def Thrust(self, h, DeltaTemp, rating, v, config, **kwargs):
1729
- """
1730
- Computes the aircraft thrust based on engine rating and flight conditions.
1724
+ """Computes the aircraft thrust based on engine rating and flight
1725
+ conditions.
1731
1726
 
1732
- :param rating: Engine rating ('MCMB', 'MCRZ', 'MTKF', 'LIDL', 'ADAPTED').
1727
+ :param rating: Engine rating ('MCMB', 'MCRZ', 'MTKF', 'LIDL',
1728
+ 'ADAPTED').
1733
1729
  :param h: Altitude in meters [m].
1734
1730
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
1735
1731
  :param v: True airspeed (TAS) in meters per second [m/s].
1736
- :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC', 'TO', 'AP', 'LD').
1732
+ :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
1733
+ 'TO', 'AP', 'LD').
1737
1734
  :type rating: str
1738
1735
  :type h: float
1739
1736
  :type DeltaTemp: float
@@ -1782,8 +1779,8 @@ class BADA3(Airplane, Bada):
1782
1779
  return T
1783
1780
 
1784
1781
  def TAdapted(self, h, DeltaTemp, ROCD, mass, v, acc, Drag):
1785
- """
1786
- Computes adapted thrust for non-standard flight conditions (e.g., climb, acceleration).
1782
+ """Computes adapted thrust for non-standard flight conditions (e.g.,
1783
+ climb, acceleration).
1787
1784
 
1788
1785
  :param h: Altitude in meters [m].
1789
1786
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
@@ -1810,8 +1807,8 @@ class BADA3(Airplane, Bada):
1810
1807
  return Tadapted
1811
1808
 
1812
1809
  def TMax(self, h, DeltaTemp, rating, v):
1813
- """
1814
- Computes the maximum thrust based on engine type, altitude, and temperature deviation.
1810
+ """Computes the maximum thrust based on engine type, altitude, and
1811
+ temperature deviation.
1815
1812
 
1816
1813
  :param h: Altitude in meters [m].
1817
1814
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
@@ -1872,13 +1869,14 @@ class BADA3(Airplane, Bada):
1872
1869
  )
1873
1870
 
1874
1871
  def TDes(self, h, DeltaTemp, v, config):
1875
- """
1876
- Computes descent thrust based on altitude, temperature deviation, and configuration.
1872
+ """Computes descent thrust based on altitude, temperature deviation,
1873
+ and configuration.
1877
1874
 
1878
1875
  :param h: Altitude in meters [m].
1879
1876
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
1880
1877
  :param v: True airspeed (TAS) in meters per second [m/s].
1881
- :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC', 'TO', 'AP', 'LD').
1878
+ :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'IC',
1879
+ 'TO', 'AP', 'LD').
1882
1880
  :type h: float
1883
1881
  :type DeltaTemp: float
1884
1882
  :type v: float
@@ -1915,7 +1913,6 @@ class BADA3(Airplane, Bada):
1915
1913
  and self.AC.CD2[HLid_LD][LG_LD] != 0.0
1916
1914
  and self.AC.DeltaCD != 0.0
1917
1915
  ):
1918
-
1919
1916
  if HpDes_ < H_max_app:
1920
1917
  HpDes_ = H_max_app
1921
1918
 
@@ -1945,8 +1942,7 @@ class BADA3(Airplane, Bada):
1945
1942
  return Tdes
1946
1943
 
1947
1944
  def ffnom(self, v, T):
1948
- """
1949
- Computes the nominal fuel flow based on airspeed and thrust.
1945
+ """Computes the nominal fuel flow based on airspeed and thrust.
1950
1946
 
1951
1947
  :param v: True airspeed (TAS) in meters per second [m/s].
1952
1948
  :param T: Thrust in Newtons [N].
@@ -1981,8 +1977,7 @@ class BADA3(Airplane, Bada):
1981
1977
  return ffnom
1982
1978
 
1983
1979
  def ffMin(self, h):
1984
- """
1985
- Computes the minimum fuel flow based on altitude.
1980
+ """Computes the minimum fuel flow based on altitude.
1986
1981
 
1987
1982
  :param h: Altitude in meters [m].
1988
1983
  :type h: float
@@ -2002,15 +1997,18 @@ class BADA3(Airplane, Bada):
2002
1997
  return ffmin
2003
1998
 
2004
1999
  def ff(self, h, v, T, config=None, flightPhase=None, adapted=False):
2005
- """
2006
- Computes the fuel flow based on flight phase and current flight conditions.
2000
+ """Computes the fuel flow based on flight phase and current flight
2001
+ conditions.
2007
2002
 
2008
2003
  :param h: Altitude in meters [m].
2009
2004
  :param v: True airspeed (TAS) in meters per second [m/s].
2010
2005
  :param T: Thrust in Newtons [N].
2011
- :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'AP', 'LD'). Optional.
2012
- :param flightPhase: Flight phase (e.g., 'Climb', 'Cruise', 'Descent'). Optional.
2013
- :param adapted: If True, computes fuel flow for adapted thrust. Default is False.
2006
+ :param config: Aircraft aerodynamic configuration (e.g., 'CR', 'AP',
2007
+ 'LD'). Optional.
2008
+ :param flightPhase: Flight phase (e.g., 'Climb', 'Cruise', 'Descent').
2009
+ Optional.
2010
+ :param adapted: If True, computes fuel flow for adapted thrust.
2011
+ Default is False.
2014
2012
  :type h: float
2015
2013
  :type v: float
2016
2014
  :type T: float
@@ -2049,8 +2047,8 @@ class BADA3(Airplane, Bada):
2049
2047
  return ff
2050
2048
 
2051
2049
  def reducedPower(self, h, mass, DeltaTemp):
2052
- """
2053
- Computes the reduced climb power coefficient based on altitude, mass, and temperature deviation.
2050
+ """Computes the reduced climb power coefficient based on altitude,
2051
+ mass, and temperature deviation.
2054
2052
 
2055
2053
  :param h: Altitude in meters [m].
2056
2054
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
@@ -2103,8 +2101,8 @@ class BADA3(Airplane, Bada):
2103
2101
  return CPowRed
2104
2102
 
2105
2103
  def ROCD(self, T, D, v, mass, ESF, h, DeltaTemp, reducedPower=False):
2106
- """
2107
- Computes the rate of climb or descent (ROCD) based on thrust, drag, airspeed, and other flight parameters.
2104
+ """Computes the rate of climb or descent (ROCD) based on thrust, drag,
2105
+ airspeed, and other flight parameters.
2108
2106
 
2109
2107
  :param T: Aircraft thrust in Newtons [N].
2110
2108
  :param D: Aircraft drag in Newtons [N].
@@ -2113,7 +2111,8 @@ class BADA3(Airplane, Bada):
2113
2111
  :param ESF: Energy share factor [-].
2114
2112
  :param h: Altitude in meters [m].
2115
2113
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
2116
- :param reducedPower: Whether to account for reduced power in the calculation. Default is False.
2114
+ :param reducedPower: Whether to account for reduced power in the
2115
+ calculation. Default is False.
2117
2116
  :type T: float
2118
2117
  :type D: float
2119
2118
  :type v: float
@@ -2146,8 +2145,8 @@ class BADA3(Airplane, Bada):
2146
2145
 
2147
2146
 
2148
2147
  class FlightEnvelope(BADA3):
2149
- """This class is a BADA3 aircraft subclass and implements the flight envelope caclulations
2150
- following the BADA3 manual.
2148
+ """This class is a BADA3 aircraft subclass and implements the flight
2149
+ envelope caclulations following the BADA3 manual.
2151
2150
 
2152
2151
  :param AC: Aircraft object {BADA3}.
2153
2152
  :type AC: bada3Aircraft.
@@ -2157,19 +2156,20 @@ class FlightEnvelope(BADA3):
2157
2156
  super().__init__(AC)
2158
2157
 
2159
2158
  def maxAltitude(self, mass, DeltaTemp):
2160
- """
2161
- Computes the maximum altitude for a given aircraft mass and deviation from ISA.
2159
+ """Computes the maximum altitude for a given aircraft mass and
2160
+ deviation from ISA.
2162
2161
 
2163
2162
  :param mass: Actual aircraft mass in kilograms [kg].
2164
- :param DeltaTemp: Deviation from International Standard Atmosphere (ISA) temperature in Kelvin [K].
2163
+ :param DeltaTemp: Deviation from International Standard Atmosphere
2164
+ (ISA) temperature in Kelvin [K].
2165
2165
  :type mass: float
2166
2166
  :type DeltaTemp: float
2167
2167
  :returns: Maximum altitude in meters [m].
2168
- :rtype: float
2169
-
2170
- This function calculates the maximum possible altitude based on the aircraft's mass,
2171
- ISA temperature deviation, and engine-specific parameters such as temperature and mass gradients.
2172
- It considers the maximum operational altitude and adjusts for the given conditions.
2168
+ :rtype: float This function calculates the maximum possible altitude
2169
+ based on the aircraft's mass, ISA temperature deviation, and
2170
+ engine-specific parameters such as temperature and mass gradients.
2171
+ It considers the maximum operational altitude and adjusts for the
2172
+ given conditions.
2173
2173
  """
2174
2174
 
2175
2175
  Gt = self.AC.tempGrad
@@ -2196,8 +2196,8 @@ class FlightEnvelope(BADA3):
2196
2196
  return conv.ft2m(hMax)
2197
2197
 
2198
2198
  def VStall(self, mass, config):
2199
- """
2200
- Computes the stall speed based on the aircraft configuration and mass.
2199
+ """Computes the stall speed based on the aircraft configuration and
2200
+ mass.
2201
2201
 
2202
2202
  :param config: Aircraft configuration (e.g., 'CR', 'TO', 'AP', 'LD').
2203
2203
  :param mass: Aircraft mass in kilograms [kg].
@@ -2222,15 +2222,16 @@ class FlightEnvelope(BADA3):
2222
2222
  def VMin(
2223
2223
  self, h, mass, config, DeltaTemp, nz=1.2, envelopeType="OPERATIONAL"
2224
2224
  ):
2225
- """
2226
- Computes the minimum speed for a given configuration and conditions.
2225
+ """Computes the minimum speed for a given configuration and
2226
+ conditions.
2227
2227
 
2228
2228
  :param h: Altitude in meters [m].
2229
2229
  :param mass: Aircraft mass in kilograms [kg].
2230
2230
  :param config: Aircraft configuration (e.g., 'CR', 'TO', 'LD').
2231
2231
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
2232
2232
  :param nz: Load factor, default is 1.2.
2233
- :param envelopeType: Type of flight envelope ('OPERATIONAL' or 'CERTIFIED').
2233
+ :param envelopeType: Type of flight envelope ('OPERATIONAL' or
2234
+ 'CERTIFIED').
2234
2235
  :type h: float
2235
2236
  :type mass: float
2236
2237
  :type config: str
@@ -2252,6 +2253,7 @@ class FlightEnvelope(BADA3):
2252
2253
  ) * self.VStall(mass=mass, config=config)
2253
2254
  elif envelopeType == "CERTIFIED":
2254
2255
  VminStall = self.VStall(mass=mass, config=config)
2256
+ return VminStall
2255
2257
 
2256
2258
  if self.AC.Clbo == 0.0 and self.AC.k == 0.0:
2257
2259
  Vmin = VminStall
@@ -2270,7 +2272,7 @@ class FlightEnvelope(BADA3):
2270
2272
  buffetLimit = self.lowSpeedBuffetLimit(
2271
2273
  h=h, mass=mass, DeltaTemp=DeltaTemp, nz=nz
2272
2274
  )
2273
- if buffetLimit == float("Nan"):
2275
+ if isnan(buffetLimit):
2274
2276
  Vmin = VminStall
2275
2277
  else:
2276
2278
  Vmin = max(
@@ -2291,8 +2293,8 @@ class FlightEnvelope(BADA3):
2291
2293
  return Vmin
2292
2294
 
2293
2295
  def Vmax_thrustLimited(self, h, mass, DeltaTemp, rating, config):
2294
- """
2295
- Computes the maximum CAS speed considering thrust limitations within the certified flight envelope.
2296
+ """Computes the maximum CAS speed considering thrust limitations
2297
+ within the certified flight envelope.
2296
2298
 
2297
2299
  :param h: Altitude in meters [m].
2298
2300
  :param mass: Aircraft mass in kilograms [kg].
@@ -2354,8 +2356,7 @@ class FlightEnvelope(BADA3):
2354
2356
  return max(maxCASList)
2355
2357
 
2356
2358
  def Vx(self, h, mass, DeltaTemp, rating, config):
2357
- """
2358
- Computes the best angle of climb (Vx) speed.
2359
+ """Computes the best angle of climb (Vx) speed.
2359
2360
 
2360
2361
  :param h: Altitude in meters [m].
2361
2362
  :param mass: Aircraft mass in kilograms [kg].
@@ -2407,8 +2408,8 @@ class FlightEnvelope(BADA3):
2407
2408
  return VxList[idx]
2408
2409
 
2409
2410
  def VMax(self, h, DeltaTemp):
2410
- """
2411
- Computes the maximum speed based on altitude and temperature deviation.
2411
+ """Computes the maximum speed based on altitude and temperature
2412
+ deviation.
2412
2413
 
2413
2414
  :param h: Altitude in meters [m].
2414
2415
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
@@ -2435,8 +2436,7 @@ class FlightEnvelope(BADA3):
2435
2436
  return VMax
2436
2437
 
2437
2438
  def lowSpeedBuffetLimit(self, h, mass, DeltaTemp, nz=1.2):
2438
- """
2439
- Computes the low-speed buffet limit using numerical methods.
2439
+ """Computes the low-speed buffet limit using numerical methods.
2440
2440
 
2441
2441
  :param h: Altitude in meters [m].
2442
2442
  :param mass: Aircraft mass in kilograms [kg].
@@ -2469,15 +2469,16 @@ class FlightEnvelope(BADA3):
2469
2469
  return min(Mb)
2470
2470
 
2471
2471
  def getConfig(self, phase, h, mass, v, DeltaTemp, hRWY=0.0, nz=1.2):
2472
- """
2473
- Returns the aerodynamic configuration based on altitude, speed, and phase of flight.
2472
+ """Returns the aerodynamic configuration based on altitude, speed, and
2473
+ phase of flight.
2474
2474
 
2475
2475
  :param phase: Phase of flight (e.g., 'Climb', 'Cruise', 'Descent').
2476
2476
  :param h: Altitude in meters [m].
2477
2477
  :param v: Calibrated airspeed in meters per second [m/s].
2478
2478
  :param mass: Aircraft mass in kilograms [kg].
2479
2479
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
2480
- :param hRWY: Runway elevation above mean sea level in meters [m], default is 0.
2480
+ :param hRWY: Runway elevation above mean sea level in meters [m],
2481
+ default is 0.
2481
2482
  :param nz: Load factor, default is 1.2.
2482
2483
  :type phase: str
2483
2484
  :type h: float
@@ -2486,7 +2487,8 @@ class FlightEnvelope(BADA3):
2486
2487
  :type DeltaTemp: float
2487
2488
  :type hRWY: float, optional
2488
2489
  :type nz: float, optional
2489
- :returns: Aerodynamic configuration (e.g., 'TO', 'IC', 'CR', 'AP', 'LD').
2490
+ :returns: Aerodynamic configuration (e.g., 'TO', 'IC', 'CR', 'AP',
2491
+ 'LD').
2490
2492
  :rtype: str
2491
2493
  """
2492
2494
 
@@ -2570,12 +2572,13 @@ class FlightEnvelope(BADA3):
2570
2572
  return config
2571
2573
 
2572
2574
  def getAeroConfig(self, config):
2573
- """
2574
- Returns the aerodynamic configuration ID for a given configuration.
2575
+ """Returns the aerodynamic configuration ID for a given configuration.
2575
2576
 
2576
- :param config: Aircraft configuration (e.g., 'CR', 'IC', 'TO', 'AP', 'LD').
2577
+ :param config: Aircraft configuration (e.g., 'CR', 'IC', 'TO', 'AP',
2578
+ 'LD').
2577
2579
  :type config: str
2578
- :returns: A list containing the HLid and LG for the given configuration.
2580
+ :returns: A list containing the HLid and LG for the given
2581
+ configuration.
2579
2582
  :rtype: [int, str]
2580
2583
  """
2581
2584
 
@@ -2585,8 +2588,8 @@ class FlightEnvelope(BADA3):
2585
2588
  return [HLid, LG]
2586
2589
 
2587
2590
  def getHoldSpeed(self, h, theta, delta, sigma, DeltaTemp):
2588
- """
2589
- Computes the aircraft's holding speed (CAS) based on the current altitude.
2591
+ """Computes the aircraft's holding speed (CAS) based on the current
2592
+ altitude.
2590
2593
 
2591
2594
  :param h: Altitude in meters [m].
2592
2595
  :param theta: Normalized temperature [-].
@@ -2598,7 +2601,8 @@ class FlightEnvelope(BADA3):
2598
2601
  :type delta: float
2599
2602
  :type sigma: float
2600
2603
  :type DeltaTemp: float
2601
- :returns: Holding calibrated airspeed (CAS) in meters per second [m/s].
2604
+ :returns: Holding calibrated airspeed (CAS) in meters per second
2605
+ [m/s].
2602
2606
  :rtype: float
2603
2607
  """
2604
2608
 
@@ -2623,14 +2627,14 @@ class FlightEnvelope(BADA3):
2623
2627
  return conv.kt2ms(vHold)
2624
2628
 
2625
2629
  def getGroundMovementSpeed(self, pos):
2626
- """
2627
- Returns the ground movement speed based on the aircraft's position on the ground.
2630
+ """Returns the ground movement speed based on the aircraft's position
2631
+ on the ground.
2628
2632
 
2629
- :param pos: Aircraft position on the airport ground (e.g., 'backtrack', 'taxi', 'apron', 'gate').
2633
+ :param pos: Aircraft position on the airport ground (e.g.,
2634
+ 'backtrack', 'taxi', 'apron', 'gate').
2630
2635
  :type pos: str
2631
2636
  :returns: Ground movement speed in meters per second [m/s].
2632
2637
  :rtype: float
2633
-
2634
2638
  """
2635
2639
 
2636
2640
  if pos == "backtrack":
@@ -2653,12 +2657,14 @@ class FlightEnvelope(BADA3):
2653
2657
  return conv.kt2ms(vGround)
2654
2658
 
2655
2659
  def getBankAngle(self, phase, flightUnit, value):
2656
- """
2657
- Returns the nominal or maximum bank angle for the given flight phase and unit type.
2660
+ """Returns the nominal or maximum bank angle for the given flight
2661
+ phase and unit type.
2658
2662
 
2659
2663
  :param phase: Phase of flight (e.g., 'to', 'ic', 'cl', 'cr', etc.).
2660
- :param flightUnit: Flight unit (e.g., 'civ' for civilian, 'mil' for military).
2661
- :param value: Desired value, either 'nom' for nominal or 'max' for maximum bank angle.
2664
+ :param flightUnit: Flight unit (e.g., 'civ' for civilian, 'mil' for
2665
+ military).
2666
+ :param value: Desired value, either 'nom' for nominal or 'max' for
2667
+ maximum bank angle.
2662
2668
  :type phase: str
2663
2669
  :type flightUnit: str
2664
2670
  :type value: str
@@ -2679,14 +2685,19 @@ class FlightEnvelope(BADA3):
2679
2685
  return maxBankAngle
2680
2686
 
2681
2687
  def isAccOK(self, v1, v2, type="long", flightUnit="civ", deltaTime=1.0):
2682
- """
2683
- Checks whether the acceleration between two time steps is within allowable limits.
2684
-
2685
- :param v1: Airspeed (or vertical speed for 'norm') at the previous time step [m/s].
2686
- :param v2: Airspeed (or vertical speed for 'norm') at the current time step [m/s].
2687
- :param type: Type of acceleration to check ('long' for longitudinal, 'norm' for normal).
2688
- :param flightUnit: Flight unit type ('civ' for civilian, 'mil' for military).
2689
- :param deltaTime: Time difference between the two time steps in seconds [s].
2688
+ """Checks whether the acceleration between two time steps is within
2689
+ allowable limits.
2690
+
2691
+ :param v1: Airspeed (or vertical speed for 'norm') at the previous
2692
+ time step [m/s].
2693
+ :param v2: Airspeed (or vertical speed for 'norm') at the current time
2694
+ step [m/s].
2695
+ :param type: Type of acceleration to check ('long' for longitudinal,
2696
+ 'norm' for normal).
2697
+ :param flightUnit: Flight unit type ('civ' for civilian, 'mil' for
2698
+ military).
2699
+ :param deltaTime: Time difference between the two time steps in
2700
+ seconds [s].
2690
2701
  :type v1: float
2691
2702
  :type v2: float
2692
2703
  :type type: str
@@ -2726,12 +2737,12 @@ class FlightEnvelope(BADA3):
2726
2737
  return OK
2727
2738
 
2728
2739
  def getSpeedSchedule(self, phase):
2729
- """
2730
- Returns the speed schedule for a given phase of flight.
2740
+ """Returns the speed schedule for a given phase of flight.
2731
2741
 
2732
2742
  :param phase: Flight phase ('Climb', 'Cruise', 'Descent').
2733
2743
  :type phase: str
2734
- :returns: A list containing CAS1, CAS2, and Mach number for the specified phase [m/s, m/s, -].
2744
+ :returns: A list containing CAS1, CAS2, and Mach number for the
2745
+ specified phase [m/s, m/s, -].
2735
2746
  :rtype: list[float, float, float]
2736
2747
  """
2737
2748
 
@@ -2751,8 +2762,8 @@ class FlightEnvelope(BADA3):
2751
2762
  def checkConfigurationContinuity(
2752
2763
  self, phase, previousConfig, currentConfig
2753
2764
  ):
2754
- """
2755
- Ensures the continuity of aerodynamic configuration changes based on the phase of flight.
2765
+ """Ensures the continuity of aerodynamic configuration changes based
2766
+ on the phase of flight.
2756
2767
 
2757
2768
  :param phase: Current flight phase ('Climb', 'Cruise', 'Descent').
2758
2769
  :param previousConfig: The previous aerodynamic configuration.
@@ -2761,11 +2772,10 @@ class FlightEnvelope(BADA3):
2761
2772
  :type previousConfig: str
2762
2773
  :type currentConfig: str
2763
2774
  :returns: Updated aerodynamic configuration.
2764
- :rtype: str
2765
-
2766
- This function ensures that the aerodynamic configuration transitions logically
2767
- based on the phase of flight. For example, during descent, the configuration
2768
- should not revert to a clean configuration after deploying flaps for approach or landing.
2775
+ :rtype: str This function ensures that the aerodynamic configuration
2776
+ transitions logically based on the phase of flight. For example,
2777
+ during descent, the configuration should not revert to a clean
2778
+ configuration after deploying flaps for approach or landing.
2769
2779
  """
2770
2780
 
2771
2781
  newConfig = ""
@@ -2803,8 +2813,8 @@ class FlightEnvelope(BADA3):
2803
2813
 
2804
2814
 
2805
2815
  class ARPM:
2806
- """This class is a BADA3 aircraft subclass and implements the Airline Procedure Model (ARPM)
2807
- following the BADA3 user manual.
2816
+ """This class is a BADA3 aircraft subclass and implements the Airline
2817
+ Procedure Model (ARPM) following the BADA3 user manual.
2808
2818
 
2809
2819
  :param AC: Aircraft object {BADA3}.
2810
2820
  :type AC: bada3Aircraft.
@@ -2829,8 +2839,8 @@ class ARPM:
2829
2839
  NADP1_ALT=3000,
2830
2840
  NADP2_ALT=[1000, 3000],
2831
2841
  ):
2832
- """
2833
- Computes the climb speed schedule (CAS) for the given altitude based on various procedures and aircraft parameters.
2842
+ """Computes the climb speed schedule (CAS) for the given altitude
2843
+ based on various procedures and aircraft parameters.
2834
2844
 
2835
2845
  :param theta: Normalized air temperature [-].
2836
2846
  :param delta: Normalized air pressure [-].
@@ -3208,8 +3218,8 @@ class ARPM:
3208
3218
  applyLimits=True,
3209
3219
  config=None,
3210
3220
  ):
3211
- """
3212
- Computes the cruise speed schedule (CAS) for a given altitude based on aircraft parameters and procedures.
3221
+ """Computes the cruise speed schedule (CAS) for a given altitude based
3222
+ on aircraft parameters and procedures.
3213
3223
 
3214
3224
  :param h: Altitude in meters [m].
3215
3225
  :param mass: Aircraft mass in kilograms [kg].
@@ -3328,8 +3338,8 @@ class ARPM:
3328
3338
  applyLimits=True,
3329
3339
  config=None,
3330
3340
  ):
3331
- """
3332
- Computes the descent speed schedule (CAS) for a given altitude based on aircraft parameters and procedures.
3341
+ """Computes the descent speed schedule (CAS) for a given altitude
3342
+ based on aircraft parameters and procedures.
3333
3343
 
3334
3344
  :param h: Altitude in meters [m].
3335
3345
  :param mass: Aircraft mass in kilograms [kg].
@@ -3520,7 +3530,8 @@ class ARPM:
3520
3530
 
3521
3531
 
3522
3532
  class PTD(BADA3):
3523
- """This class implements the PTD file creator for BADA3 aircraft following BADA3 manual.
3533
+ """This class implements the PTD file creator for BADA3 aircraft following
3534
+ BADA3 manual.
3524
3535
 
3525
3536
  :param AC: Aircraft object {BADA3}.
3526
3537
  :type AC: bada3Aircraft.
@@ -3533,13 +3544,14 @@ class PTD(BADA3):
3533
3544
  self.ARPM = ARPM(AC)
3534
3545
 
3535
3546
  def create(self, DeltaTemp, saveToPath):
3536
- """
3537
- Creates a BADA3 PTD file based on specified temperature deviation from ISA
3538
- and saves it to the provided directory path. It generates performance data for different aircraft mass levels (low,
3539
- medium, high) in both climb and descent phases.
3547
+ """Creates a BADA3 PTD file based on specified temperature deviation
3548
+ from ISA and saves it to the provided directory path. It generates
3549
+ performance data for different aircraft mass levels (low, medium,
3550
+ high) in both climb and descent phases.
3540
3551
 
3541
3552
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
3542
- :param saveToPath: Path to the directory where the PTD file will be stored.
3553
+ :param saveToPath: Path to the directory where the PTD file will be
3554
+ stored.
3543
3555
  :type DeltaTemp: float.
3544
3556
  :type saveToPath: str.
3545
3557
  :returns: None
@@ -3602,16 +3614,21 @@ class PTD(BADA3):
3602
3614
  DESList_med,
3603
3615
  DeltaTemp,
3604
3616
  ):
3605
- """
3606
- Saves BADA3 (PTD) to a file. It stores performance data for low, medium,
3607
- and high aircraft masses during the climb phase, and medium aircraft mass during the descent phase. The file
3608
- is saved in a predefined format.
3609
-
3610
- :param saveToPath: Path to the directory where the PTD file should be saved.
3611
- :param CLList_low: List containing PTD data for CLIMB at low aircraft mass.
3612
- :param CLList_med: List containing PTD data for CLIMB at medium aircraft mass.
3613
- :param CLList_high: List containing PTD data for CLIMB at high aircraft mass.
3614
- :param DESList_med: List containing PTD data for DESCENT at medium aircraft mass.
3617
+ """Saves BADA3 (PTD) to a file. It stores performance data for low,
3618
+ medium, and high aircraft masses during the climb phase, and medium
3619
+ aircraft mass during the descent phase. The file is saved in a
3620
+ predefined format.
3621
+
3622
+ :param saveToPath: Path to the directory where the PTD file should be
3623
+ saved.
3624
+ :param CLList_low: List containing PTD data for CLIMB at low aircraft
3625
+ mass.
3626
+ :param CLList_med: List containing PTD data for CLIMB at medium
3627
+ aircraft mass.
3628
+ :param CLList_high: List containing PTD data for CLIMB at high
3629
+ aircraft mass.
3630
+ :param DESList_med: List containing PTD data for DESCENT at medium
3631
+ aircraft mass.
3615
3632
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
3616
3633
  :type saveToPath: str.
3617
3634
  :type CLList_low: list.
@@ -3779,12 +3796,12 @@ class PTD(BADA3):
3779
3796
  file.write("\nTDC stands for (Thrust - Drag) * Cred\n")
3780
3797
 
3781
3798
  def PTD_climb(self, mass, altitudeList, DeltaTemp):
3782
- """
3783
- Calculates the BADA3 PTD data in climb phase.
3799
+ """Calculates the BADA3 PTD data in climb phase.
3784
3800
 
3785
3801
  :param mass: Aircraft mass [kg]
3786
3802
  :param altitudeList: List of altitude levels for calculation (in feet)
3787
- :param DeltaTemp: Deviation from International Standard Atmosphere (ISA) temperature [K]
3803
+ :param DeltaTemp: Deviation from International Standard Atmosphere
3804
+ (ISA) temperature [K]
3788
3805
  :type mass: float
3789
3806
  :type altitudeList: list of int
3790
3807
  :type DeltaTemp: float
@@ -3918,11 +3935,11 @@ class PTD(BADA3):
3918
3935
  return CLList
3919
3936
 
3920
3937
  def PTD_descent(self, mass, altitudeList, DeltaTemp):
3921
- """
3922
- Calculates the BADA3 PTD data in descent phase.
3938
+ """Calculates the BADA3 PTD data in descent phase.
3923
3939
 
3924
- This function generates a detailed list of descent performance metrics for different altitudes and
3925
- mass configurations based on BADA3 performance models.
3940
+ This function generates a detailed list of descent performance metrics
3941
+ for different altitudes and mass configurations based on BADA3
3942
+ performance models.
3926
3943
 
3927
3944
  :param mass: Aircraft mass [kg].
3928
3945
  :param altitudeList: List of aircraft altitudes in feet [ft].
@@ -4106,7 +4123,8 @@ class PTD(BADA3):
4106
4123
 
4107
4124
 
4108
4125
  class PTF(BADA3):
4109
- """This class implements the PTF file creator for BADA3 aircraft following BADA3 manual.
4126
+ """This class implements the PTF file creator for BADA3 aircraft following
4127
+ BADA3 manual.
4110
4128
 
4111
4129
  :param AC: Aircraft object {BADA3}.
4112
4130
  :type AC: bada3Aircraft.
@@ -4119,13 +4137,14 @@ class PTF(BADA3):
4119
4137
  self.ARPM = ARPM(AC)
4120
4138
 
4121
4139
  def create(self, DeltaTemp, saveToPath):
4122
- """
4123
- Creates a BADA3 PTF file based on specified temperature deviation from ISA
4124
- and saves it to the provided directory path. It generates performance data for different aircraft mass levels (low,
4125
- medium, high) in both climb and descent phases.
4140
+ """Creates a BADA3 PTF file based on specified temperature deviation
4141
+ from ISA and saves it to the provided directory path. It generates
4142
+ performance data for different aircraft mass levels (low, medium,
4143
+ high) in both climb and descent phases.
4126
4144
 
4127
4145
  :param DeltaTemp: Deviation from ISA temperature in Kelvin [K].
4128
- :param saveToPath: Path to the directory where the PTF file will be stored.
4146
+ :param saveToPath: Path to the directory where the PTF file will be
4147
+ stored.
4129
4148
  :type DeltaTemp: float.
4130
4149
  :type saveToPath: str.
4131
4150
  :returns: None
@@ -4187,8 +4206,7 @@ class PTF(BADA3):
4187
4206
  massList,
4188
4207
  DeltaTemp,
4189
4208
  ):
4190
- """
4191
- Saves performance data to a PTF file.
4209
+ """Saves performance data to a PTF file.
4192
4210
 
4193
4211
  :param saveToPath: Directory path where the PTF file will be stored.
4194
4212
  :param CRList: List of cruise phase data.
@@ -4349,9 +4367,11 @@ class PTF(BADA3):
4349
4367
  def PTF_cruise(self, massList, altitudeList, DeltaTemp):
4350
4368
  """Calculates BADA3 PTF data for the cruise phase.
4351
4369
 
4352
- :param massList: List of aircraft masses [kg] (low, nominal, and high).
4370
+ :param massList: List of aircraft masses [kg] (low, nominal, and
4371
+ high).
4353
4372
  :param altitudeList: List of aircraft altitudes [ft].
4354
- :param DeltaTemp: Deviation from the International Standard Atmosphere (ISA) temperature [K].
4373
+ :param DeltaTemp: Deviation from the International Standard Atmosphere
4374
+ (ISA) temperature [K].
4355
4375
  :type massList: list of float.
4356
4376
  :type altitudeList: list of int.
4357
4377
  :type DeltaTemp: float.
@@ -4428,7 +4448,8 @@ class PTF(BADA3):
4428
4448
 
4429
4449
  :param massList: List of aircraft masses [kg] (low, nominal, high).
4430
4450
  :param altitudeList: List of aircraft altitudes [ft].
4431
- :param DeltaTemp: Deviation from the International Standard Atmosphere (ISA) temperature [K].
4451
+ :param DeltaTemp: Deviation from the International Standard Atmosphere
4452
+ (ISA) temperature [K].
4432
4453
  :type massList: list of float.
4433
4454
  :type altitudeList: list of int.
4434
4455
  :type DeltaTemp: float.
@@ -4553,7 +4574,8 @@ class PTF(BADA3):
4553
4574
 
4554
4575
  :param massList: List of aircraft masses [kg] (low, nominal, high).
4555
4576
  :param altitudeList: List of aircraft altitudes [ft].
4556
- :param DeltaTemp: Deviation from the International Standard Atmosphere (ISA) temperature [K].
4577
+ :param DeltaTemp: Deviation from the International Standard Atmosphere
4578
+ (ISA) temperature [K].
4557
4579
  :type massList: list of float.
4558
4580
  :type altitudeList: list of int.
4559
4581
  :type DeltaTemp: float.
@@ -4682,20 +4704,22 @@ class PTF(BADA3):
4682
4704
 
4683
4705
 
4684
4706
  class Bada3Aircraft(BADA3):
4685
- """
4686
- Implements the BADA3 performance model for an aircraft following the BADA3 manual.
4707
+ """Implements the BADA3 performance model for an aircraft following the
4708
+ BADA3 manual.
4687
4709
 
4688
- This class handles the loading of aircraft-specific data from either a predefined
4689
- dataset or a set of BADA3 performance model files (e.g., OPF and APF files).
4690
- It initializes various parameters such as mass, speed schedules, and engine type
4691
- necessary for simulating the aircraft's performance.
4710
+ This class handles the loading of aircraft-specific data from either a
4711
+ predefined dataset or a set of BADA3 performance model files (e.g., OPF
4712
+ and APF files). It initializes various parameters such as mass, speed
4713
+ schedules, and engine type necessary for simulating the aircraft's
4714
+ performance.
4692
4715
 
4693
4716
  :param badaVersion: The BADA version being used.
4694
4717
  :param acName: The ICAO aircraft designation (e.g., "A320").
4695
- :param filePath: Optional path to the BADA3 formatted file. If not provided,
4696
- the default aircraft directory is used.
4697
- :param allData: Optional DataFrame containing all aircraft data. If provided,
4698
- the class will try to load the aircraft data from this DataFrame.
4718
+ :param filePath: Optional path to the BADA3 formatted file. If not
4719
+ provided, the default aircraft directory is used.
4720
+ :param allData: Optional DataFrame containing all aircraft data. If
4721
+ provided, the class will try to load the aircraft data from this
4722
+ DataFrame.
4699
4723
  :type badaVersion: str.
4700
4724
  :type acName: str.
4701
4725
  :type filePath: str, optional.
@@ -4714,7 +4738,7 @@ class Bada3Aircraft(BADA3):
4714
4738
  self.BADAFamily = BadaFamily(BADA3=True)
4715
4739
  self.BADAVersion = badaVersion
4716
4740
 
4717
- if filePath == None:
4741
+ if filePath is None:
4718
4742
  self.filePath = configuration.getBadaVersionPath(
4719
4743
  badaFamily="BADA3", badaVersion=badaVersion
4720
4744
  )
@@ -4823,7 +4847,7 @@ class Bada3Aircraft(BADA3):
4823
4847
  self.filePath, acName
4824
4848
  )
4825
4849
 
4826
- if self.SearchedACName == None:
4850
+ if self.SearchedACName is None:
4827
4851
  # look for file name directly, which consists of added "_" at the end of file
4828
4852
  fileName = acName
4829
4853
  while len(fileName) < 6: