Skip to content

Releases: kaburia/filter-stations

Release list

stations by region

Choose a tag to compare

@kaburia kaburia released this 06 Oct 06:31
9374b9d

Subsets weather stations by a specific geographical region and optionally plots them on a map with a scale bar.

    Parameters:
    -----------
    - region (str): The name of the region to subset stations from (47 Kenyan counties).
    - plot (bool, optional): If True, a map with stations and a scale bar is plotted. Default is False.

    Returns:
    -----------
    - list or None: If plot is False, returns a list of station codes in the specified region. Otherwise, returns None.

    Usage:
    -----------
    To get a list of station codes in the 'Nairobi' region without plotting:
    ```
    fs = Filter(api_key, api_secret, maps_key)  # Create an instance of your class
    station_list = fs.stations_region('Nairobi')
    ```

    To subset stations in the 'Nairobi' region and display them on a map with a scale bar:
    ```
    fs = Filter(api_key, api_secret, maps_key)  # Create an instance of your class
    fs.stations_region('Nairobi', plot=True)
    ```
Nairobi Region Map