示例#1
0
def get_psi_o3_8h(o3_8h: float) -> (int, str, str):
    """
    Calculates O3 (8h) Singapore PSI

    :param o3_8h: O3 average (8h), ppm
    :return: Singapore PSI, General message, Risk message
    """
    cp = __round_down(o3_8h * 1000)
    return __get_aqi_general_formula_texts(cp, SG_O3_8H, SG_AQI_GENERAL, SG_AQI_RISK, SG_PSI)
示例#2
0
def get_psi_no2_1h(no2_1h: float) -> (int, str, str):
    """
    Calculates NO2 (1h) Singapore PSI

    :param no2_1h: NO2 average (1h), ppm
    :return: Singapore PSI, General message, Risk message
    """
    cp = __round_down(no2_1h * 1000)
    return __get_aqi_general_formula_texts(cp, SG_NO2_1H, SG_AQI_GENERAL, SG_AQI_RISK, SG_PSI)
示例#3
0
def get_psi_so2_24h(so2_24h: float) -> (int, str, str):
    """
    Calculates SO2 (24h) Singapore PSI

    :param so2_24h: SO2 average (24h), ppm
    :return: Singapore PSI, General message, Risk message
    """
    cp = __round_down(so2_24h * 1000)
    return __get_aqi_general_formula_texts(cp, SG_SO2_24H, SG_AQI_GENERAL, SG_AQI_RISK, SG_PSI)
示例#4
0
def get_psi_co_8h(co_8h: float) -> (int, str, str):
    """
    Calculates CO (8h) Singapore PSI

    :param co_8h: CO average (8h), ppm
    :return: Singapore PSI, General message, Risk message
    """
    cp = __round_down(co_8h, 1)
    return __get_aqi_general_formula_texts(cp, SG_CO_8H, SG_AQI_GENERAL, SG_AQI_RISK, SG_PSI)
示例#5
0
def get_psi_pm10_24h(pm10_24h: float) -> (int, str, str):
    """
    Calculates PM10 (24h) Singapore PSI

    :param pm10_24h: PM10 average (24h), μg/m3
    :return: PM10 Singapore PSI,  General message, Risk message
    """
    cp = __round_down(pm10_24h)
    return __get_aqi_general_formula_texts(cp, SG_PM10_24H, SG_AQI_GENERAL, SG_AQI_RISK, SG_PSI)
示例#6
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_no2_1h(no2_1h: float) -> (int, str, str):
    """
    Calculates NO2 (1h) US AQI

    :param no2_1h: NO2 average (1h), ppm
    :return: NO2 US AQI, Effect message, Caution message
    """
    cp = round(no2_1h * 1000)
    return __get_aqi_general_formula_texts(cp, US_NO2_1H, US_NO2_EFFECTS,
                                           US_NO2_CAUTIONS, US_AQI)
示例#7
0
def get_aqi_o3_8h(o3_8h: float) -> (int, str, str):
    """
    Calculates O3 (8h) India AQI

    :param o3_8h: O3 average (8h), ppm
    :return: O3 India AQI, Effect message, Caution message
    """
    cp = __round_down(o3_8h * 1000)
    return __get_aqi_general_formula_texts(cp, IN_O3_8H, IN_AQI_EFFECTS,
                                           IN_AQI_EFFECTS, IN_AQI)
示例#8
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_pm10_24h(pm10_24h: float) -> (int, str, str):
    """
    Calculates PM10 (24h) US AQI

    :param pm10_24h: PM10 average (24h), μg/m3
    :return: PM10 US AQI, Effect message, Caution message
    """
    cp = round(pm10_24h)
    return __get_aqi_general_formula_texts(cp, US_PM10_24H, US_PM_EFFECTS,
                                           US_PM_CAUTIONS, US_AQI)
示例#9
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_pm25_24h(pm25_24h: float) -> (int, str, str):
    """
    Calculates PM2.5 (24h) US AQI

    :param pm25_24h: PM2.5 average (24h), μg/m3
    :return: PM2.5 US AQI, Effect message, Caution message
    """
    cp = __round_down(pm25_24h, 1)
    return __get_aqi_general_formula_texts(cp, US_PM25_24H, US_PM_EFFECTS,
                                           US_PM_CAUTIONS, US_AQI)
示例#10
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_co_8h(co_8h: float) -> (int, str, str):
    """
    Calculates CO (8h) US AQI

    :param co_8h: CO average (8h), ppm
    :return: CO US AQI, Effect message, Caution message
    """
    cp = __round_down(co_8h, 1)
    return __get_aqi_general_formula_texts(cp, US_CO_8H, US_CO_EFFECTS,
                                           US_CO_CAUTIONS, US_AQI)
示例#11
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_o3_1h(o3_1h: float) -> (int, str, str):
    """
    Calculates O3 US AQI

    :param o3_1h: O3 average (1h), ppm
    :return: O3 US AQI, Effect message, Caution message
    """
    cp = __round_down(o3_1h, 3)
    return __get_aqi_general_formula_texts(cp, US_OZONE_1H, US_OZONE_EFFECTS,
                                           US_OZONE_CAUTIONS, US_AQI)
示例#12
0
def get_aqi_pb_24h(pb_24h: float) -> (int, str, str):
    """
    Calculates Pb (24h) India AQI

    :param pb_24h: Pb average (24h), ppm
    :return: Pb India AQI, Effect message, Caution message
    """
    cp = __round_down(pb_24h * 1000, 3)
    return __get_aqi_general_formula_texts(cp, IN_PB_24H, IN_AQI_EFFECTS,
                                           IN_AQI_EFFECTS, IN_AQI)
示例#13
0
def get_aqi_nh3_24h(nh3_24h: float) -> (int, str, str):
    """
    Calculates NH3 (24h) India AQI

    :param nh3_24h: NH3 average (24h), ppm
    :return: NH3 India AQI, Effect message, Caution message
    """
    cp = __round_down(nh3_24h * 1000)
    return __get_aqi_general_formula_texts(cp, IN_NH3_24H, IN_AQI_EFFECTS,
                                           IN_AQI_EFFECTS, IN_AQI)
示例#14
0
def get_aqi_so2_24h(so2_24h: float) -> (int, str, str):
    """
    Calculates SO2 (24h) India AQI

    :param so2_24h: SO2 average (24h), ppm
    :return: SO2 India AQI, Effect message, Caution message
    """
    cp = __round_down(so2_24h * 1000)
    return __get_aqi_general_formula_texts(cp, IN_SO2_24H, IN_AQI_EFFECTS,
                                           IN_AQI_EFFECTS, IN_AQI)
示例#15
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_so2_24h(so2_24h: float) -> (int, str, str):
    """
    Calculates SO2 (24h) US AQI

    :param so2_24h: SO2 average (24h), ppm
    :return: SO2 US AQI, Effect message, Caution message
    """
    cp = round(so2_24h * 1000)
    return __get_aqi_general_formula_texts(cp, US_SO2_24H, US_SO2_EFFECTS,
                                           US_SO2_CAUTIONS, US_AQI)
示例#16
0
def get_cai_pm10_24h(pm10_24h: float) -> (int, str, str):
    """
    Calculates PM10 (24h) South Korea CAI

    :param pm10_24h: PM10 average (24h), μg/m3
    :return: PM10 South Korea CAI, General message, Risk message
    """
    cp = __round_down(pm10_24h)
    return __get_aqi_general_formula_texts(cp, KR_PM10_24H, KR_AQI_GENERAL,
                                           KR_AQI_GENERAL, KR_CAI)
示例#17
0
def get_aqi_pm10_24h(pm10_24h: float) -> (int, str, str):
    """
    Calculates PM10 (24h) India AQI

    :param pm10_24h: PM10 average (24h), μg/m3
    :return: PM10 India AQI, Effect message, Caution message
    """
    cp = __round_down(pm10_24h)
    return __get_aqi_general_formula_texts(cp, IN_PM10_24H, IN_AQI_EFFECTS,
                                           IN_AQI_EFFECTS, IN_AQI)
示例#18
0
def get_cai_no2_1h(no2_1h: float) -> (int, str, str):
    """
    Calculates NO2 (1h) South Korea CAI

    :param no2_1h: NO2 average (1h), ppm
    :return: NO2 South Korea CAI, General message, Risk message
    """
    cp = __round_down(no2_1h, 3)
    return __get_aqi_general_formula_texts(cp, KR_NO2_1H, KR_AQI_GENERAL,
                                           KR_AQI_GENERAL, KR_CAI)
示例#19
0
def get_cai_co_1h(co_1h: float) -> (int, str, str):
    """
    Calculates CO (1h) South Korea CAI

    :param co_1h: CO average (1h), ppm
    :return: CO South Korea CAI, General message, Risk message
    """
    cp = __round_down(co_1h, 2)
    return __get_aqi_general_formula_texts(cp, KR_CO_1H, KR_AQI_GENERAL,
                                           KR_AQI_GENERAL, KR_CAI)
示例#20
0
def get_cai_o3_1h(o3_1h: float) -> (int, str, str):
    """
    Calculates O3 (1h) South Korea CAI

    :param o3_1h: O3 average (1h), ppm
    :return: O3 South Korea CAI, General message, Risk message
    """
    cp = __round_down(o3_1h, 3)
    return __get_aqi_general_formula_texts(cp, KR_O3_1H, KR_AQI_GENERAL,
                                           KR_AQI_GENERAL, KR_CAI)
示例#21
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_o3_8h(o3_8h: float) -> (int, str, str):
    """
    Calculates O3 US AQI

    :param o3_8h: O3 average (8h), ppm
    :return: O3 US AQI, Effect message, Caution message
    """
    cp = __round_down(o3_8h, 3)
    # 8-hour O3 values do not define higher AQI values (≥ 301)
    return __get_aqi_general_formula_texts(cp, US_OZONE_8H, US_OZONE_EFFECTS,
                                           US_OZONE_CAUTIONS, US_AQI, 300)
示例#22
0
文件: aqi_us.py 项目: atmotube/aqipy
def get_aqi_so2_1h(so2_1h: float) -> (int, str, str):
    """
    Calculates SO2 (1h) US AQI

    :param so2_1h: SO2 average (1h), ppm
    :return: SO2 US AQI, Effect message, Caution message
    """
    cp = round(so2_1h * 1000)
    # 1-hour SO2 values do not define higher AQI values (≥ 200)
    return __get_aqi_general_formula_texts(cp, US_SO2_1H, US_SO2_EFFECTS,
                                           US_SO2_CAUTIONS, US_AQI, 200)