Skip to main content

DYNAMIC fire risk computational model

Project description

DYNAMIC Fire risk indicator implementation

This repository contains the implementation of the dynamic fire risk indicator is based upon the research paper:

R.D. Strand and L.M. Kristensen: An implementation, evaluation and validation of a dynamic fire and conflagration risk indicator for wooden homes. In volume 238 of Procedia Computer Science, pp. 49-56, 2024. Proceedings of the 15th International Conference on Ambient Systems, Networks and Technologies Networks (ANT). Online: https://www.sciencedirect.com/science/article/pii/S187705092401233X

The fire risk indicator uses forecast and weather data observation for computing fire risk indication in the form of time-to-flash-over (ttf) for wooden houses.

Weather Data Sources

The implementation has been designed to be independent of any particular cloud-based weather data service.

This library contains an implementation that use the weather data services provided by the Norwegian Meteorological Institute (MET):

To use these pre-implemented clients a file name .env must be place in your project folder having the following content:

MET_CLIENT_ID = '<INSERT CLIENT ID HERE>'
MET_CLIENT_SECRET = '<INSERT CLIENT SECRET HERE>'

Credentials for using the MET APIs can be obtained via: https://frost.met.no/auth/requestCredentials.html

Please make sure that you conform to the terms of service which includes restrictions on the number of API calls.

Example usage

The following example shows how to use the FireRiskPrediction class to compute fire risks for a given location:

import datetime

from frcm.frcapi import METFireRiskAPI
from frcm.datamodel.model import Location

# sample code illustrating how to use the Fire Risk Computation API (FRCAPI)
if __name__ == "__main__":

    frc = METFireRiskAPI()

    location = Location(latitude=60.383, longitude=5.3327)  # Bergen
    # location = Location(latitude=59.4225, longitude=5.2480)  # Haugesund

    # days into the past to retrieve observed weather data
    obs_delta = datetime.timedelta(days=2)

    wd = frc.get_weatherdata_now(location, obs_delta)
    print (wd)

    predictions = frc.compute_now(location, obs_delta)

    print(predictions)

and should result in an output similar to what is listed below showing hourly computed fire risks for the given location.

FireRiskPrediction[latitude=60.383 longitude=5.3327]
FireRisks[2025-01-20 00:00:00+00:00 TTF(6.072481167177002) WindSpeed(3.1)]
FireRisks[2025-01-20 01:00:00+00:00 TTF(5.99332738001279) WindSpeed(2.4)]
FireRisks[2025-01-20 02:00:00+00:00 TTF(5.967689363087894) WindSpeed(2.7)]
FireRisks[2025-01-20 03:00:00+00:00 TTF(5.9478787329422635) WindSpeed(2.1)]
FireRisks[2025-01-20 04:00:00+00:00 TTF(5.928838874113078) WindSpeed(2.8)]
FireRisks[2025-01-20 05:00:00+00:00 TTF(5.912460820817552) WindSpeed(3.4)]

[ ... ]

FireRisks[2025-01-31 23:00:00+00:00 TTF(6.273135517647007) WindSpeed(4.566666666666666)]
FireRisks[2025-02-01 00:00:00+00:00 TTF(6.290499308219714) WindSpeed(4.6)]
FireRisks[2025-02-01 01:00:00+00:00 TTF(6.303115875685305) WindSpeed(4.533333333333333)]
FireRisks[2025-02-01 02:00:00+00:00 TTF(6.30566616713959) WindSpeed(4.466666666666667)]
FireRisks[2025-02-01 03:00:00+00:00 TTF(6.301802227245228) WindSpeed(4.3999999999999995)]
FireRisks[2025-02-01 04:00:00+00:00 TTF(6.2932319226402) WindSpeed(4.333333333333333)]
FireRisks[2025-02-01 05:00:00+00:00 TTF(6.281008572496977) WindSpeed(4.266666666666667)]
FireRisks[2025-02-01 06:00:00+00:00 TTF(6.265861044817225) WindSpeed(4.2)]

API and implementation

The following methods are the main services currently being provided by the API:

  • get_weatherdata_now(location: Location, obs_delta: datetime.timedelta) -> WeatherData - which provided with a location and a weather data observation time delta fetches weather data observations obs_delta into the past and concatenates this with the weather data from the current weather forecast for the location.
  • compute(wd: WeatherData) -> FireRiskPrediction - which computes a fire risk predication based on the provided weather data.
  • compute_now(location: Location, obs_delta: datetime.timedelta) -> FireRiskPrediction - which computes a fire risk predication for the current point in time using weather data observations obs_delta into the past.

The source code for the library is available at via the Download files and is organised into the following main folders:

  • datamodel - contains an implementation of the data model used for weather data and fire risk indications
  • weatherdata contains an client implementations and interfaces for fetching weather data from cloud services.
  • fireriskmodel contains an implementation of the underlying fire risk model T The main API for the implementation is in the file frcapi.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dynamic_frcm-1.0.1.tar.gz (32.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dynamic_frcm-1.0.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file dynamic_frcm-1.0.1.tar.gz.

File metadata

  • Download URL: dynamic_frcm-1.0.1.tar.gz
  • Upload date:
  • Size: 32.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0

File hashes

Hashes for dynamic_frcm-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e2780339446c9cb3a42a1cd746836402b8c9cad4da8e07cee73396226f274092
MD5 2cfcbf30679aaab02b4d0cb1552c576f
BLAKE2b-256 e93b64fef1185d70ec19e2a23f26e9656634bb707c71883de599e8aa711ae8cc

See more details on using hashes here.

File details

Details for the file dynamic_frcm-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dynamic_frcm-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.2.0

File hashes

Hashes for dynamic_frcm-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9725df4ffddd558db3742ccf5f598d64ddbfc2b2fc9a8fa98c19cba7a855ce5b
MD5 d2fe86f2ec2d7009363333076059c69f
BLAKE2b-256 bcf575cadab0b83305609fbd3619478e446ba753a7cc5aa04ba9775034026996

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page