Skip to content

Filter reference

For filters, the Receives field in the function descriptions is used to document what columns are assumed to be in the DriveData objects processed by the filter.

FixReversedRoadLinearLand

FixReversedRoadLinearLand(drivedata: DriveData) -> DriveData

Fixes a section of reversed road in the LinearLand map

RoadOffset becomes -RoadOffset between XPos 700 and 900

Requires data columns
  • XPos: X position of ownship
  • RoadOffset: lateral distance on roadway

Returns:

Type Description
DriveData

Original DriveData object with altered RoadOffset column data

SimTimeFromDatTime

SimTimeFromDatTime(drivedata: DriveData) -> DriveData

Copies DatTime to SimTime

Requires data columns
  • SimTime: simulation time = DatTime: time from simobserver recording start

Returns:

Type Description
DriveData

Original DriveData object with identical DatTime and SimTime

numberBinaryBlocks

numberBinaryBlocks(
    drivedata: DriveData,
    binary_column="ButtonStatus",
    new_column="NumberedBlocks",
    only_on=0,
    limit_fill_null=700,
    extend_blocks=0,
) -> DriveData

Adds a column that separates data into blocks based on the value of another column

If only_on is set to 1, it filters the data to only include rows where binary_col is set to 1. If extend_blocks is set to 1, it extends the blocks.

Parameters:

Name Type Description Default
binary_column

The name of the column to reference

'ButtonStatus'
new_column

The name of the new column with blocks

'NumberedBlocks'
only_on

Determines whether to filter the data after adding blocks.

0
extend_blocks

Determines whether to extend the blocks.

0
limit_fill_null

Determines how many rows to fill using fill_null (only applies when extend_blocks is set to 1).

700

Returns:

Type Description
DriveData

Original drive data object augmented with new column

setinrange

setinrange(
    drivedata: DriveData,
    coltoset: str,
    valtoset: float,
    colforrange: str,
    rangemin: float,
    rangemax: float,
) -> DriveData

Set values of one column based on the values of another column

If the value of colforrange is outside the range of (rangemin, rangemax), then the value of coltoset will be unchanged. Otherwise, the value of coltoset will be changed to valtoset.

Parameters:

Name Type Description Default
coltoset str

The name of the column to modify

required
valtoset float

The new value to set for the

required
colforrange str

The name of the column to look up to decide to set a new value or not

required
rangemin float

Minimum value of the range

required
rangemax float

Maximum value of the range

required

Returns:

Type Description
DriveData

Original DriveData object with modified column

zscoreCol

zscoreCol(drivedata: DriveData, col: str, newcol: str) -> DriveData

Transform a column into a standardized z-score column

Parameters:

Name Type Description Default
col str

The name of the column to transform

required
newcol str

The name of the new z-score column

required

Returns:

Type Description
DriveData

Original DriveData object augmented with new z-score column