# Trim windowing

A windowing policy of type *trim* trims the temporal interval of a trial, both from the start and from the end of a specified temporal amount (e.g., 3 seconds).

The trim windowing has the following structure:

| Filed  | Type             | Value restrictions                                                                                                                          | Is required | Default value   | Description                                                                                                                                                                                                                             |
| ------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type` | string           | {trim}                                                                                                                                      | TRUE        | <p><br><br></p> | the type of windowing strategy                                                                                                                                                                                                          |
| `trim` | array of strings | <p>The length of the array should be two.</p><p>Valid values should have the form of a whole number followed by either "s", "m", or "h"</p> | TRUE        | <p><br><br></p> | How to trim the temporal interval of a trial to get the window. *\["0s", "10m"]* means trim 0 seconds from the start of the interval, 10 minutes from the end. *\["0s", "1h"]* means trim 0 seconds from the start, 1 hour from the end |
| `task` | string           | The name of a task of the workflow associated with the study                                                                                | FALSE       | <p><br><br></p> | If the field is specified, the trim offset calculation for the window will be applied from the start time of the assigned task. Otherwise, it will be calculated from the start time of the trial.                                      |

In case a windowing policy is not specified, the default windowing corresponding to `trim[0s,0s]` is considered.

### Example

The following fragment shows a windowing strategy of type "trim" where the time window is specified to start 10s after the beginning of the trial and to end immediately before the end of the trial:

```yaml
windowing: # the temporal window in which to compute the score of a trial
  type: "trim" # type of windowing is trim
  trim: [10s, 0s]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.3.1/akamas-reference/construct-templates/study-template/windowing-strategy/trim-windowing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
