Method: Weatherb::API#nowcast

Defined in:
lib/weatherb/api.rb

#nowcast(lat:, lon:, unit_system: 'si', timestep: 1, start_time: 'now', end_time: nil, fields: DEFAULT_FIELDS | DEFAULT_NOWCAST_FIELDS) ⇒ Hash

Nowcast (<= 360min out) The nowcast call provides forecasting data on a minute-­by-­minute basis, based on ClimaCell’s proprietary sensing technology and models.

6 hours of nowcasting is available for the US. 3 hours of precipitation and 6 hours of non-precipitation data is provided for Japan and Western Europe.

Parameters:

  • lat (Float)

    Latitude, -87 to 89.

  • lon (Float)

    Longitude, -180 to 180.

  • unit_system (String) (defaults to: 'si')

    Unit system, “si” or “us”.

  • timestep (Integer) (defaults to: 1)

    Time step in minutes, 1-60.

  • start_time (String) (defaults to: 'now')

    Start time in ISO 8601 format “2019-03-20T14:09:50Z”, or “now”.

  • end_time (String) (defaults to: nil)

    End time in ISO 8601 format “2019-03-20T14:09:50Z”.

  • fields (Array<String>) (defaults to: DEFAULT_FIELDS | DEFAULT_NOWCAST_FIELDS)

    Selected fields from ClimaCell data layer (such as “precipitation” or “wind_gust”).

Returns:

  • (Hash)


125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/weatherb/api.rb', line 125

def nowcast(lat:, lon:, unit_system: 'si', timestep: 1, start_time: 'now', end_time: nil, fields: DEFAULT_FIELDS | DEFAULT_NOWCAST_FIELDS)
  path = 'weather/nowcast'

  query = {
    apikey: @api_key,
    lat: lat,
    lon: lon,
    unit_system: unit_system,
    timestep: timestep,
    start_time: start_time,
    end_time: end_time,
    fields: fields
  }

  response = @connection.get(path, query)
  response_body(response)
end