def __init__(self, initialWayPoint, finalWayPoint, aircraft):
        ''' init base class '''
        Graph.__init__(self)
        self.className = self.__class__.__name__
        self.climbRampAngleDegrees = 8.0

        assert (isinstance(initialWayPoint, WayPoint)) and (isinstance(
            finalWayPoint, WayPoint))

        self.initialWayPoint = initialWayPoint
        self.finalWayPoint = finalWayPoint

        assert (isinstance(aircraft, BadaAircraft))
        self.aircraft = aircraft
        ''' sanity checks '''
        ptlon1 = initialWayPoint.getLongitudeDegrees()
        assert (ptlon1 >= -180.) and (ptlon1 <= 180.)
        ''' sanity checks '''
        ptlat1 = initialWayPoint.getLatitudeDegrees()
        assert (ptlat1 >= -90.0) and (ptlat1 <= 90.)
        ''' sanity checks '''
        ptlon2 = finalWayPoint.getLongitudeDegrees()
        assert (ptlon2 >= -180.) and (ptlon2 <= 180.)
        ''' sanity checks '''
        ptlat2 = finalWayPoint.getLatitudeDegrees()
        assert (ptlat2 >= -90.0) and (ptlat2 <= 90.)

        self.ptlon1_radians = math.radians(ptlon1)
        self.ptlat1_radians = math.radians(ptlat1)
        self.ptlon2_radians = math.radians(ptlon2)
        self.ptlat2_radians = math.radians(ptlat2)
Exemplo n.º 2
0
    def __init__(self,
                 runway,
                 aircraft,
                 arrivalAirport,
                 descentGlideSlopeDegrees=3.0):
        '''
        arrival Airport provides the field elevation above sea level in meters
        '''
        self.className = self.__class__.__name__
        Graph.__init__(self)

        assert isinstance(descentGlideSlopeDegrees, float)
        self.descentGlideSlopeDegrees = descentGlideSlopeDegrees

        # sanity check
        assert isinstance(arrivalAirport, Airport)
        self.arrivalAirport = arrivalAirport
        ''' sanity check RunWay '''
        assert isinstance(runway, RunWay)
        self.runway = runway

        assert isinstance(aircraft, BadaAircraft)
        self.aircraft = aircraft

        fieldElevationAboveSeaLevelMeters = arrivalAirport.getFieldElevationAboveSeaLevelMeters(
        )
        print(self.className +
              ': airport field Elevation Above Sea Level= {0:.2f} meters'.
              format(fieldElevationAboveSeaLevelMeters))

        strName = arrivalAirport.getName(
        ) + '-' + 'RunWay' + '-' + self.runway.getName()
        self.runWayEndPoint = WayPoint(
            Name=strName,
            LatitudeDegrees=runway.getLatitudeDegrees(),
            LongitudeDegrees=runway.getLongitudeDegrees(),
            AltitudeMeanSeaLevelMeters=fieldElevationAboveSeaLevelMeters)
        ''' touch down is provided from BADA Ground Movement Landing Length '''
        landingDistanceMeters = self.aircraft.groundMovement.getLandingLengthMeters(
        )
        #print self.className + ': {0} aircraft landing length: {1:.2F} meters'.format(self.aircraft.ICAOcode, landingDistanceMeters)
        runWayOrientationDegrees = self.runway.getTrueHeadingDegrees()
        ''' if orientation is 270 degrees from runway end point then ... touch down bearing is 360-270=90 bearing from end point '''
        self.runWayTouchDownPoint = self.runWayEndPoint.getWayPointAtDistanceBearing(
            Name='runway-touch-down',
            DistanceMeters=landingDistanceMeters,
            BearingDegrees=runWayOrientationDegrees)
        ''' elevation of touch down point = field elevation'''
        self.runWayTouchDownPoint.setAltitudeMeanSeaLevelMeters(
            fieldElevationAboveSeaLevelMeters)
        strMsg = "{0} - distance from RunWay - TouchDown to RunWay - End= {1:.2f} meters".format(
            self.className,
            self.runWayTouchDownPoint.getDistanceMetersTo(self.runWayEndPoint))
        print(strMsg)

        self.bearingDegrees = self.runWayTouchDownPoint.getBearingDegreesTo(
            self.runWayEndPoint)
        print(self.className +
              ": bearing from touch-down to runway end= {0:.2f} degrees".
              format(self.bearingDegrees))
    def __init__(self, 
                 runway, 
                 aircraft, 
                 arrivalAirport , 
                 descentGlideSlopeDegrees = 3.0):
        '''
        arrival Airport provides the field elevation above sea level in meters
        '''
        self.className = self.__class__.__name__
        Graph.__init__(self)
        
        assert isinstance(descentGlideSlopeDegrees, float)
        self.descentGlideSlopeDegrees = descentGlideSlopeDegrees
        
        # sanity check 
        assert isinstance(arrivalAirport, Airport)
        self.arrivalAirport = arrivalAirport

        ''' sanity check RunWay '''
        assert isinstance(runway, RunWay)
        self.runway = runway
            
        assert isinstance(aircraft, BadaAircraft)
        self.aircraft = aircraft
        
        fieldElevationAboveSeaLevelMeters = arrivalAirport.getFieldElevationAboveSeaLevelMeters()
        print self.className + ': airport field Elevation Above Sea Level= {0:.2f} meters'.format(fieldElevationAboveSeaLevelMeters)

        strName = arrivalAirport.getName() + '-' + 'RunWay'+'-'+self.runway.getName()
        self.runWayEndPoint = WayPoint (Name=strName, 
                                            LatitudeDegrees=runway.getLatitudeDegrees(),
                                            LongitudeDegrees=runway.getLongitudeDegrees(),
                                            AltitudeMeanSeaLevelMeters=fieldElevationAboveSeaLevelMeters)
 
        ''' touch down is provided from BADA Ground Movement Landing Length '''
        landingDistanceMeters = self.aircraft.groundMovement.getLandingLengthMeters()
        #print self.className + ': {0} aircraft landing length: {1:.2F} meters'.format(self.aircraft.ICAOcode, landingDistanceMeters)
        runWayOrientationDegrees = self.runway.getTrueHeadingDegrees()
        ''' if orientation is 270 degrees from runway end point then ... touch down bearing is 360-270=90 bearing from end point '''
        self.runWayTouchDownPoint = self.runWayEndPoint.getWayPointAtDistanceBearing(Name='runway-touch-down',
                                                                          DistanceMeters=landingDistanceMeters,
                                                                          BearingDegrees=runWayOrientationDegrees )
        
        ''' elevation of touch down point = field elevation'''
        self.runWayTouchDownPoint.setAltitudeMeanSeaLevelMeters(fieldElevationAboveSeaLevelMeters)
        strMsg = self.className + ": distance from RunWay - TouchDown to RunWay - End= "
        strMsg += str(self.runWayTouchDownPoint.getDistanceMetersTo(self.runWayEndPoint)) + " meters"
        print strMsg
        
        self.bearingDegrees = self.runWayTouchDownPoint.getBearingDegreesTo(self.runWayEndPoint)
        print self.className + ": bearing from touch-down to runway end= {0:.2f} degrees".format(self.bearingDegrees)
Exemplo n.º 4
0
    def __init__(self, runway, aircraft, airport):
        ''' base class init '''
        Graph.__init__(self)
        self.className = self.__class__.__name__

        assert (isinstance(runway, RunWay) and not (runway is None))
        self.runway = runway
        print(self.className + ': ground run - run-way true heading= ' +
              str(self.runway.getTrueHeadingDegrees()) + ' degrees')

        assert (isinstance(aircraft, BadaAircraft) and not (aircraft is None))
        self.aircraft = aircraft

        assert (isinstance(airport, Airport) and not (airport is None))
        self.airport = airport
 def __init__(self,
              runway,
              aircraft,
              airport):
         
     ''' base class init '''
     Graph.__init__(self)
     self.className = self.__class__.__name__
     
     assert (isinstance(runway, RunWay) and not(runway is None))
     self.runway = runway
     print self.className + ': ground run - run-way true heading= ' + str(self.runway.getTrueHeadingDegrees()) + ' degrees'
     
     assert (isinstance(aircraft, BadaAircraft) and not(aircraft is None))
     self.aircraft = aircraft
     
     assert (isinstance(airport, Airport)  and not(airport is None))
     self.airport = airport
    def __init__(self, 
                 initialWayPoint,   
                 finalWayPoint, 
                 aircraft):
                
        ''' init base class '''
        Graph.__init__(self)
        self.className = self.__class__.__name__
        self.climbRampAngleDegrees = 8.0
                
        assert (isinstance(initialWayPoint, WayPoint)) and (isinstance(finalWayPoint, WayPoint))
        
        self.initialWayPoint = initialWayPoint
        self.finalWayPoint = finalWayPoint
        
        assert (isinstance(aircraft, BadaAircraft))
        self.aircraft = aircraft
        
        ''' sanity checks '''
        ptlon1 = initialWayPoint.getLongitudeDegrees()
        assert (ptlon1 >= -180.) and (ptlon1 <= 180.)
        
        ''' sanity checks '''
        ptlat1 = initialWayPoint.getLatitudeDegrees()
        assert (ptlat1 >= -90.0) and (ptlat1 <= 90.)
        
        ''' sanity checks '''
        ptlon2 = finalWayPoint.getLongitudeDegrees()
        assert  (ptlon2 >= -180.) and (ptlon2 <= 180.)
        
        ''' sanity checks '''
        ptlat2 = finalWayPoint.getLatitudeDegrees()
        assert (ptlat2 >= -90.0) and (ptlat2 <= 90.)

        self.ptlon1_radians = math.radians(ptlon1)
        self.ptlat1_radians = math.radians(ptlat1)
        self.ptlon2_radians = math.radians(ptlon2)
        self.ptlat2_radians = math.radians(ptlat2)
Exemplo n.º 7
0
    def __init__(self,
                 initialWayPoint=None,
                 runway=None,
                 aircraft=None,
                 departureAirport=None):
        ''' base class init '''
        Graph.__init__(self)

        self.className = self.__class__.__name__

        assert isinstance(initialWayPoint, WayPoint)
        self.initialWayPoint = initialWayPoint

        assert isinstance(runway, RunWay) and (not (runway is None))
        self.runway = runway

        assert not (departureAirport is None)
        assert isinstance(departureAirport, Airport)
        self.departureAirport = departureAirport

        assert isinstance(aircraft, BadaAircraft)
        self.aircraft = aircraft
        ''' everything is OKay to start '''
    def __init__(self,
                 initialWayPoint = None,
                 runway = None, 
                 aircraft = None, 
                 departureAirport = None):
        
        ''' base class init '''
        Graph.__init__(self)

        self.className = self.__class__.__name__
        
        assert isinstance(initialWayPoint, WayPoint)
        self.initialWayPoint = initialWayPoint
        
        assert isinstance(runway , RunWay) and (not(runway is None))
        self.runway = runway

        assert not(departureAirport is None)
        assert isinstance(departureAirport, Airport)
        self.departureAirport = departureAirport
        
        assert isinstance(aircraft, BadaAircraft)
        self.aircraft = aircraft
        ''' everything is OKay to start '''
Exemplo n.º 9
0
    def __init__(self,
                 initialWayPoint,
                 finalWayPoint,
                 initialHeadingDegrees,
                 aircraft,
                 reverse=False):
        '''
        initial way point is the end of the previous great circle
        initial Heading is the last heading of the previous great circle
        final way point is the next fix
        '''

        Graph.__init__(self)
        self.className = self.__class__.__name__
        ''' link between time step of one second and 3 degrees per second turn rate '''
        ''' 3 degrees per second * 120 seconds = 360 degrees in 2 minutes '''
        self.BaseStepDegrees = 3.0

        assert (reverse == True) or (reverse == False)
        self.reverse = reverse
        ''' sanity check initialWayPoint ''' '''''' ''
        assert (isinstance(initialWayPoint, WayPoint))
        self.initialWayPoint = initialWayPoint
        ''' sanity check finalWayPoint ''' '''''' ''
        assert (isinstance(finalWayPoint, WayPoint))
        self.finalWayPoint = finalWayPoint
        ''' sanity check initialHeadingDegrees ''' '''''' ''
        assert isinstance(initialHeadingDegrees, float)
        assert (initialHeadingDegrees >= 0.0)
        assert (initialHeadingDegrees <= 360.0)
        self.initialHeadingDegrees = initialHeadingDegrees
        ''' sanity check final Heading Degrees '''
        if reverse == True:
            ''' build a turn backwards from last glide slope point to last fix '''
            ''' initial is first glide slope point and final is the last fix of the route '''
            self.finalHeadingDegrees = self.finalWayPoint.getBearingDegreesTo(
                self.initialWayPoint)
            self.finalHeadingDegrees = math.fmod(
                self.finalHeadingDegrees + 180.0, 360.0)
        else:
            self.finalHeadingDegrees = initialWayPoint.getBearingDegreesTo(
                finalWayPoint)
        ''' sanity checks '''
        assert (self.finalHeadingDegrees >= 0.0)
        assert (self.finalHeadingDegrees <= 360.0)
        ''' sanity check aircraft ''' '''''' ''
        assert (isinstance(aircraft, BadaAircraft))
        self.aircraft = aircraft
        ''' compute angle difference '''
        # print self.className + ': turn from= {0:.2f} degrees to {1:.2f} degrees'.format(self.initialHeadingDegrees, self.finalHeadingDegrees)
        ''' default value - for turn angle steps '''
        self.stepDegrees = self.BaseStepDegrees  # degrees
        ''' turn clock wise or anti clock wise '''
        initialAngleRadians = math.radians(self.initialHeadingDegrees)
        finalAngleRadians = math.radians(self.finalHeadingDegrees)
        angleDifferenceDegrees = math.degrees(
            math.atan2(math.sin(finalAngleRadians - initialAngleRadians),
                       math.cos(finalAngleRadians - initialAngleRadians)))
        if (angleDifferenceDegrees < 0.0):
            self.stepDegrees = -self.BaseStepDegrees
        else:
            self.stepDegrees = +self.BaseStepDegrees

        strMsg = ': turn from= {0:.2f} degrees '.format(
            self.initialHeadingDegrees)
        strMsg += ' to {0:.2f} degrees'.format(self.finalHeadingDegrees)
        strMsg += ' - turn step is= {0:.2f} degrees'.format(self.stepDegrees)

        print(self.className + strMsg)
        self.previousDistanceToArrivalAxisMeters = 0.0
    def __init__(self, 
                 initialWayPoint, 
                 finalWayPoint,
                 initialHeadingDegrees, 
                 aircraft,
                 reverse=False):
        '''
        initial way point is the end of the previous great circle
        initial Heading is the last heading of the previous great circle
        final way point is the next fix
        '''
        
        Graph.__init__(self)
        self.className = self.__class__.__name__
        
        ''' link between time step of one second and 3 degrees per second turn rate '''
        ''' 3 degrees per second * 120 seconds = 360 degrees in 2 minutes '''
        self.BaseStepDegrees = 3.0
        
        assert (reverse == True) or (reverse == False)
        self.reverse = reverse
                
        ''' sanity check initialWayPoint '''''''''''
        assert (isinstance(initialWayPoint, WayPoint))
        self.initialWayPoint = initialWayPoint

        ''' sanity check finalWayPoint '''''''''''
        assert (isinstance(finalWayPoint, WayPoint))
        self.finalWayPoint = finalWayPoint

        ''' sanity check initialHeadingDegrees '''''''''''
        assert isinstance(initialHeadingDegrees, float)
        assert (initialHeadingDegrees >= 0.0)
        assert (initialHeadingDegrees <= 360.0)
        self.initialHeadingDegrees = initialHeadingDegrees
        
        ''' sanity check final Heading Degrees '''
        if reverse == True:
            ''' build a turn backwards from last glide slope point to last fix ''' 
            ''' initial is first glide slope point and final is the last fix of the route '''
            self.finalHeadingDegrees = self.finalWayPoint.getBearingDegreesTo(self.initialWayPoint)
            self.finalHeadingDegrees = math.fmod ( self.finalHeadingDegrees + 180.0 , 360.0 )
        else:
            self.finalHeadingDegrees = initialWayPoint.getBearingDegreesTo(finalWayPoint)
            
        ''' sanity checks '''
        assert (self.finalHeadingDegrees >= 0.0) 
        assert (self.finalHeadingDegrees <= 360.0)
        
        ''' sanity check aircraft '''''''''''
        assert (isinstance(aircraft, BadaAircraft))
        self.aircraft = aircraft
                
        ''' compute angle difference '''
        #print self.className + ': turn from= {0:.2f} degrees to {1:.2f} degrees'.format(self.initialHeadingDegrees, self.finalHeadingDegrees)
        
        ''' default value - for turn angle steps '''
        self.stepDegrees = self.BaseStepDegrees # degrees

        ''' turn clock wise or anti clock wise '''
        initialAngleRadians = math.radians(self.initialHeadingDegrees)
        finalAngleRadians = math.radians(self.finalHeadingDegrees)
        angleDifferenceDegrees = math.degrees(math.atan2(math.sin(finalAngleRadians-initialAngleRadians), math.cos(finalAngleRadians-initialAngleRadians)))
        if (angleDifferenceDegrees < 0.0):
            self.stepDegrees = - self.BaseStepDegrees
        else:
            self.stepDegrees = + self.BaseStepDegrees
        
        strMsg = ': turn from= {0:.2f} degrees '.format(self.initialHeadingDegrees)
        strMsg += ' to {0:.2f} degrees'.format(self.finalHeadingDegrees)
        strMsg += ' - turn step is= {0:.2f} degrees'.format(self.stepDegrees) 
                                                
        print self.className + strMsg
        self.previousDistanceToArrivalAxisMeters = 0.0