Class: WrfLibrary::Wrf::WeatherType

Inherits:
Object
  • Object
show all
Defined in:
lib/wrf_library/wrf/weather_type.rb

Overview

Simple mapping class to get the symbol for a given input parameter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWeatherType

initialization



9
10
11
# File 'lib/wrf_library/wrf/weather_type.rb', line 9

def initialize
  fill_mapping
end

Instance Attribute Details

#mappingHash (readonly)

Returns the mapping between input strings and the corresponding symbols.

Returns:

  • (Hash)

    the mapping between input strings and the corresponding symbols



14
15
16
# File 'lib/wrf_library/wrf/weather_type.rb', line 14

def mapping
  @mapping
end

Instance Method Details

#fill_mappingObject (private)



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/wrf_library/wrf/weather_type.rb', line 18

def fill_mapping
  @mapping = Hash.new()
  @mapping["2mt"] = :temperature         # 2 m temperature
  @mapping["slp"] = :sea_pressure        # surface pressure
  @mapping["uvs"] = :wind_speed          # wind speed
  @mapping["uvd"] = :wind_direction      # wind direction
  @mapping["skt"] = :skin_temperature    # skin temperature
  @mapping["sot"] = :soil_temoerature    # top soil level temperature
  @mapping["swr"] = :shortwave_radiation # shortwave radiation
  @mapping["lwr"] = :longwave_radiation  # longwave radiation
  @mapping["pcp"] = :precipitation       # precipitation
end