def _remove_invalid_wind_rows(wind_table):
    """Removes any row with invalid wind data.

    :param wind_table: pandas DataFrame created by read_winds_from_raw_file.
    :return: wind_table: Same as input, with the following exceptions.
        [1] Any row with invalid wind speed is removed.
        [2] Any invalid wind direction is changed to NaN.
    """

    return raw_wind_io.remove_invalid_rows(wind_table,
                                           check_speed_flag=True,
                                           check_direction_flag=True)
def _remove_invalid_wind_reports(wind_table):
    """Removes wind reports with invalid v-wind, latitude, longitude, or time.

    :param wind_table: pandas DataFrame created by
        `read_thunderstorm_wind_reports`.
    :return: wind_table: Same as input, except that some rows may be gone.
    """

    return raw_wind_io.remove_invalid_rows(wind_table,
                                           check_v_wind_flag=True,
                                           check_lat_flag=True,
                                           check_lng_flag=True,
                                           check_time_flag=True)
def _remove_invalid_wind_rows(wind_table):
    """Removes any row with invalid wind data.

    :param wind_table: pandas DataFrame created by read_winds_from_raw_file.
    :return: wind_table: Same as input, with the following exceptions.
        [1] Any row with invalid wind speed, latitude, or longitude is removed.
        [2] Any invalid wind direction or elevation is changed to NaN.
        [3] All longitudes are positive in western hemisphere.
    """

    return raw_wind_io.remove_invalid_rows(
        wind_table, check_speed_flag=True, check_direction_flag=True,
        check_lat_flag=True, check_lng_flag=True, check_elevation_flag=True)
def _remove_invalid_wind_rows(wind_table):
    """Removes any row with invalid wind data.

    :param wind_table: pandas DataFrame created by either
        read_1minute_winds_from_text or read_5minute_winds_from_text.
    :return: wind_table: Same as input, except that any row with invalid v-wind,
        latitude, longitude, or time is removed.
    """

    return raw_wind_io.remove_invalid_rows(wind_table,
                                           check_v_wind_flag=True,
                                           check_lat_flag=True,
                                           check_lng_flag=True,
                                           check_time_flag=True)
def _remove_invalid_metadata_rows(station_metadata_table):
    """Removes any row with invalid station metadata.

    :param station_metadata_table: pandas DataFrame created by
        read_station_metadata_from_raw_file.
    :return: station_metadata_table: Same as input, with the following
        exceptions.
        [1] Any row with invalid latitude or longitude is removed.
        [2] Any invalid elevation is changed to NaN.
        [3] All longitudes are positive in western hemisphere.
    """

    return raw_wind_io.remove_invalid_rows(station_metadata_table,
                                           check_lat_flag=True,
                                           check_lng_flag=True,
                                           check_elevation_flag=True)