An overview of how to work with accumulated data values such as total precipitation.
Certain data variables returned by the Spire Weather API represent forecast-total accumulated values since the start of the forecast, rather than fixed-interval accumulations (e.g., 6-hour or 24-hour values).
Examples of Accumulated Variables¶
basic bundle
Total precipitation (
precipitation_amount)
precipitation bundle
Snowfall amount (
snowfall_amount)
solar-energy bundle (all five radiation fields)
Surface net downward shortwave flux (
surface_net_downward_shortwave_flux)Surface net downward longwave flux (
surface_net_downward_longwave_flux)Surface net upward shortwave flux (
surface_net_upward_shortwave_flux)Surface net upward longwave flux (
surface_net_upward_longwave_flux)Net upward longwave flux at top of atmosphere (
net_upward_longwave_flux_at_top_of_atmosphere)
In GRIB2 files these fields carry a stepRange such as 0-6, marking the accumulation window from the start of the forecast to the lead time.
Interpreting the Data¶
Without post-processing, values from an accumulated variable only increase over the forecast time range, since they accumulate from the beginning of the forecast window.
With simple post-processing, you can compute the difference between each value and the preceding one. This yields the accumulation for each interval (e.g., 6-hour precipitation amounts).
Code Sample¶
A code sample using the Point API demonstrates how to create 6-hour accumulations from the forecast-total value by differencing the totals from adjacent lead times.
Pre-computed Windows¶
If you do not want to difference the totals yourself, the opt-in basic-accumulation, precipitation-accumulation and solar-energy-accumulation bundles return 1-, 3- and 6-hour amounts directly at the point endpoint (precipitation_amount_1hr, snowfall_amount_6hr, surface_net_downward_shortwave_flux_3hr, and so on). See Accumulation Bundles.