src.applications.UNECE_R79.unecer79_event_finder module
This module is responsible for finding events valid according to UNECE regulation 79.
It includes one class for the event finding. See details in its own documentation.
Contact person: Stefan Riedmaier Creation date: 25.06.2020 Python version: 3.8
- class src.applications.UNECE_R79.unecer79_event_finder.UNECEr79EventFinder
Bases:
objectThis class is responsible for finding events valid according to UNECE regulation 79.
It includes two main functions called “find_lkft_events” and “cluster_lkft_events”. The former calls the remaining methods. See the respective documentations for more details.
- check_lkft_conditions(responses_da, scenarios_kpi_da)
This function checks the validity of LKFT test scenarios according to UNECE-R79.
It checks that: - the lateral acceleration is between 80 and 90 % of aysmax, specified by the manufacturer. - the velocity is between vmin and vmax of the LKAS, specified by the manufacturer. - the LKAS was turned on by the driver - the LKAS was active (lane recognized, etc.)
- Parameters:
responses_da (xr.DataArray) – array of response signals
scenarios_kpi_da (xr.DataArray) – data-array with scenario parameter values
- Returns:
dictionary of mask arrays, array of absolute lateral acceleration
- Return type:
(dict(np.ndarray), np.ndarray)
- cluster_lkft_events(scenarios_mean_da)
This function clusters lkft events into bins to extract repetitions.
- Parameters:
scenarios_mean_da (xr.DataArray) – array of scenario parameters (mean values of the time signals)
- Returns:
array of clustered scenarios
- Return type:
xr.DataArray
- find_lkft_events(quantities_ts_da, qois_ts_da, scenarios_ts_da, scenarios_kpi_da)
This function extracts events from signals that satisfy the UNECE-R79 Lane Keeping Functional Test conditions.
- Parameters:
quantities_ts_da (xr.DataArray) – data-array with quantity signals
qois_ts_da (xr.DataArray) – data-array with qoi signals
scenarios_ts_da (xr.DataArray) – data-array with scenario signals
scenarios_kpi_da (xr.DataArray) – data-array with scenario parameter values
- Returns:
data-array with events of qoi resp. scenario signals
- Return type:
(xr.DataArray, xr.DataArray)
- pullup_lkft_glitches(mask_dict, idx_time, ay_abs)
This function pulls up short glitches in binary LKFT signals / conditions.
According to UNECE-R79, the ay condition can be torn under certain circumstances: “Notwithstanding the sentence above, for time periods of not more than 2 s the lateral acceleration of the system may exceed the specified value aysmax by not more than 40 %, while not exceeding the maximum value specified in the table in paragraph 5.6.2.1.3. of this Regulation by more than 0.3 m / s2.”
- Parameters:
mask_dict (dict) – dictionary of mask arrays
idx_time – index of the time dimension in the mask arrays
ay_abs (np.ndarray) – array of absolute lateral acceleration
- Returns:
dictionary of mask arrays without short glitches
- Return type:
dict(np.ndarray)
- static trim_lkft_signals(start_idx, event_length, idx_time, qois_ts_da, scenarios_ts_da)
This function trims the desired LKFT signals by using the event start indices and lengths.
- Parameters:
start_idx (tuple) – start indices
event_length (np.ndarray) – length of the events
idx_time (int) – index of the time dimension
qois_ts_da (xr.DataArray) – data-array with qoi signals
scenarios_ts_da (xr.DataArray) – data-array with scenario signals
- Returns:
data-array with events of qoi resp. scenario signals
- Return type:
(xr.DataArray, xr.DataArray)