Class: WrfForecast::Threshold::WindThreshold

Inherits:
BaseThreshold show all
Defined in:
lib/wrf_forecast/threshold/wind_threshold.rb

Overview

This class determines the significant wind thresholds 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) and an additional catecory for medium strong wind:

  • windy day: the wind speed exceeds 9 m/s or 5 bft

  • squall day: the wind speed exceeds 14 m/s or 7 bft

  • storm squall day: the wind speed exceeds 24 m/s or 9 bft

  • storm day: the wind speed exceeds 28 m/s or 10 bft

  • hurricane day: the wind speed exceeds 33 m/s or 11 bft

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



32
33
34
35
36
37
38
39
40
41
# File 'lib/wrf_forecast/threshold/wind_threshold.rb', line 32

def determine_indicators(data_values)
  data_values.each { |value|
    change_indicator(:windy_day, true, value > 9.0)
    change_indicator(:squall_day, true, value > 14.0)
    change_indicator(:storm_squall_day, true, value > 24.0)
    change_indicator(:storm_day, true, value > 28.0)
    change_indicator(:hurricane_day, true, value > 33.0)
  }
  nil
end

#initialize_indicatorsObject (private)

initialization of the required indicators



21
22
23
24
25
26
27
28
# File 'lib/wrf_forecast/threshold/wind_threshold.rb', line 21

def initialize_indicators
  add_indicator(:windy_day, false, I18n.t("threshold.wind.windy_day"))
  add_indicator(:squall_day, false, I18n.t("threshold.wind.squall_day"))
  add_indicator(:storm_squall_day, false, I18n.t("threshold.wind.storm_squall_day"))
  add_indicator(:storm_day, false, I18n.t("threshold.wind.storm_day"))
  add_indicator(:hurricane_day, false, I18n.t("threshold.wind.hurricane_day"))
  nil
end