import json


def get_th_stations(city_name: str, data_folder:str='../data/aqm_hourly2/'):
    """Look for all polltuions station in the city by Thailand PCD.
    
    Arg:
        city_name: name of the city
        data_folder: location of the staion information json file
    
    Returns: (list, list)
        station_ids: a list of station ids
        station_info_list: a list of station information dictionary 

    """
    # load stations information for air4 Thai
    station_info_file = data_folder + \
        'stations_locations.json'
    with open(station_info_file, 'r', encoding="utf8") as f:
        station_info = json.load(f)

    station_info = station_info['stations']

    # find stations in that city and add to a list
    station_ids = []
    station_info_list = []

    for i, stations in enumerate(station_info):
        if city_name in stations['areaEN']:
            station_ids.append(stations['stationID'])
            station_info_list.append(stations)

    return station_ids, station_info_list