pyBADA 0.1.3__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/TCL.py +56 -49
- pyBADA/aircraft.py +39 -40
- pyBADA/atmosphere.py +79 -72
- pyBADA/bada3.py +272 -245
- pyBADA/bada4.py +460 -337
- pyBADA/badaH.py +338 -239
- pyBADA/configuration.py +31 -21
- pyBADA/constants.py +0 -1
- pyBADA/conversions.py +11 -23
- pyBADA/flightTrajectory.py +95 -63
- pyBADA/geodesic.py +119 -82
- pyBADA/magnetic.py +12 -7
- pyBADA/trajectoryPrediction.py +17 -13
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/METADATA +14 -5
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/RECORD +18 -18
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/WHEEL +0 -0
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/licenses/AUTHORS +0 -0
- {pybada-0.1.3.dist-info → pybada-0.1.4.dist-info}/licenses/LICENCE.txt +0 -0
pyBADA/geodesic.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
"""
|
|
3
2
|
Geodesic calculation module
|
|
4
3
|
"""
|
|
@@ -15,15 +14,14 @@ from math import (
|
|
|
15
14
|
pi,
|
|
16
15
|
log,
|
|
17
16
|
log2,
|
|
18
|
-
acos,
|
|
19
17
|
)
|
|
20
18
|
from pyBADA.aircraft import Airplane as airplane
|
|
21
|
-
from pyBADA import conversions as conv
|
|
22
19
|
from pyBADA import constants as const
|
|
23
20
|
|
|
24
21
|
|
|
25
22
|
class Haversine:
|
|
26
|
-
"""This class implements the geodesic calculations on sherical earth
|
|
23
|
+
"""This class implements the geodesic calculations on sherical earth
|
|
24
|
+
(ignoring ellipsoidal effects).
|
|
27
25
|
|
|
28
26
|
.. note::
|
|
29
27
|
https://www.movable-type.co.uk/scripts/latlong.html
|
|
@@ -34,10 +32,12 @@ class Haversine:
|
|
|
34
32
|
|
|
35
33
|
@staticmethod
|
|
36
34
|
def distance(LAT_init, LON_init, LAT_final, LON_final):
|
|
37
|
-
"""Calculate the great-circle distance between two points on the
|
|
35
|
+
"""Calculate the great-circle distance between two points on the
|
|
36
|
+
Earth's surface using the haversine formula.
|
|
38
37
|
|
|
39
|
-
The great-circle distance is the shortest distance between two points
|
|
40
|
-
ignoring elevation changes (i.e., hills or
|
|
38
|
+
The great-circle distance is the shortest distance between two points
|
|
39
|
+
over the Earth's surface, ignoring elevation changes (i.e., hills or
|
|
40
|
+
mountains).
|
|
41
41
|
|
|
42
42
|
:param LAT_init: Initial latitude in degrees.
|
|
43
43
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -68,12 +68,15 @@ class Haversine:
|
|
|
68
68
|
|
|
69
69
|
@staticmethod
|
|
70
70
|
def destinationPoint(LAT_init, LON_init, distance, bearing):
|
|
71
|
-
"""Calculate the destination point given an initial point, distance,
|
|
71
|
+
"""Calculate the destination point given an initial point, distance,
|
|
72
|
+
and bearing.
|
|
72
73
|
|
|
73
|
-
Given an initial latitude and longitude, this function calculates the
|
|
74
|
-
after traveling the specified distance along the
|
|
74
|
+
Given an initial latitude and longitude, this function calculates the
|
|
75
|
+
destination point after traveling the specified distance along the
|
|
76
|
+
given initial bearing (direction).
|
|
75
77
|
|
|
76
|
-
Note that the bearing may vary along the path, but this calculation
|
|
78
|
+
Note that the bearing may vary along the path, but this calculation
|
|
79
|
+
assumes a constant bearing.
|
|
77
80
|
|
|
78
81
|
:param LAT_init: Initial latitude in degrees.
|
|
79
82
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -83,7 +86,8 @@ class Haversine:
|
|
|
83
86
|
:type LON_init: float
|
|
84
87
|
:type distance: float
|
|
85
88
|
:type bearing: float
|
|
86
|
-
:returns: Tuple containing the destination latitude and longitude in
|
|
89
|
+
:returns: Tuple containing the destination latitude and longitude in
|
|
90
|
+
degrees.
|
|
87
91
|
:rtype: (float, float)
|
|
88
92
|
"""
|
|
89
93
|
|
|
@@ -108,10 +112,12 @@ class Haversine:
|
|
|
108
112
|
|
|
109
113
|
@staticmethod
|
|
110
114
|
def bearing(LAT_init, LON_init, LAT_final, LON_final):
|
|
111
|
-
"""Calculate the initial bearing between two points along a great-
|
|
115
|
+
"""Calculate the initial bearing between two points along a great-
|
|
116
|
+
circle path.
|
|
112
117
|
|
|
113
|
-
The initial bearing (forward azimuth) is the direction one would need
|
|
114
|
-
in a straight line along the great-circle arc from the start
|
|
118
|
+
The initial bearing (forward azimuth) is the direction one would need
|
|
119
|
+
to travel in a straight line along the great-circle arc from the start
|
|
120
|
+
point to the end point.
|
|
115
121
|
|
|
116
122
|
This bearing is measured clockwise from true north.
|
|
117
123
|
|
|
@@ -140,20 +146,21 @@ class Haversine:
|
|
|
140
146
|
return bearing
|
|
141
147
|
|
|
142
148
|
|
|
143
|
-
class Vincenty
|
|
144
|
-
"""This class implements the vincenty calculations of geodesics on the
|
|
149
|
+
class Vincenty:
|
|
150
|
+
"""This class implements the vincenty calculations of geodesics on the
|
|
151
|
+
ellipsoid-model earth.
|
|
145
152
|
|
|
146
153
|
.. note::
|
|
147
154
|
https://www.movable-type.co.uk/scripts/latlong-vincenty.html
|
|
148
|
-
|
|
149
155
|
"""
|
|
150
156
|
|
|
151
157
|
@staticmethod
|
|
152
158
|
def distance_bearing(LAT_init, LON_init, LAT_final, LON_final):
|
|
153
|
-
"""Calculate the geodesic distance, initial bearing, and final bearing
|
|
159
|
+
"""Calculate the geodesic distance, initial bearing, and final bearing
|
|
160
|
+
between two points on the Earth's surface.
|
|
154
161
|
|
|
155
|
-
This method uses the Vincenty formula to account for the Earth's
|
|
156
|
-
calculations for long distances.
|
|
162
|
+
This method uses the Vincenty formula to account for the Earth's
|
|
163
|
+
ellipsoidal shape, providing accurate calculations for long distances.
|
|
157
164
|
|
|
158
165
|
:param LAT_init: Initial latitude in degrees.
|
|
159
166
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -163,7 +170,8 @@ class Vincenty(object):
|
|
|
163
170
|
:type LON_init: float
|
|
164
171
|
:type LAT_final: float
|
|
165
172
|
:type LON_final: float
|
|
166
|
-
:returns: Tuple containing distance in meters, initial bearing in
|
|
173
|
+
:returns: Tuple containing distance in meters, initial bearing in
|
|
174
|
+
degrees, and final bearing in degrees.
|
|
167
175
|
:rtype: (float, float, float)
|
|
168
176
|
"""
|
|
169
177
|
|
|
@@ -277,10 +285,12 @@ class Vincenty(object):
|
|
|
277
285
|
|
|
278
286
|
@staticmethod
|
|
279
287
|
def distance(LAT_init, LON_init, LAT_final, LON_final):
|
|
280
|
-
"""Calculate the geodesic distance between two latitude/longitude
|
|
288
|
+
"""Calculate the geodesic distance between two latitude/longitude
|
|
289
|
+
points on the Earth's surface.
|
|
281
290
|
|
|
282
|
-
This method uses an accurate ellipsoidal model (Vincenty's formula)
|
|
283
|
-
which is particularly useful for long
|
|
291
|
+
This method uses an accurate ellipsoidal model (Vincenty's formula)
|
|
292
|
+
for calculating the distance, which is particularly useful for long
|
|
293
|
+
distances across the globe.
|
|
284
294
|
|
|
285
295
|
:param LAT_init: Initial latitude in degrees.
|
|
286
296
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -301,10 +311,12 @@ class Vincenty(object):
|
|
|
301
311
|
|
|
302
312
|
@staticmethod
|
|
303
313
|
def bearing_initial(LAT_init, LON_init, LAT_final, LON_final):
|
|
304
|
-
"""Calculate the initial bearing (forward azimuth) from the initial
|
|
314
|
+
"""Calculate the initial bearing (forward azimuth) from the initial
|
|
315
|
+
point to the final point.
|
|
305
316
|
|
|
306
|
-
This function returns the initial bearing that, if followed in a
|
|
307
|
-
will take you from the start
|
|
317
|
+
This function returns the initial bearing that, if followed in a
|
|
318
|
+
straight line along a great-circle path, will take you from the start
|
|
319
|
+
point to the end point.
|
|
308
320
|
|
|
309
321
|
:param LAT_init: Initial latitude in degrees.
|
|
310
322
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -325,10 +337,12 @@ class Vincenty(object):
|
|
|
325
337
|
|
|
326
338
|
@staticmethod
|
|
327
339
|
def bearing_final(LAT_init, LON_init, LAT_final, LON_final):
|
|
328
|
-
"""Calculate the final bearing (reverse azimuth) from the final point
|
|
340
|
+
"""Calculate the final bearing (reverse azimuth) from the final point
|
|
341
|
+
to the initial point.
|
|
329
342
|
|
|
330
|
-
This function calculates the final bearing at the destination point,
|
|
331
|
-
would need to take to return to the initial
|
|
343
|
+
This function calculates the final bearing at the destination point,
|
|
344
|
+
which is the direction one would need to take to return to the initial
|
|
345
|
+
point along the great-circle path.
|
|
332
346
|
|
|
333
347
|
:param LAT_init: Initial latitude in degrees.
|
|
334
348
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -349,7 +363,8 @@ class Vincenty(object):
|
|
|
349
363
|
|
|
350
364
|
@staticmethod
|
|
351
365
|
def destinationPoint_finalBearing(LAT_init, LON_init, distance, bearing):
|
|
352
|
-
"""Calculate the destination point and final bearing given an initial
|
|
366
|
+
"""Calculate the destination point and final bearing given an initial
|
|
367
|
+
point, distance, and bearing.
|
|
353
368
|
|
|
354
369
|
This method calculates the latitude and longitude of the destination point after traveling a specified
|
|
355
370
|
distance along the given bearing from the starting point. It also returns the final bearing at the
|
|
@@ -449,20 +464,24 @@ class Vincenty(object):
|
|
|
449
464
|
|
|
450
465
|
@staticmethod
|
|
451
466
|
def destinationPoint(LAT_init, LON_init, distance, bearing):
|
|
452
|
-
"""Calculate the destination point after traveling a specified
|
|
467
|
+
"""Calculate the destination point after traveling a specified
|
|
468
|
+
distance on a given bearing.
|
|
453
469
|
|
|
454
|
-
This method returns the latitude and longitude of the destination
|
|
455
|
-
distance on the specified initial
|
|
470
|
+
This method returns the latitude and longitude of the destination
|
|
471
|
+
point after traveling the given distance on the specified initial
|
|
472
|
+
bearing, following a great-circle path.
|
|
456
473
|
|
|
457
474
|
:param LAT_init: Initial latitude in degrees.
|
|
458
475
|
:param LON_init: Initial longitude in degrees.
|
|
459
|
-
:param distance: Distance to be traveled from the initial point in
|
|
476
|
+
:param distance: Distance to be traveled from the initial point in
|
|
477
|
+
meters.
|
|
460
478
|
:param bearing: Initial bearing (direction) in degrees.
|
|
461
479
|
:type LAT_init: float
|
|
462
480
|
:type LON_init: float
|
|
463
481
|
:type distance: float
|
|
464
482
|
:type bearing: float
|
|
465
|
-
:returns: Tuple containing the destination latitude and longitude in
|
|
483
|
+
:returns: Tuple containing the destination latitude and longitude in
|
|
484
|
+
degrees.
|
|
466
485
|
:rtype: (float, float)
|
|
467
486
|
"""
|
|
468
487
|
|
|
@@ -473,22 +492,22 @@ class Vincenty(object):
|
|
|
473
492
|
return (dest[0], dest[1])
|
|
474
493
|
|
|
475
494
|
|
|
476
|
-
class RhumbLine
|
|
477
|
-
"""This class implements the rhumb line (loxodrome) calculations of
|
|
495
|
+
class RhumbLine:
|
|
496
|
+
"""This class implements the rhumb line (loxodrome) calculations of
|
|
497
|
+
geodesics on the ellipsoid-model earth.
|
|
478
498
|
|
|
479
499
|
.. note::
|
|
480
500
|
https://github.com/SpyrosMouselinos/distancly/blob/master/distancly/rhumbline.py
|
|
481
|
-
|
|
482
501
|
"""
|
|
483
502
|
|
|
484
503
|
@staticmethod
|
|
485
504
|
def simple_project(latitiude: float) -> float:
|
|
486
|
-
"""
|
|
487
|
-
|
|
505
|
+
"""Applies a projection to the latitude for use in rhumbline
|
|
506
|
+
calculations.
|
|
488
507
|
|
|
489
|
-
The projection is based on the Mercator projection, where latitudes
|
|
490
|
-
to account for the curvature of the Earth. This formula
|
|
491
|
-
along the rhumbline are accurate.
|
|
508
|
+
The projection is based on the Mercator projection, where latitudes
|
|
509
|
+
are projected to account for the curvature of the Earth. This formula
|
|
510
|
+
ensures that the calculations along the rhumbline are accurate.
|
|
492
511
|
|
|
493
512
|
:param latitiude: Latitude in radians.
|
|
494
513
|
:return: The projected latitude in radians.
|
|
@@ -498,13 +517,15 @@ class RhumbLine(object):
|
|
|
498
517
|
|
|
499
518
|
@staticmethod
|
|
500
519
|
def distance(LAT_init, LON_init, LAT_final, LON_final) -> float:
|
|
501
|
-
"""
|
|
502
|
-
|
|
520
|
+
"""Calculates the rhumbline distance between two geographical points
|
|
521
|
+
in meters.
|
|
503
522
|
|
|
504
|
-
The rhumbline is a path of constant bearing that crosses all meridians
|
|
505
|
-
unlike a great-circle route which is the shortest
|
|
523
|
+
The rhumbline is a path of constant bearing that crosses all meridians
|
|
524
|
+
at the same angle, unlike a great-circle route which is the shortest
|
|
525
|
+
distance between two points on the Earth's surface.
|
|
506
526
|
|
|
507
|
-
This method adjusts for longitudes that span more than half of the
|
|
527
|
+
This method adjusts for longitudes that span more than half of the
|
|
528
|
+
globe.
|
|
508
529
|
|
|
509
530
|
:param LAT_init: Initial latitude in degrees.
|
|
510
531
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -544,11 +565,12 @@ class RhumbLine(object):
|
|
|
544
565
|
|
|
545
566
|
@staticmethod
|
|
546
567
|
def bearing(LAT_init, LON_init, LAT_final, LON_final) -> float:
|
|
547
|
-
"""
|
|
548
|
-
|
|
568
|
+
"""Calculates the rhumbline bearing from the initial point to the
|
|
569
|
+
final point.
|
|
549
570
|
|
|
550
|
-
This returns the constant bearing (direction) required to travel along
|
|
551
|
-
between the two points. The bearing is adjusted for
|
|
571
|
+
This returns the constant bearing (direction) required to travel along
|
|
572
|
+
a rhumbline between the two points. The bearing is adjusted for
|
|
573
|
+
longitudes that cross the 180-degree meridian.
|
|
552
574
|
|
|
553
575
|
:param LAT_init: Initial latitude in degrees.
|
|
554
576
|
:param LON_init: Initial longitude in degrees.
|
|
@@ -578,17 +600,20 @@ class RhumbLine(object):
|
|
|
578
600
|
|
|
579
601
|
@staticmethod
|
|
580
602
|
def destinationPoint(LAT_init, LON_init, bearing, distance) -> tuple:
|
|
581
|
-
"""
|
|
582
|
-
|
|
603
|
+
"""Calculates the destination point given an initial point, a bearing,
|
|
604
|
+
and a distance traveled.
|
|
583
605
|
|
|
584
|
-
This method computes the final latitude and longitude after traveling
|
|
585
|
-
for a given distance in meters from the initial
|
|
606
|
+
This method computes the final latitude and longitude after traveling
|
|
607
|
+
along a rhumbline for a given distance in meters from the initial
|
|
608
|
+
point at a constant bearing.
|
|
586
609
|
|
|
587
610
|
:param LAT_init: Initial latitude in degrees.
|
|
588
611
|
:param LON_init: Initial longitude in degrees.
|
|
589
612
|
:param bearing: The constant bearing in degrees.
|
|
590
|
-
:param distance: The distance to travel from the initial point in
|
|
591
|
-
|
|
613
|
+
:param distance: The distance to travel from the initial point in
|
|
614
|
+
meters.
|
|
615
|
+
:return: A tuple containing the destination latitude and longitude in
|
|
616
|
+
degrees.
|
|
592
617
|
"""
|
|
593
618
|
|
|
594
619
|
lat_a = radians(LAT_init)
|
|
@@ -626,17 +651,19 @@ class RhumbLine(object):
|
|
|
626
651
|
def loxodromic_mid_point(
|
|
627
652
|
LAT_init, LON_init, LAT_final, LON_final
|
|
628
653
|
) -> tuple:
|
|
629
|
-
"""
|
|
630
|
-
|
|
654
|
+
"""Calculates the midpoint along a rhumbline between two geographical
|
|
655
|
+
points.
|
|
631
656
|
|
|
632
|
-
The midpoint is calculated using the rhumbline path between the
|
|
633
|
-
This takes into account the Earth's
|
|
657
|
+
The midpoint is calculated using the rhumbline path between the
|
|
658
|
+
initial and final points. This takes into account the Earth's
|
|
659
|
+
curvature by projecting the latitudes.
|
|
634
660
|
|
|
635
661
|
:param LAT_init: Initial latitude in degrees.
|
|
636
662
|
:param LON_init: Initial longitude in degrees.
|
|
637
663
|
:param LAT_final: Final latitude in degrees.
|
|
638
664
|
:param LON_final: Final longitude in degrees.
|
|
639
|
-
:return: A tuple representing the midpoint's latitude and longitude in
|
|
665
|
+
:return: A tuple representing the midpoint's latitude and longitude in
|
|
666
|
+
degrees.
|
|
640
667
|
"""
|
|
641
668
|
|
|
642
669
|
lat_a = radians(LAT_init)
|
|
@@ -670,18 +697,21 @@ class RhumbLine(object):
|
|
|
670
697
|
def loxodromic_power_interpolation(
|
|
671
698
|
LAT_init, LON_init, LAT_final, LON_final, n_points: int
|
|
672
699
|
) -> list:
|
|
673
|
-
"""
|
|
674
|
-
|
|
700
|
+
"""Generates a specified number of points between two geographical
|
|
701
|
+
locations along a rhumbline path.
|
|
675
702
|
|
|
676
|
-
This method recursively calculates intermediate points between two
|
|
677
|
-
|
|
703
|
+
This method recursively calculates intermediate points between two
|
|
704
|
+
points on the Earth's surface, following a constant bearing rhumbline
|
|
705
|
+
path. The number of points should be a power of 2 minus 1.
|
|
678
706
|
|
|
679
707
|
:param LAT_init: Initial latitude in degrees.
|
|
680
708
|
:param LON_init: Initial longitude in degrees.
|
|
681
709
|
:param LAT_final: Final latitude in degrees.
|
|
682
710
|
:param LON_final: Final longitude in degrees.
|
|
683
|
-
:param n_points: Number of intermediate points to generate. Must be a
|
|
684
|
-
|
|
711
|
+
:param n_points: Number of intermediate points to generate. Must be a
|
|
712
|
+
power of 2 minus 1.
|
|
713
|
+
:return: A list of tuples, where each tuple represents an interpolated
|
|
714
|
+
point's latitude and longitude in degrees.
|
|
685
715
|
"""
|
|
686
716
|
|
|
687
717
|
n_points = int(n_points)
|
|
@@ -718,8 +748,8 @@ class RhumbLine(object):
|
|
|
718
748
|
return decoupled_points
|
|
719
749
|
|
|
720
750
|
|
|
721
|
-
class Turn
|
|
722
|
-
"""This class implements the calculations of geodesics turns"""
|
|
751
|
+
class Turn:
|
|
752
|
+
"""This class implements the calculations of geodesics turns."""
|
|
723
753
|
|
|
724
754
|
@staticmethod
|
|
725
755
|
def destinationPoint_finalBearing(
|
|
@@ -732,11 +762,14 @@ class Turn(object):
|
|
|
732
762
|
directionOfTurn,
|
|
733
763
|
centerPoint=None,
|
|
734
764
|
):
|
|
735
|
-
"""Calculates the destination point and final bearing after traveling
|
|
765
|
+
"""Calculates the destination point and final bearing after traveling
|
|
766
|
+
for a given time with a specified turn.
|
|
736
767
|
|
|
737
|
-
This function computes the aircraft's final position and bearing
|
|
738
|
-
|
|
739
|
-
|
|
768
|
+
This function computes the aircraft's final position and bearing
|
|
769
|
+
after making a turn at a specified rate of turn, direction, and
|
|
770
|
+
true airspeed (TAS). If TAS is zero, the aircraft rotates in
|
|
771
|
+
place. The calculation accounts for turning radius and bank
|
|
772
|
+
angle.
|
|
740
773
|
|
|
741
774
|
:param LAT_init: Initial latitude [deg].
|
|
742
775
|
:param LON_init: Initial longitude [deg].
|
|
@@ -745,7 +778,8 @@ class Turn(object):
|
|
|
745
778
|
:param TAS: True Airspeed (TAS) [m/s].
|
|
746
779
|
:param rateOfTurn: Rate of turn [deg/s].
|
|
747
780
|
:param directionOfTurn: Direction of turn ('LEFT' or 'RIGHT').
|
|
748
|
-
:param centerPoint: Optional latitude and longitude of the
|
|
781
|
+
:param centerPoint: Optional latitude and longitude of the
|
|
782
|
+
rotation center (defaults to None) [deg, deg].
|
|
749
783
|
:type LAT_init: float.
|
|
750
784
|
:type LON_init: float.
|
|
751
785
|
:type timeOfTurn: float.
|
|
@@ -754,7 +788,8 @@ class Turn(object):
|
|
|
754
788
|
:type rateOfTurn: float.
|
|
755
789
|
:type directionOfTurn: str.
|
|
756
790
|
:type centerPoint: tuple(float, float).
|
|
757
|
-
:returns: Destination point's latitude, longitude, and final
|
|
791
|
+
:returns: Destination point's latitude, longitude, and final
|
|
792
|
+
bearing [deg, deg, deg].
|
|
758
793
|
:rtype: tuple(float, float, float).
|
|
759
794
|
"""
|
|
760
795
|
|
|
@@ -826,10 +861,12 @@ class Turn(object):
|
|
|
826
861
|
|
|
827
862
|
@staticmethod
|
|
828
863
|
def distance(rateOfTurn, TAS, timeOfTurn):
|
|
829
|
-
"""Calculates the distance traveled during a turn based on the rate of
|
|
864
|
+
"""Calculates the distance traveled during a turn based on the rate of
|
|
865
|
+
turn, true airspeed, and time.
|
|
830
866
|
|
|
831
|
-
This function computes the total distance traveled during a constant
|
|
832
|
-
of turn, true airspeed, and the
|
|
867
|
+
This function computes the total distance traveled during a constant
|
|
868
|
+
turn, based on the aircraft's rate of turn, true airspeed, and the
|
|
869
|
+
duration of the turn.
|
|
833
870
|
|
|
834
871
|
:param rateOfTurn: Rate of turn [deg/s].
|
|
835
872
|
:param TAS: True Airspeed (TAS) [m/s].
|
pyBADA/magnetic.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
"""
|
|
3
2
|
Magnetic declination module
|
|
4
3
|
"""
|
|
@@ -51,7 +50,8 @@ class Grid:
|
|
|
51
50
|
|
|
52
51
|
:param LAT_target: Target latitude to search for.
|
|
53
52
|
:type LAT_target: float
|
|
54
|
-
:return: The closest latitude from the grid or None if the target is
|
|
53
|
+
:return: The closest latitude from the grid or None if the target is
|
|
54
|
+
out of bounds.
|
|
55
55
|
:rtype: float or None
|
|
56
56
|
"""
|
|
57
57
|
|
|
@@ -79,7 +79,8 @@ class Grid:
|
|
|
79
79
|
|
|
80
80
|
:param LON_target: Target longitude to search for.
|
|
81
81
|
:type LON_target: float
|
|
82
|
-
:return: The closest longitude from the grid or None if the target is
|
|
82
|
+
:return: The closest longitude from the grid or None if the target is
|
|
83
|
+
out of bounds.
|
|
83
84
|
:rtype: float or None
|
|
84
85
|
"""
|
|
85
86
|
|
|
@@ -103,13 +104,15 @@ class Grid:
|
|
|
103
104
|
return closest
|
|
104
105
|
|
|
105
106
|
def getClosestIdx(self, LAT_target, LON_target):
|
|
106
|
-
"""Finds the index of the closest grid point for a given latitude and
|
|
107
|
+
"""Finds the index of the closest grid point for a given latitude and
|
|
108
|
+
longitude.
|
|
107
109
|
|
|
108
110
|
:param LAT_target: Target latitude.
|
|
109
111
|
:param LON_target: Target longitude.
|
|
110
112
|
:type LAT_target: float
|
|
111
113
|
:type LON_target: float
|
|
112
|
-
:return: Index of the closest point in the grid or None if no point is
|
|
114
|
+
:return: Index of the closest point in the grid or None if no point is
|
|
115
|
+
found.
|
|
113
116
|
:rtype: int or None
|
|
114
117
|
"""
|
|
115
118
|
|
|
@@ -134,13 +137,15 @@ class Grid:
|
|
|
134
137
|
return None
|
|
135
138
|
|
|
136
139
|
def getMagneticDeclination(self, LAT_target, LON_target):
|
|
137
|
-
"""Returns the magnetic declination for the closest grid point to the
|
|
140
|
+
"""Returns the magnetic declination for the closest grid point to the
|
|
141
|
+
target coordinates.
|
|
138
142
|
|
|
139
143
|
:param LAT_target: Target latitude.
|
|
140
144
|
:param LON_target: Target longitude.
|
|
141
145
|
:type LAT_target: float
|
|
142
146
|
:type LON_target: float
|
|
143
|
-
:return: Magnetic declination at the closest grid point or None if no
|
|
147
|
+
:return: Magnetic declination at the closest grid point or None if no
|
|
148
|
+
point is found.
|
|
144
149
|
:rtype: float or None
|
|
145
150
|
"""
|
|
146
151
|
|
pyBADA/trajectoryPrediction.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
1
|
"""
|
|
3
2
|
Basic calculations for the Trajectory Prediction (TP) using BADA
|
|
4
3
|
"""
|
|
5
4
|
|
|
6
5
|
from pyBADA import atmosphere as atm
|
|
7
|
-
from pyBADA import conversions as conv
|
|
8
6
|
from math import exp
|
|
9
7
|
|
|
10
8
|
|
|
@@ -86,14 +84,17 @@ def cruiseFuelConsumption(AC, altitude, M, deltaTemp):
|
|
|
86
84
|
def breguetLeducInitialMass(
|
|
87
85
|
AC, distance, GS, cruiseFuelFlow, payload, fuelReserve
|
|
88
86
|
):
|
|
89
|
-
"""
|
|
90
|
-
|
|
87
|
+
"""Calculate the estimated initial mass required for the aircraft using
|
|
88
|
+
the Breguet Leduc formula.
|
|
91
89
|
|
|
92
|
-
:param AC: Aircraft object (instance of Bada3Aircraft, Bada4Aircraft, or
|
|
90
|
+
:param AC: Aircraft object (instance of Bada3Aircraft, Bada4Aircraft, or
|
|
91
|
+
BadaHAircraft).
|
|
93
92
|
:param distance: Flight distance in meters.
|
|
94
|
-
:param GS: Ground speed in m/s (assumed equal to true airspeed under no-
|
|
93
|
+
:param GS: Ground speed in m/s (assumed equal to true airspeed under no-
|
|
94
|
+
wind conditions).
|
|
95
95
|
:param cruiseFuelFlow: Fuel flow rate during cruise in kg/s.
|
|
96
|
-
:param payload: Payload percentage (of the maximum payload mass) to be
|
|
96
|
+
:param payload: Payload percentage (of the maximum payload mass) to be
|
|
97
|
+
used.
|
|
97
98
|
:param fuelReserve: Fuel reserve time in seconds.
|
|
98
99
|
:type AC: object
|
|
99
100
|
:type distance: float
|
|
@@ -132,16 +133,20 @@ def getInitialMass(
|
|
|
132
133
|
flightPlanInitialMass=None,
|
|
133
134
|
deltaTemp=0,
|
|
134
135
|
):
|
|
135
|
-
"""Calculates the estimated initial aircraft mass assumig cruise phase,
|
|
136
|
-
|
|
136
|
+
"""Calculates the estimated initial aircraft mass assumig cruise phase,
|
|
137
|
+
combining flight plan data, aircraft envelope constraints, and an
|
|
138
|
+
exponential fuel consumption model inspired by the Breguet Leduc formula.
|
|
137
139
|
|
|
138
|
-
:param AC: Aircraft object (instance of Bada3Aircraft, Bada4Aircraft,
|
|
140
|
+
:param AC: Aircraft object (instance of Bada3Aircraft, Bada4Aircraft,
|
|
141
|
+
BadaEAircraft, or BadaHAircraft).
|
|
139
142
|
:param distance: Distance to be flown in meters.
|
|
140
143
|
:param altitude: Cruising altitude in meters.
|
|
141
144
|
:param M: Mach number at cruising altitude.
|
|
142
145
|
:param payload: Percentage of the maximum payload mass (default is 60%).
|
|
143
|
-
:param fuelReserve: Fuel reserve time in seconds (default is 3600 seconds,
|
|
144
|
-
|
|
146
|
+
:param fuelReserve: Fuel reserve time in seconds (default is 3600 seconds,
|
|
147
|
+
or 1 hour).
|
|
148
|
+
:param flightPlanInitialMass: Optional initial mass from a flight plan, in
|
|
149
|
+
kg.
|
|
145
150
|
:param deltaTemp: Temperature deviation from standard atmosphere.
|
|
146
151
|
:type AC: object
|
|
147
152
|
:type distance: float
|
|
@@ -159,7 +164,6 @@ def getInitialMass(
|
|
|
159
164
|
if flightPlanInitialMass is not None:
|
|
160
165
|
initialMass = flightPlanInitialMass
|
|
161
166
|
else:
|
|
162
|
-
|
|
163
167
|
# in case of no wind, the ground speed is the same as true airspeed
|
|
164
168
|
[theta, delta, sigma] = atm.atmosphereProperties(
|
|
165
169
|
h=altitude, DeltaTemp=deltaTemp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyBADA
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: pyBADA
|
|
5
5
|
Project-URL: Homepage, https://github.com/eurocontrol-bada/pybada
|
|
6
6
|
Author-email: Henrich Glaser-Opitz <henrich.glaser-opitz@eurocontrol.int>
|
|
@@ -16,14 +16,13 @@ Requires-Dist: scipy>=1.15.2
|
|
|
16
16
|
Requires-Dist: simplekml>=1.3.6
|
|
17
17
|
Requires-Dist: xlsxwriter>=3.2.2
|
|
18
18
|
Provides-Extra: dev
|
|
19
|
-
Requires-Dist: black==25.1.0; extra == 'dev'
|
|
20
19
|
Requires-Dist: build; extra == 'dev'
|
|
21
|
-
Requires-Dist: flake8==7.1.2; extra == 'dev'
|
|
22
20
|
Requires-Dist: folium==0.19.5; extra == 'dev'
|
|
23
21
|
Requires-Dist: matplotlib==3.10.1; extra == 'dev'
|
|
24
22
|
Requires-Dist: pre-commit==4.1.0; extra == 'dev'
|
|
25
23
|
Requires-Dist: pytest==8.3.5; extra == 'dev'
|
|
26
24
|
Requires-Dist: readthedocs-sphinx-search>=0.3.2; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff==0.11.5; extra == 'dev'
|
|
27
26
|
Requires-Dist: sphinx-gallery==0.19.0; extra == 'dev'
|
|
28
27
|
Requires-Dist: sphinx-rtd-theme==3.0.2; extra == 'dev'
|
|
29
28
|
Requires-Dist: sphinx==8.2.3; extra == 'dev'
|
|
@@ -32,6 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
32
31
|
|
|
33
32
|
# pyBADA
|
|
34
33
|
|
|
34
|
+
[](https://github.com/astral-sh/ruff)
|
|
35
35
|
<a href="https://github.com/eurocontrol-bada/pybada/blob/main/LICENCE.txt"><img alt="License: EUPL" src="https://img.shields.io/badge/license-EUPL-3785D1.svg"></a>
|
|
36
36
|
<a href="https://pypi.org/project/pyBADA"><img alt="Released on PyPi" src="https://img.shields.io/pypi/v/pyBADA.svg"></a>
|
|
37
37
|

|
|
@@ -54,7 +54,7 @@ Examples, the user manual and the API reference can be found at the [pyBADA docu
|
|
|
54
54
|
# Clone the repository
|
|
55
55
|
git clone https://github.com/eurocontrol-bada/pybada
|
|
56
56
|
|
|
57
|
-
#
|
|
57
|
+
# Set up a virtual env and activate it
|
|
58
58
|
python3 -m venv env
|
|
59
59
|
source env/bin/activate
|
|
60
60
|
|
|
@@ -62,9 +62,18 @@ source env/bin/activate
|
|
|
62
62
|
pip install .
|
|
63
63
|
# Install a couple of packages for formatting, linting and building the docs
|
|
64
64
|
pip install .[dev]
|
|
65
|
+
# Install pre-commit
|
|
66
|
+
pre-commit install
|
|
65
67
|
|
|
66
68
|
# Run unit tests
|
|
67
69
|
python3 -m pytest tests/
|
|
70
|
+
|
|
71
|
+
# Format code
|
|
72
|
+
ruff format
|
|
73
|
+
|
|
74
|
+
# Lint code
|
|
75
|
+
ruff check
|
|
76
|
+
|
|
68
77
|
# Build the docs
|
|
69
78
|
cd docs
|
|
70
79
|
make html
|
|
@@ -78,6 +87,6 @@ You won't receive support for it, but you can pass the flag `--ignore-requires-p
|
|
|
78
87
|
|
|
79
88
|
## License
|
|
80
89
|
|
|
81
|
-
BADA and pyBADA are developed and maintained by [EUROCONTROL](https://www.eurocontrol.int/).
|
|
90
|
+
BADA and pyBADA are developed and maintained by [EUROCONTROL](https://www.eurocontrol.int/model/bada).
|
|
82
91
|
|
|
83
92
|
This project is released under the European Union Public License v1.2 - see the [LICENSE](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12) file for details.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
pyBADA/TCL.py,sha256=
|
|
1
|
+
pyBADA/TCL.py,sha256=K6L_E0BchttNDWrAfDfuHWk3-ux7mvgeONpr2OkQNgw,373689
|
|
2
2
|
pyBADA/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
pyBADA/aircraft.py,sha256=
|
|
4
|
-
pyBADA/atmosphere.py,sha256=
|
|
5
|
-
pyBADA/bada3.py,sha256=
|
|
6
|
-
pyBADA/bada4.py,sha256=
|
|
7
|
-
pyBADA/badaH.py,sha256=
|
|
8
|
-
pyBADA/configuration.py,sha256=
|
|
9
|
-
pyBADA/constants.py,sha256=
|
|
10
|
-
pyBADA/conversions.py,sha256=
|
|
11
|
-
pyBADA/flightTrajectory.py,sha256=
|
|
12
|
-
pyBADA/geodesic.py,sha256=
|
|
13
|
-
pyBADA/magnetic.py,sha256=
|
|
14
|
-
pyBADA/trajectoryPrediction.py,sha256=
|
|
3
|
+
pyBADA/aircraft.py,sha256=VTXMyTm9Gw-EQpNTL9Q8-Mzp2wXE9S2mjJLHvSF-AZs,13009
|
|
4
|
+
pyBADA/atmosphere.py,sha256=audmiVJR1fdraeorWBpYqQTlFn_uZVRWcC9ex-Nr9Jw,11348
|
|
5
|
+
pyBADA/bada3.py,sha256=hpKX4abW16ocRe2RjOvE7Codo5ljWy6Wm3eXFvos8J4,186306
|
|
6
|
+
pyBADA/bada4.py,sha256=PjP26gEn45Ebajm4TR9FhKMUDQuIlBXOANSCjeS7NsY,222266
|
|
7
|
+
pyBADA/badaH.py,sha256=rF7gE5-tsemGDKwkUpiPazw5vdLpMkBNuXpI_22z0S8,153349
|
|
8
|
+
pyBADA/configuration.py,sha256=66OCBBYJhXF4quCHDK47YA9yOftuPdrbvbn88P-531E,6505
|
|
9
|
+
pyBADA/constants.py,sha256=zJhiLcG49Ab2i-c_mHNCmfLpecmQozvIOjX71aVB5KE,952
|
|
10
|
+
pyBADA/conversions.py,sha256=grIokt50KOTaINsmMDWyCJvMpt-_U3FgC9ZNg_aqC1g,3252
|
|
11
|
+
pyBADA/flightTrajectory.py,sha256=XEbohC3NGLaDymSLyqyzM9h3D6Tzns2iHLx9uGAMs-U,38483
|
|
12
|
+
pyBADA/geodesic.py,sha256=jTEphU_H9D10lgi1Pm77OSsT7icApniaNtSSVHTjZXo,30721
|
|
13
|
+
pyBADA/magnetic.py,sha256=O5Ki4ViSqvznl08gZRM90mBbkkpAMR6PR0hKc-FY8yg,4996
|
|
14
|
+
pyBADA/trajectoryPrediction.py,sha256=jC-FxEhD3C_hP5nRutZndYtrat14NIKMVG30Aiq0XJ4,6945
|
|
15
15
|
pyBADA/data/magneticDeclinationGridData.json,sha256=ffmLcxdDwFwJqV4WPyMM5SWt60tMj8xsLh5IHYkpO3U,5390918
|
|
16
16
|
pyBADA/aircraft/BADA3/DUMMY/BADA.GPF,sha256=1Am9yU8v9nnIpvJt-XhJRz4APOkRzfNPujKAy3UCYg0,9831
|
|
17
17
|
pyBADA/aircraft/BADA3/DUMMY/BZJT__.APF,sha256=wGyXK-ro1S6YhC4wp2nMQKi0JGYLvTunNjO6x_YbhW4,2523
|
|
@@ -90,8 +90,8 @@ pyBADA/aircraft/BADAH/DUMMY/DUMH/DUMH_ISA.PTF,sha256=aEthZF1xztp6QSHYEwU5tH4HF8x
|
|
|
90
90
|
pyBADA/aircraft/BADAH/DUMMY/DUMH/LRC.OPT,sha256=7WecIu4kfw5nM_ADih06Hb8pCoxLVsEdHHJTqQrx4hg,10123
|
|
91
91
|
pyBADA/aircraft/BADAH/DUMMY/DUMH/MEC.OPT,sha256=yKczjH6lZqTplmcV79tZLvwXmHM2F9bYoB2gIM8hBpg,10123
|
|
92
92
|
pyBADA/aircraft/BADAH/DUMMY/DUMH/MRC.OPT,sha256=fTGqt0P9xgt9Q4sKPlL0CZi9aj73prAPlXj1dpWHSOk,10123
|
|
93
|
-
pybada-0.1.
|
|
94
|
-
pybada-0.1.
|
|
95
|
-
pybada-0.1.
|
|
96
|
-
pybada-0.1.
|
|
97
|
-
pybada-0.1.
|
|
93
|
+
pybada-0.1.4.dist-info/METADATA,sha256=k2Cw0Hv96AneCh1db80ENgUDtwaVkva9yJzcwXrvtCg,3382
|
|
94
|
+
pybada-0.1.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
95
|
+
pybada-0.1.4.dist-info/licenses/AUTHORS,sha256=iCKpU7CHp2sB4u5hkS2WyMJHLzL0gfMm-bobd7QDmzE,108
|
|
96
|
+
pybada-0.1.4.dist-info/licenses/LICENCE.txt,sha256=RpvAZSjULHvoTR_esTlucJ08-zdQydnoqQLbqOh9Ub8,13826
|
|
97
|
+
pybada-0.1.4.dist-info/RECORD,,
|
|
File without changes
|