Skip to content

get_interpolated_asset_property_values async

get_interpolated_asset_property_values(
    start_time_in_seconds: TimeInSeconds,
    end_time_in_seconds: TimeInSeconds,
    quality: Quality,
    interval_in_seconds: IntervalInSeconds,
    type: InterpolationType,
    *,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    asset_id: Optional[ID] = None,
    property_id: Optional[ID] = None,
    property_alias: Optional[AssetPropertyAlias] = None,
    start_time_offset_in_nanos: Optional[OffsetInNanos] = None,
    end_time_offset_in_nanos: Optional[OffsetInNanos] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxInterpolatedResults] = None,
    interval_window_in_seconds: Optional[IntervalWindowInSeconds] = None,
) -> GetInterpolatedAssetPropertyValuesResponse

Get interpolated values for an asset property for a specified time interval, during a period of time. If your time series is missing data points during the specified time interval, you can use interpolation to estimate the missing data.

For example, you can use this operation to return the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days.

To identify an asset property, you must specify one of the following:

  • The assetId and propertyId of an asset property.

  • A propertyAlias, which is a data stream alias (for example, /company/windfarm/3/turbine/7/temperature). To define an asset property's alias, see UpdateAssetProperty.

Parameters:

  • asset_id (Optional[ID], default: None ) –

    The ID of the asset, in UUID format.

  • property_id (Optional[ID], default: None ) –

    The ID of the asset property, in UUID format.

  • property_alias (Optional[AssetPropertyAlias], default: None ) –

    The alias that identifies the property, such as an OPC-UA server data stream path (for example, /company/windfarm/3/turbine/7/temperature). For more information, see Mapping industrial data streams to asset properties in the IoT SiteWise User Guide.

  • start_time_in_seconds (TimeInSeconds) –

    The exclusive start of the range from which to interpolate data, expressed in seconds in Unix epoch time.

  • start_time_offset_in_nanos (Optional[OffsetInNanos], default: None ) –

    The nanosecond offset converted from startTimeInSeconds.

  • end_time_in_seconds (TimeInSeconds) –

    The inclusive end of the range from which to interpolate data, expressed in seconds in Unix epoch time.

  • end_time_offset_in_nanos (Optional[OffsetInNanos], default: None ) –

    The nanosecond offset converted from endTimeInSeconds.

  • quality (Quality) –

    The quality of the asset property value. You can use this parameter as a filter to choose only the asset property values that have a specific quality.

  • interval_in_seconds (IntervalInSeconds) –

    The time interval in seconds over which to interpolate data. Each interval starts when the previous one ends.

  • next_token (Optional[NextToken], default: None ) –

    The token to be used for the next set of paginated results.

  • max_results (Optional[MaxInterpolatedResults], default: None ) –

    The maximum number of results to return for each paginated request. If not specified, the default value is 10.

  • type (InterpolationType) –

    The interpolation type.

    Valid values: LINEAR_INTERPOLATION | LOCF_INTERPOLATION

    • LINEAR_INTERPOLATION – Estimates missing data using linear interpolation.

      For example, you can use this operation to return the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days. If the interpolation starts July 1, 2021, at 9 AM, IoT SiteWise returns the first interpolated value on July 2, 2021, at 9 AM, the second interpolated value on July 3, 2021, at 9 AM, and so on.

    • LOCF_INTERPOLATION – Estimates missing data using last observation carried forward interpolation

      If no data point is found for an interval, IoT SiteWise returns the last observed data point for the previous interval and carries forward this interpolated value until a new data point is found.

      For example, you can get the state of an on-off valve every 24 hours over a duration of 7 days. If the interpolation starts July 1, 2021, at 9 AM, IoT SiteWise returns the last observed data point between July 1, 2021, at 9 AM and July 2, 2021, at 9 AM as the first interpolated value. If a data point isn't found after 9 AM on July 2, 2021, IoT SiteWise uses the same interpolated value for the rest of the days.

  • interval_window_in_seconds (Optional[IntervalWindowInSeconds], default: None ) –

    The query interval for the window, in seconds. IoT SiteWise computes each interpolated value by using data points from the timestamp of each interval, minus the window to the timestamp of each interval plus the window. If not specified, the window ranges between the start time minus the interval and the end time plus the interval.

    • If you specify a value for the intervalWindowInSeconds parameter, the value for the type parameter must be LINEAR_INTERPOLATION.

    • If a data point isn't found during the specified query window, IoT SiteWise won't return an interpolated value for the interval. This indicates that there's a gap in the ingested data points.

    For example, you can get the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days. If the interpolation starts on July 1, 2021, at 9 AM with a window of 2 hours, IoT SiteWise uses the data points from 7 AM (9 AM minus 2 hours) to 11 AM (9 AM plus 2 hours) on July 2, 2021 to compute the first interpolated value. Next, IoT SiteWise uses the data points from 7 AM (9 AM minus 2 hours) to 11 AM (9 AM plus 2 hours) on July 3, 2021 to compute the second interpolated value, and so on.

Raises:

  • InternalFailureException –

    IoT SiteWise can't process your request right now. Try again later.

  • InvalidRequestException –

    The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.

  • ResourceNotFoundException –

    The requested resource can't be found.

  • ServiceUnavailableException –

    The requested service is unavailable.

  • ThrottlingException –

    Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.

    For more information, see Quotas in the IoT SiteWise User Guide.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_iotsitewise/_services/async_io_t_site_wise.py
async def get_interpolated_asset_property_values(
    self,
    start_time_in_seconds: "capo_iotsitewise.types.time_in_seconds.TimeInSeconds",
    end_time_in_seconds: "capo_iotsitewise.types.time_in_seconds.TimeInSeconds",
    quality: "capo_iotsitewise.types.quality.Quality",
    interval_in_seconds: "capo_iotsitewise.types.interval_in_seconds.IntervalInSeconds",
    type: "capo_iotsitewise.types.interpolation_type.InterpolationType",
    *,
    config_overrides: Optional[AsyncIoTSiteWiseClientConfig] = None,
    asset_id: Optional["capo_iotsitewise.types.id.ID"] = None,
    property_id: Optional["capo_iotsitewise.types.id.ID"] = None,
    property_alias: Optional[
        "capo_iotsitewise.types.asset_property_alias.AssetPropertyAlias"
    ] = None,
    start_time_offset_in_nanos: Optional[
        "capo_iotsitewise.types.offset_in_nanos.OffsetInNanos"
    ] = None,
    end_time_offset_in_nanos: Optional[
        "capo_iotsitewise.types.offset_in_nanos.OffsetInNanos"
    ] = None,
    next_token: Optional["capo_iotsitewise.types.next_token.NextToken"] = None,
    max_results: Optional[
        "capo_iotsitewise.types.max_interpolated_results.MaxInterpolatedResults"
    ] = None,
    interval_window_in_seconds: Optional[
        "capo_iotsitewise.types.interval_window_in_seconds.IntervalWindowInSeconds"
    ] = None,
) -> "capo_iotsitewise.types.get_interpolated_asset_property_values_response.GetInterpolatedAssetPropertyValuesResponse":
    """<p>Get interpolated values for an asset property for a specified time interval, during a period of time. If your time series is missing data points during the specified time interval, you can use interpolation to estimate the missing data.</p> <p>For example, you can use this operation to return the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days.</p> <p>To identify an asset property, you must specify one of the following:</p> <ul> <li> <p>The <code>assetId</code> and <code>propertyId</code> of an asset property.</p> </li> <li> <p>A <code>propertyAlias</code>, which is a data stream alias (for example, <code>/company/windfarm/3/turbine/7/temperature</code>). To define an asset property's alias, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html">UpdateAssetProperty</a>.</p> </li> </ul>

    Args:
        asset_id: <p>The ID of the asset, in UUID format.</p>
        property_id: <p>The ID of the asset property, in UUID format.</p>
        property_alias: <p>The alias that identifies the property, such as an OPC-UA server data stream path (for example, <code>/company/windfarm/3/turbine/7/temperature</code>). For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html">Mapping industrial data streams to asset properties</a> in the <i>IoT SiteWise User Guide</i>.</p>
        start_time_in_seconds: <p>The exclusive start of the range from which to interpolate data, expressed in seconds in Unix epoch time.</p>
        start_time_offset_in_nanos: <p>The nanosecond offset converted from <code>startTimeInSeconds</code>.</p>
        end_time_in_seconds: <p>The inclusive end of the range from which to interpolate data, expressed in seconds in Unix epoch time.</p>
        end_time_offset_in_nanos: <p>The nanosecond offset converted from <code>endTimeInSeconds</code>.</p>
        quality: <p>The quality of the asset property value. You can use this parameter as a filter to choose only the asset property values that have a specific quality.</p>
        interval_in_seconds: <p>The time interval in seconds over which to interpolate data. Each interval starts when the previous one ends.</p>
        next_token: <p>The token to be used for the next set of paginated results.</p>
        max_results: <p>The maximum number of results to return for each paginated request. If not specified, the default value is 10.</p>
        type: <p>The interpolation type.</p> <p>Valid values: <code>LINEAR_INTERPOLATION | LOCF_INTERPOLATION</code> </p> <ul> <li> <p> <code>LINEAR_INTERPOLATION</code> – Estimates missing data using <a href="https://en.wikipedia.org/wiki/Linear_interpolation">linear interpolation</a>.</p> <p>For example, you can use this operation to return the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days. If the interpolation starts July 1, 2021, at 9 AM, IoT SiteWise returns the first interpolated value on July 2, 2021, at 9 AM, the second interpolated value on July 3, 2021, at 9 AM, and so on.</p> </li> <li> <p> <code>LOCF_INTERPOLATION</code> – Estimates missing data using last observation carried forward interpolation</p> <p>If no data point is found for an interval, IoT SiteWise returns the last observed data point for the previous interval and carries forward this interpolated value until a new data point is found.</p> <p>For example, you can get the state of an on-off valve every 24 hours over a duration of 7 days. If the interpolation starts July 1, 2021, at 9 AM, IoT SiteWise returns the last observed data point between July 1, 2021, at 9 AM and July 2, 2021, at 9 AM as the first interpolated value. If a data point isn't found after 9 AM on July 2, 2021, IoT SiteWise uses the same interpolated value for the rest of the days.</p> </li> </ul>
        interval_window_in_seconds: <p>The query interval for the window, in seconds. IoT SiteWise computes each interpolated value by using data points from the timestamp of each interval, minus the window to the timestamp of each interval plus the window. If not specified, the window ranges between the start time minus the interval and the end time plus the interval.</p> <note> <ul> <li> <p>If you specify a value for the <code>intervalWindowInSeconds</code> parameter, the value for the <code>type</code> parameter must be <code>LINEAR_INTERPOLATION</code>.</p> </li> <li> <p>If a data point isn't found during the specified query window, IoT SiteWise won't return an interpolated value for the interval. This indicates that there's a gap in the ingested data points.</p> </li> </ul> </note> <p>For example, you can get the interpolated temperature values for a wind turbine every 24 hours over a duration of 7 days. If the interpolation starts on July 1, 2021, at 9 AM with a window of 2 hours, IoT SiteWise uses the data points from 7 AM (9 AM minus 2 hours) to 11 AM (9 AM plus 2 hours) on July 2, 2021 to compute the first interpolated value. Next, IoT SiteWise uses the data points from 7 AM (9 AM minus 2 hours) to 11 AM (9 AM plus 2 hours) on July 3, 2021 to compute the second interpolated value, and so on. </p>

    Raises:
        capo_iotsitewise.errors.internal_failure_exception.InternalFailureException: <p>IoT SiteWise can't process your request right now. Try again later.</p>
        capo_iotsitewise.errors.invalid_request_exception.InvalidRequestException: <p>The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters. Check your request and try again.</p>
        capo_iotsitewise.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource can't be found.</p>
        capo_iotsitewise.errors.service_unavailable_exception.ServiceUnavailableException: <p>The requested service is unavailable.</p>
        capo_iotsitewise.errors.throttling_exception.ThrottlingException: <p>Your request exceeded a rate limit. For example, you might have exceeded the number of IoT SiteWise assets that can be created per second, the allowed number of messages per second, and so on.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
        capo_iotsitewise.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_iotsitewise.types.get_interpolated_asset_property_values_request.GetInterpolatedAssetPropertyValuesRequest]",
    ) -> AsyncOperationResponse[
        "capo_iotsitewise.types.get_interpolated_asset_property_values_response.GetInterpolatedAssetPropertyValuesResponse"
    ]:
        import capo_iotsitewise._operations.aws_io_t_site_wise.get_interpolated_asset_property_values

        (
            output,
            http_response,
        ) = await capo_iotsitewise._operations.aws_io_t_site_wise.get_interpolated_asset_property_values.async_get_interpolated_asset_property_values(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInterpolatedAssetPropertyValues")
    )
    input_: capo_iotsitewise.types.get_interpolated_asset_property_values_request.GetInterpolatedAssetPropertyValuesRequest = {
        "start_time_in_seconds": start_time_in_seconds,
        "end_time_in_seconds": end_time_in_seconds,
        "quality": quality,
        "interval_in_seconds": interval_in_seconds,
        "type": type,
    }
    if asset_id is not None:
        input_["asset_id"] = asset_id
    if property_id is not None:
        input_["property_id"] = property_id
    if property_alias is not None:
        input_["property_alias"] = property_alias
    if start_time_offset_in_nanos is not None:
        input_["start_time_offset_in_nanos"] = start_time_offset_in_nanos
    if end_time_offset_in_nanos is not None:
        input_["end_time_offset_in_nanos"] = end_time_offset_in_nanos
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if interval_window_in_seconds is not None:
        input_["interval_window_in_seconds"] = interval_window_in_seconds

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output