# cdstoolbox.cube.accumulation_to_rate¶

cdstoolbox.cube.accumulation_to_rate(data, step)[source]

Convert a variable accumulated from the beginning of the forecast to a rate.

The rate is computed by considering first-order discrete differences in data along the time (or leadtime, if time is not a dimension) axis, divided by the number of seconds in the step. If time[k] - time[k-1] != step, then the corresponding output values will be NaN.

Parameters
• data (data object) – Data accumulated along time to be converted into rate (per second).

• float (step) – expected Time (leadtime) data step in hours.

Returns

Rate calculated based on the accumulation data.

Return type

data object

Example

Compute snowfall rate in m/s based on accumulated snowfall, using a time step of 24 hours.

>>> snow_fall_rate = ct.cube.compute_rate(snow_fall, step=24)
{"ft_lang_label":"__label__en","ft_lang_prob":0.73967385,"math_prob":0.9856467,"size":852,"snap":"2022-27-2022-33","text_gpt3_token_len":209,"char_repetition_ratio":0.12971698,"word_repetition_ratio":0.0,"special_character_ratio":0.23122066,"punctuation_ratio":0.13245033,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9978201,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-08-17T07:36:48Z\",\"WARC-Record-ID\":\"<urn:uuid:b3f3f986-d69d-49df-9040-4b79b815ad70>\",\"Content-Length\":\"119267\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:661fe0f4-1ba6-43f6-bdb4-c405a5a1853a>\",\"WARC-Concurrent-To\":\"<urn:uuid:42d64920-2940-4ca1-8ac4-4c4fb1575eda>\",\"WARC-IP-Address\":\"136.156.155.74\",\"WARC-Target-URI\":\"https://cds.climate.copernicus.eu/toolbox/doc/tools/cdstoolbox.cube.accumulation_to_rate.html\",\"WARC-Payload-Digest\":\"sha1:UMIJOA7QOROX4EGNIWNCL7YSBRLO5KLR\",\"WARC-Block-Digest\":\"sha1:DUIC7XKJJVBS5PQCGM7JW26KHBBWIPZY\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-33/CC-MAIN-2022-33_segments_1659882572870.85_warc_CC-MAIN-20220817062258-20220817092258-00257.warc.gz\"}"}