Esempio n. 1
0
def validate_air_temperature(observation, values):
    """
    Run validation checks on an air temperature observation.

    Parameters
    ----------
    observation : solarforecastarbiter.datamodel.Observation
       Observation object that the data is associated with
    values : pandas.Series
       Series of observation values

    Returns
    -------
    timestamp_flag, night_flag, temp_limit_flag : pandas.Series
        Integer bitmask series from
        :py:func:`.validator.check_timestamp_spacing`,
        :py:func:`.validator.check_irradiance_day_night`,
        :py:func:`.validator.check_temperature_limits` respectively
    """
    timestamp_flag, night_flag = validate_defaults(observation, values)
    temp_limit_flag = validator.check_temperature_limits(
        values, _return_mask=True)
    return timestamp_flag, night_flag, temp_limit_flag
Esempio n. 2
0
def validate_air_temperature(observation, values):
    """
    Run validation checks on an air temperature observation.

    Parameters
    ----------
    observation : solarforecastarbiter.datamodel.Observation
       Observation object that the data is associated with
    values : pandas.Series
       Series of observation values

    Returns
    -------
    tuple
        Tuple of integer bitmask series of flags from the following tests, in
        order,
        `validator.check_timestamp_spacing`,
        `validator.check_temperature_limits`
    """
    timestamp_flag = _validate_timestamp(observation, values)
    temp_limit_flag = validator.check_temperature_limits(values,
                                                         _return_mask=True)
    return timestamp_flag, temp_limit_flag
def test_check_temperature_limits(weather):
    expected = weather
    result_expected = expected['extreme_temp_flag']
    result = validator.check_temperature_limits(expected['temp_air'])
    assert_series_equal(result, result_expected)