def _setup_aircraft(self,
                        ac_width: float = 2.22,
                        ac_length: float = 1.63,
                        ac_mass: float = 17,
                        ac_glide_ratio: float = 11,
                        ac_glide_speed: float = 21,
                        ac_glide_drag_coeff: float = 0.1,
                        ac_ballistic_drag_coeff: float = 0.8,
                        ac_ballistic_frontal_area: float = 0.5,
                        ac_failure_prob: float = 5e-3,
                        alt: float = 100,
                        vel: float = 31,
                        wind_vel: float = 5,
                        wind_dir: float = 45):
        self.aircraft = casex.AircraftSpecs(
            casex.enums.AircraftType.FIXED_WING, ac_width, ac_length, ac_mass)
        self.aircraft.set_ballistic_drag_coefficient(ac_ballistic_drag_coeff)
        self.aircraft.set_ballistic_frontal_area(ac_ballistic_frontal_area)
        self.aircraft.set_glide_speed_ratio(ac_glide_speed, ac_glide_ratio)
        self.aircraft.set_glide_drag_coefficient(ac_glide_drag_coeff)

        self.alt = alt
        self.vel = vel
        self.wind_vel = wind_vel
        self.wind_dir = np.deg2rad((wind_dir - 90) % 360)

        self.event_prob = ac_failure_prob
Esempio n. 2
0
    def __init__(self, key, colour: str = None, blocking=False, buffer_dist=0,
                 ac: dict = AIRCRAFT_LIST['Default'],
                 wind_vel: float = 0, wind_dir: float = 0):
        super().__init__(key, colour, blocking, buffer_dist)
        delattr(self, '_colour')

        self._layers = [
            TemporalPopulationEstimateLayer(f'_strike_risk_tpe_{key}', buffer_dist=buffer_dist),
            RoadsLayer(f'_strike_risk_roads_{key}', buffer_dist=buffer_dist)]

        self.aircraft = casex.AircraftSpecs(casex.enums.AircraftType.FIXED_WING, ac['width'], ac['length'], ac['mass'])
        self.aircraft.set_ballistic_drag_coefficient(ac['bal_drag_coeff'])
        self.aircraft.set_ballistic_frontal_area(ac['frontal_area'])
        self.aircraft.set_glide_speed_ratio(ac['glide_speed'], ac['glide_ratio'])
        self.aircraft.set_glide_drag_coefficient(ac['glide_drag_coeff'])

        self.alt = ac['cruise_alt']
        self.vel = ac['cruise_speed']
        self.wind_vel = wind_vel
        # !! This is the direction the wind is COMING FROM !! #
        self.wind_dir = np.deg2rad(
            (((wind_dir - 180) % 360) - 90) % 360
        )

        self.event_prob = ac['failure_prob']

        self.bm = BallisticModel(self.aircraft)
        self.gm = GlideDescentModel(self.aircraft)
Esempio n. 3
0
def _setup_default_aircraft(ac_width: float = 2,
                            ac_length: float = 1.5,
                            ac_mass: float = 7,
                            ac_glide_ratio: float = 12,
                            ac_glide_speed: float = 15,
                            ac_glide_drag_coeff: float = 0.1,
                            ac_ballistic_drag_coeff: float = 0.8,
                            ac_ballistic_frontal_area: float = 0.1):
    aircraft = casex.AircraftSpecs(casex.enums.AircraftType.FIXED_WING,
                                   ac_width, ac_length, ac_mass)
    aircraft.set_ballistic_drag_coefficient(ac_ballistic_drag_coeff)
    aircraft.set_ballistic_frontal_area(ac_ballistic_frontal_area)
    aircraft.set_glide_speed_ratio(ac_glide_speed, ac_glide_ratio)
    aircraft.set_glide_drag_coefficient(ac_glide_drag_coeff)

    return aircraft
Esempio n. 4
0
def _import_aircraft(aircraft):
    params = json.load(aircraft)
    basic_params = params['basic']
    ballistic_params = params['ballistic']
    gliding_params = params['glide']

    aircraft = casex.AircraftSpecs(casex.enums.AircraftType.FIXED_WING,
                                   basic_params['width'],
                                   basic_params['length'],
                                   basic_params['mass'])
    aircraft.set_ballistic_drag_coefficient(ballistic_params['drag_coeff'])
    aircraft.set_ballistic_frontal_area(ballistic_params['frontal_area'])
    aircraft.set_glide_speed_ratio(gliding_params['airspeed'],
                                   gliding_params['glide_ratio'])
    aircraft.set_glide_drag_coefficient(gliding_params['drag_coeff'])

    return aircraft
Esempio n. 5
0
    def __init__(self,
                 key,
                 colour: str = None,
                 blocking=False,
                 buffer_dist=0,
                 ac_width: float = 2,
                 ac_length: float = 2,
                 ac_mass: float = 2,
                 ac_glide_ratio: float = 12,
                 ac_glide_speed: float = 15,
                 ac_glide_drag_coeff: float = 0.1,
                 ac_ballistic_drag_coeff: float = 0.8,
                 ac_ballistic_frontal_area: float = 0.2,
                 ac_failure_prob: float = 5e-3,
                 alt: float = 120,
                 vel: float = 18,
                 wind_vel: float = 5,
                 wind_dir: float = 90):
        super().__init__(key, colour, blocking, buffer_dist)
        delattr(self, '_colour')

        self._layers = [
            TemporalPopulationEstimateLayer(f'_strike_risk_tpe_{key}',
                                            buffer_dist=buffer_dist),
            RoadsLayer(f'_strike_risk_roads_{key}', buffer_dist=buffer_dist)
        ]

        self.aircraft = casex.AircraftSpecs(
            casex.enums.AircraftType.FIXED_WING, ac_width, ac_length, ac_mass)
        self.aircraft.set_ballistic_drag_coefficient(ac_ballistic_drag_coeff)
        self.aircraft.set_ballistic_frontal_area(ac_ballistic_frontal_area)
        self.aircraft.set_glide_speed_ratio(ac_glide_speed, ac_glide_ratio)
        self.aircraft.set_glide_drag_coefficient(ac_glide_drag_coeff)

        self.alt = alt
        self.vel = vel
        self.wind_vel = wind_vel
        # !! This is the direction the wind is COMING FROM !! #
        self.wind_dir = np.deg2rad((((wind_dir - 180) % 360) - 90) % 360)

        self.event_prob = ac_failure_prob

        self.bm = BallisticModel(self.aircraft)
        self.gm = GlideDescentModel(self.aircraft)
    def __init__(self,
                 key: str,
                 filepath: str = '',
                 ac_width: float = 2,
                 ac_length: float = 2,
                 ac_mass: float = 2,
                 ac_glide_ratio: float = 12,
                 ac_glide_speed: float = 15,
                 ac_glide_drag_coeff: float = 0.8,
                 ac_ballistic_drag_coeff: float = 0.8,
                 ac_ballistic_frontal_area: float = 3,
                 ac_failure_prob: float = 0.05,
                 alt: float = 50,
                 vel: float = 18,
                 wind_vel: float = 5,
                 wind_dir: float = 45,
                 **kwargs):
        super(PathAnalysisLayer, self).__init__(key)
        self.filepath = filepath

        self.aircraft = casex.AircraftSpecs(
            casex.enums.AircraftType.FIXED_WING, ac_width, ac_length, ac_mass)
        self.aircraft.set_ballistic_drag_coefficient(ac_ballistic_drag_coeff)
        self.aircraft.set_ballistic_frontal_area(ac_ballistic_frontal_area)
        self.aircraft.set_glide_speed_ratio(ac_glide_speed, ac_glide_ratio)
        self.aircraft.set_glide_drag_coefficient(ac_glide_drag_coeff)

        self.alt = alt
        self.vel = vel
        self.wind_vel = wind_vel
        self.wind_dir = np.deg2rad((wind_dir - 90) % 360)

        self.event_prob = ac_failure_prob

        import geopandas as gpd
        self.dataframe = gpd.GeoDataFrame()
        self.buffer_poly = None