Class: WrfLibrary::JsonConverter::HourlyMeanJsonConverter

Inherits:
HourlyJsonConverter show all
Defined in:
lib/wrf_library/json_converter/hourly_mean_converter.rb

Overview

Child class to generate valid json output for the result data of a given wrf meteogram result already stored in a data repository

Instance Attribute Summary

Attributes inherited from HourlyJsonConverter

#handler, #measurand

Attributes inherited from BaseStationJsonConverter

#data

Instance Method Summary collapse

Methods inherited from HourlyJsonConverter

#initialize

Methods inherited from WrfStationJsonConverter

#add_additions, #generate_grid_coordinates, #generate_grid_data

Methods inherited from BaseStationJsonConverter

#add_additions, #convert, #generate_meta_hash, #generate_station_hash, #initialize

Constructor Details

This class inherits a constructor from WrfLibrary::JsonConverter::HourlyJsonConverter

Instance Method Details

#generate_data_valuesHash (private)

implementation of the abstract parent method to create valid json objects for the stored data values

Returns:

  • (Hash)

    the key-value hashes for the json output



16
17
18
19
20
21
22
23
24
# File 'lib/wrf_library/json_converter/hourly_mean_converter.rb', line 16

def generate_data_values
  if (@measurand == :wind_speed)
    {"wind_speed" => 
      WrfLibrary::Statistic::Hourly.calculate_hourly_windspeed_means(@handler) }
  else
    {@measurand.to_s.tr("@", "") => 
      WrfLibrary::Statistic::Hourly.calculate_hourly_means(@measurand, @handler) }
  end
end