|
| 1 | +""" |
| 2 | +Define BushFire class. |
| 3 | +""" |
| 4 | + |
| 5 | +__all__ = ['BushFire'] |
| 6 | + |
| 7 | +import logging |
| 8 | +import numpy as np |
| 9 | +from scipy import sparse |
| 10 | + |
| 11 | +from climada.hazard.base import Hazard |
| 12 | +from climada.hazard.tag import Tag as TagHazard |
| 13 | + |
| 14 | +LOGGER = logging.getLogger(__name__) |
| 15 | + |
| 16 | +HAZ_TYPE = 'BF' |
| 17 | +""" Hazard type acronym for Bush Fire """ |
| 18 | + |
| 19 | +class BushFire(Hazard): |
| 20 | + """Contains bush fire events. |
| 21 | +
|
| 22 | + Attributes: |
| 23 | + """ |
| 24 | + |
| 25 | + def __init__(self): |
| 26 | + """Empty constructor. """ |
| 27 | + Hazard.__init__(self, HAZ_TYPE) |
| 28 | + |
| 29 | + def read_firms_csv(self, firms, centroids, description=''): |
| 30 | + """Read historical bush fires.""" |
| 31 | + |
| 32 | + # distinguish one event in file |
| 33 | + |
| 34 | + # cut by centroids range |
| 35 | + sel_lines = np.zeros(()) |
| 36 | + for event_lines in sel_lines: |
| 37 | + bf_haz = self._one_firms_csv(centroids) |
| 38 | + self.append(bf_haz) |
| 39 | + |
| 40 | +# self.tag.description = description |
| 41 | + raise NotImplementedError |
| 42 | + |
| 43 | + @staticmethod |
| 44 | + def _one_firms_csv(centroids): |
| 45 | + |
| 46 | + bf_haz = BushFire() |
| 47 | + |
| 48 | + # FILL these values |
| 49 | +# bf_haz.tag = |
| 50 | +# bf_haz.units = |
| 51 | +# # following values are defined for each event |
| 52 | +# bf_haz.centroids = centroids |
| 53 | +# bf_haz.event_id = np.array([], int) |
| 54 | +# bf_haz.frequency = np.array([]) |
| 55 | +# bf_haz.event_name = list() |
| 56 | +# bf_haz.date = np.array([], int) |
| 57 | +# bf_haz.orig = np.array([], bool) |
| 58 | +# # following values are defined for each event and centroid |
| 59 | +# bf_haz.intensity = sparse.lil_matrix((1, centroids.id.size)) |
| 60 | +# bf_haz.fraction = sparse.lil_matrix((1, centroids.id.size)) |
| 61 | + |
| 62 | + return bf_haz |
| 63 | + |
| 64 | + def calc_probabilistic(self, n_ens): |
| 65 | + """ For every event, compute n_ens probabilistic events.""" |
| 66 | + raise NotImplementedError |
0 commit comments