WeatherForecastData
WeatherForecastData[loc]
gives the most recent forecast for all weather forecast properties for the specified location.
WeatherForecastData[prop]
gives the forecast for the specified property for the current location.
WeatherForecastData[date]
gives the forecast at the time or times specified by date for all properties at the current location.
WeatherForecastData[loc,prop]
gives the forecast for the property at the specified location.
WeatherForecastData[loc,prop,datespec]
gives the forecast at the time or times specified by datespec for the property at the location.
Details and Options
- WeatherForecastData gives weather forecast data worldwide.
- WeatherForecastData[] returns the most recent forecast for all forecast properties for the current location.
- WeatherForecastData[] makes use of $GeoLocation and $TimeZone to determine your location and time zone.
- The location can be specified as an ICAO code such as "KNYC", a WMO code such as "WMO12345", an amateur weather station code such as "C1234", or another standardized weather station identifier.
- The location can also be specified by latitude/longitude pairs, assuming degrees as units, a GeoPosition specification, or Entity objects, assuming they represent objects with geographic coordinates. They can also be GeoGraphics primitives such as GeoDisk, or a city specification of the type used in CityData.
- date should be specified as a DateObject or {start,end,step} where start and end are both a DateObject.
- datespec can be specified as a date list, a DateObject, or as a string in DateString format.
- WeatherForecastData takes datespec to be given by $TimeZone unless otherwise specified by a DateObject. Results are returned in UTC.
- When specific times are given, an interpolated result for that time is returned. datespec specifications for a day or longer period return the interval of property forecasts.
- datespec can be specified as {start,end,step} for compatibility with DateRange specifications. step can be All or "Day". All gives all forecast values. If omitted, step is assumed to have the value All.
- Location and date can also be specified together as Association["Location"->loc,"Date"datespec].
- WeatherForecastData[loc,prop,datespec,func] is used to specify the format of output when locations are specified.
- Possible settings for func include:
-
Automatic return intervals for extended locations and indeterminate times Interval return intervals for extended locations and times Max return maximum values for extended locations and times Mean return mean value for extended locations and times Min return minumum values for extended locations and times StandardDeviation return standard deviation for extended locations and times - Alternate argument structures supported include WeatherForecastData[loc,date], WeatherForecastData[prop,date], WeatherForecastData[date,prop], WeatherForecastData[loc,func], WeatherForecastData[loc,date,func], and WeatherForecastData[loc,prop,func].
- The option UnitSystem is available for controlling the units of the results. The following settings can be used:
-
"Imperial" return results in imperial units "Metric" return results in metric units - Data is only available for up to a week in the future.
- Instantaneous forecast properties:
-
"CloudCoverFraction" fraction of the sky obscured by cloud cover "Humidity" relative humidity "PrecipitationRate" average precipitation rate "Pressure" barometric pressure "StationPressure" pressure, uncorrected for elevation "Temperature" temperature "WindChill" wind chill temperature "WindDirection" wind direction in degrees "WindSpeed" wind gust speed - Properties aggregated over periods between forecast times include:
-
"PrecipitationAmount" precipitation amount "PrecipitationTypes" types of precipitation forecasted (hail, rain, snow) - Aggregate properties available for "Day" increments:
-
"MaxTemperature" maximum temperature "MaxWindSpeed" maximum wind speed "MeanHumidity" mean relative humidity "MeanPressure" mean pressure "MeanStationPressure" mean station pressure "MeanTemperature" mean temperature "MeanWindChill" mean wind chill temperature "MeanWindSpeed" mean wind speed "MinTemperature" minimum temperature "TotalPrecipitation" precipitation amount - WeatherForecastData is assembled from a variety of sources, including the Global Forecast System and the North American Mesoscale Forecast System.
Examples
open allclose allBasic Examples (1)
Scope (12)
Location Specification (5)
Examine the weather forecast for your current location:
Observe the current forecast for cloud coverage at the approximate coordinates of "KBOS":
Coordinates can be supplied for a location:
Entity objects can be used:
Obtain the appropriate Entity using free-form input ():
Find the maximum forecast temperatures across a geographic region:
Date Specification (4)
Dates can be input using DateObject:
Dates can also be specified in DateList format:
Date ranges in the format {start,end} will return all recorded data within that range:
Format Specification (1)
Find the high temperature forecasts for an extended location:
Obtain the maximum or minimum forecast highs:
Use the setting Mean to obtain the average high temperature:
Association Specification (1)
Date and location can be specified together using Association:
Options (2)
UnitSystem (2)
By default, results use the format given by $UnitSystem:
Set UnitSystem to "Imperial" to specify inches of Mercury:
Or set UnitSystem to "Metric" to specify millibars:
UnitConvert can also be used to adjust the units:
Applications (4)
Properties & Relations (4)
Calculate the low altitude pressures based on local forecasts and FormulaData:
Convert the result to millibars:
Use forecasts to calculate the density of air using ThermodynamicData:
Use IconData to display different forecast properties:
Use GeoGraphics and IconData to display the forecast high temperatures for today at a selection of cities within Germany:
Text
Wolfram Research (2016), WeatherForecastData, Wolfram Language function, https://reference.wolfram.com/language/ref/WeatherForecastData.html.
CMS
Wolfram Language. 2016. "WeatherForecastData." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/WeatherForecastData.html.
APA
Wolfram Language. (2016). WeatherForecastData. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WeatherForecastData.html