koverholt / rainfalltotals / 0.4.1



This algorithm returns the total rainfall amounts in Central Texas based on sensor data from the LCRA Hydromet.

Input a Site ID (from https://hydromet.lcra.org/home/GaugeDataList/?siteNumber=1199&siteType=rain) and a duration (in hours or days), and the algorithm will return the amount of rainfall (in inches) that occurred during the specified duration.

Applicable Scenarios and Problems

This algorithm can be used to retrieve rainfall data to use in a historical weather application and made available via a form (such as http://apps.koverholt.com/rainfall/) or used in a maps API.



ParameterDescriptionValid Inputs
site_idSite ID (integer)See https://hydromet.lcra.org/home/GaugeDataList/?siteNumber=1199&siteType=rain
durationDuration of rainfall data"1_hour", "3_hour", "6_hour", "24_hour", "since_midnight", "5_day_total"


rainfall_amountRainfall amount (in)
site_locationName of site location


Example 1:

In this example, we input Site ID 1983 (Tow 10 ESE, located near Lake Buchanan in Tow, TX) and a duration of 5 days:

Input: {"site_id": 1983, "duration": "5_day_total"}

And the algorithm returns that there has been 1 inch of rainfall in the most recent 5 days.

Output: {"site_location": "Tow 10 ESE", "rainfall_amount": 0.37}

Example 2:

Or, we can input Site ID 1616 (Eden 3 S, located near Eden, TX) and a duration of 24 hours:

Input: {"site_id": 1616, "duration": "24_hour"}

And the algorithm returns that there has been no rainfall in the last 24 hours.

Output: {"site_location": "Eden 3 S", "rainfall_amount": 0}

Example 3:

If we input a Site ID that does not exist:

Input: {"site_id": 2222, "duration": "24_hour"}

The algorithm will return an error:

Site ID not found or duration not specified