Class: WrfForecast::Threshold::ApparentTemperatureThreshold

Inherits:
BaseThreshold
  • Object
show all
Defined in:
lib/wrf_forecast/threshold/apparent_temperature_threshold.rb

Overview

This class determines the significant temperature thresholds of the apparent temperature for a forecast day. That means that this class can only work correctly if the data represents a time span of up to 24 hours. The indicators and thresholds are based on the climate indicators of the german (weatherservice)[https://www.dwd.de/DE/wetter/warnungen_aktuell/kriterien/warnkriterien.html]:

  • strong heat day: the apparent temperature of the day exceeds 32.0 degrees celsius
  • extreme heat day: the apparent temperature of the day exceeds 38.0 degrees celsius

Instance Attribute Summary

Attributes inherited from BaseThreshold

#indicators

Instance Method Summary collapse

Methods inherited from BaseThreshold

#add_indicator, #change_indicator, #check_data_values, #initialize

Constructor Details

This class inherits a constructor from WrfForecast::Threshold::BaseThreshold

Instance Method Details

#determine_indicators(data_values) ⇒ Object (private)

method to determine the indicators based on the input data

Parameters:

  • data_values (Array)

    the input values



26
27
28
29
30
31
32
# File 'lib/wrf_forecast/threshold/apparent_temperature_threshold.rb', line 26

def determine_indicators(data_values)
  data_values.each { |value|
    change_indicator(:strong_heat_day, true, value > 32.0)
    change_indicator(:extreme_heat_day, true, value > 38.0)
  }
  nil
end

#initialize_indicatorsObject (private)

initialization of the required indicators



18
19
20
21
22
# File 'lib/wrf_forecast/threshold/apparent_temperature_threshold.rb', line 18

def initialize_indicators
  add_indicator(:strong_heat_day, false, I18n.t("threshold.apparent_temperature.strong_heat_day"))
  add_indicator(:extreme_heat_day, false, I18n.t("threshold.apparent_temperature.extreme_heat_day"))
  nil
end