From eac1cf575fd4e3aae45b12b0652b2681a64c3f71 Mon Sep 17 00:00:00 2001 From: Fruittips Date: Mon, 27 Nov 2023 14:44:38 +0800 Subject: [PATCH] update aq_threshold --- lambda/lambda_function.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lambda/lambda_function.py b/lambda/lambda_function.py index c8f5e95..187f853 100644 --- a/lambda/lambda_function.py +++ b/lambda/lambda_function.py @@ -77,14 +77,14 @@ def lambda_handler(event, context): def get_fire_probability (temp, aq_arr , flame_presence, r_value): p_flame = flame_presence p_air = get_air_quality_probability(aq_arr) - p_temp = get_temp_proability(temp) + p_temp = get_temp_probability(temp) p_temp_hum = get_temp_humidity_probability(r_value) p_fire = 0.3 * p_flame + 0.3 * p_air + 0.2 * p_temp_hum + 0.2 * p_temp return p_fire def get_air_quality_probability(air_quality_arr): - air_quality_threshold = 500 # value fluctuates between 500 - 550 depending on environment + air_quality_threshold = 450 if (len(air_quality_arr) == 0): return 0 @@ -95,7 +95,7 @@ def get_air_quality_probability(air_quality_arr): else: return 0 -def get_temp_proability(temp): +def get_temp_probability(temp): temp_threshold = 40 # highest in sg: 37 + 3 = 40 deg (3 for threshold) if (temp > temp_threshold): return 1