"""
Retrieves precipitation data from BigQuery based on specified parameters.
Parameters:
-----------
- start_date (str): Start date for data query.
- end_date (str): End date for data query.
- country (str): Country name for filtering stations.
- region (str): Region name for filtering stations.
- radius (str): Radius for stations within a specified region.
- multiple_stations (str): Comma-separated list of station IDs.
- station (str): Single station ID for data filtering.
Returns:
-----------
- pd.DataFrame: A Pandas DataFrame containing the filtered precipitation data.
Usage:
-----------
To get precipitation data for a specific date range:
python
fs = Filter(api_key, api_secret, maps_key) Create an instance of your class
start_date = '2021-01-01'
end_date = '2021-01-31'
pr_data = fs.filter_pr(start_date, end_date)
To get precipitation data for a specific date range and country:
python
fs = Filter(api_key, api_secret, maps_key) Create an instance of your class
start_date = '2021-01-01'
end_date = '2021-01-31'
country = 'Kenya'
pr_data = fs.filter_pr(start_date, end_date, country=country)
To get precipitation data for a specific date range and region:
python
fs = Filter(api_key, api_secret, maps_key) Create an instance of your class
start_date = '2021-01-01'
end_date = '2021-01-31'
region = 'Nairobi'
pr_data = fs.filter_pr(start_date, end_date, region=region)
To get precipitation data for a specific date range and region with a radius:
python
fs = Filter(api_key, api_secret, maps_key) Create an instance of your class
start_date = '2021-01-01'
end_date = '2021-01-31'
region = 'Nairobi'
radius = 100
pr_data = fs.filter_pr(start_date, end_date, region=region, radius=radius)
To get precipitation data for a specific date range and multiple stations:
python
fs = Filter(api_key, api_secret, maps_key) Create an instance of your class
start_date = '2021-01-01'
end_date = '2021-01-31'
multiple_stations = ['TA00001', 'TA00002', 'TA00003']
pr_data = fs.filter_pr(start_date, end_date, multiple_stations=multiple_stations)
To get precipitation data for a specific date range and a single station:
python
fs = Filter(api_key, api_secret, maps_key) Create an instance of your class
start_date = '2021-01-01'
end_date = '2021-01-31'
station = 'TA00001'
pr_data = fs.filter_pr(start_date, end_date, station=station)
"""