def decode_wind(s)

      if s =~ /(\d{3})(\d{2})G?(\d{2})?(KT|MPS|KMH)/
        # different units
        wind = case $4
                 when "KT" then
                   $2.to_f * KNOTS_TO_METERS_PER_SECOND
                 when "MPS" then
                   $2.to_f
                 when "KMH" then
                   $2.to_f * KILOMETERS_PER_HOUR_TO_METERS_PER_SECOND
                 else
                   nil
               end

        wind_max = case $4
                     when "KT" then
                       $3.to_f * KNOTS_TO_METERS_PER_SECOND
                     when "MPS" then
                       $3.to_f
                     when "KMH" then
                       $3.to_f * KILOMETERS_PER_HOUR_TO_METERS_PER_SECOND
                     else
                       nil
                   end

        # wind_max is not less than normal wind
        if wind_max < wind or wind_max.nil?
          wind_max = wind
        end

        @winds << {
          :wind => wind,
          :wind_max => wind_max,
          :wind_direction => $1.to_i
        }
      end

      # variable/unknown direction
      if s =~ /VRB(\d{2})(KT|MPS|KMH)/
        wind = case $2
                 when "KT" then
                   $1.to_f * KNOTS_TO_METERS_PER_SECOND
                 when "MPS" then
                   $1.to_f
                 when "KMH" then
                   $1.to_f * KILOMETERS_PER_HOUR_TO_METERS_PER_SECOND
                 else
                   nil
               end

        @winds << {
          :wind => wind
        }

      end
    end
def decode_wind(s)

      if s =~ /(\d{3})(\d{2})G?(\d{2})?(KT|MPS|KMH)/
        # different units
        wind = case $4
                 when "KT" then
                   $2.to_f * KNOTS_TO_METERS_PER_SECOND
                 when "MPS" then
                   $2.to_f
                 when "KMH" then
                   $2.to_f * KILOMETERS_PER_HOUR_TO_METERS_PER_SECOND
                 else
                   nil
               end

        wind_max = case $4
                     when "KT" then
                       $3.to_f * KNOTS_TO_METERS_PER_SECOND
                     when "MPS" then
                       $3.to_f
                     when "KMH" then
                       $3.to_f * KILOMETERS_PER_HOUR_TO_METERS_PER_SECOND
                     else
                       nil
                   end

        # wind_max is not less than normal wind
        if wind_max < wind or wind_max.nil?
          wind_max = wind
        end

        @winds << {
          :wind => wind,
          :wind_max => wind_max,
          :wind_direction => $1.to_i
        }
      end

      # variable/unknown direction
      if s =~ /VRB(\d{2})(KT|MPS|KMH)/
        wind = case $2
                 when "KT" then
                   $1.to_f * KNOTS_TO_METERS_PER_SECOND
                 when "MPS" then
                   $1.to_f
                 when "KMH" then
                   $1.to_f * KILOMETERS_PER_HOUR_TO_METERS_PER_SECOND
                 else
                   nil
               end

        @winds << {
          :wind => wind
        }

      end
    end
Wind parameters in meters per second