floodlight.io.kinexon

Creates a dictionary from the pID_dict linking the identifier to the xID.

Parameters
  • pID_dict (Dict[str, Dict[str, List[str]]]) – Nested dictionary that stores information about the pIDs from every player- identifying column in every group. The format is pID_dict[group][identifying_column] = [pID1, pID2, ..., pIDn]. When recording and exporting Kinexon data, the pID can be stored in different columns. Player-identifying columns are "sensor_id", "mapped_id", and "full_name". If the respective column is in the recorded data, its pIDs are listed in pID_dict.

  • identifier (str, optional) – Column-name of personal identifier in Kinexon.csv-file, defaults to None. Can be one of: "sensor_id", "mapped_id", "name".

    When recording and exporting Kinexon data, the pID can be stored in different columns. Player-identifying columns are "sensor_id", "mapped_id", and "full_name". If specified to one of the above, keys in links will be the pIDs in that column. If not specified, it will use one of the columns, favoring "name" over "mapped_id" over "sensor_id".

Returns

links – Link-dictionary of the form links[group][identifier-ID] = xID.

Return type

Dict[str, Dict[str, int]]

floodlight.io.kinexon.get_column_names_from_csv(filepath_data)[source]

Reads first line of a Kinexon.csv-file and extracts the column names.

Parameters

filepath_data (str or pathlib.Path) – Full path to Kinexon.csv-file.

Returns

columns – List with every column name of the .csv-file.

Return type

List[str]

floodlight.io.kinexon.get_meta_data(filepath_data)[source]

Reads Kinexon’s position data file and extracts meta-data about groups, sensors, length and framerate.

Parameters

filepath_data (str or pathlib.Path) – Full path to Kinexon.csv-file.

Return type

Tuple[Dict[str, Dict[str, List[str]]], int, int, int]

Returns

  • pID_dict (Dict[str, Dict[str, List[str]]],) – Nested dictionary that stores information about the pIDs from every player- identifying column in every group. ‘pID_dict[group_identifier][identifying_column] = [pID1, pID2, …, pIDn]’ When recording and exporting Kinexon data, the pID can be stored in different columns. Player-identifying columns are “sensor_id”, “mapped_id”, and “full_name”. If the respective column is in the recorded data, its pIDs are listed in pID_dict. As with pID, group ids can be stored in different columns. Group-identifying columns are “group_name” and “group_id”. If both are available, group_name will be favored over group_id as the group_identifier.

  • number_of_frames (int) – Number of frames from the first to the last recorded frame.

  • framerate (int) – Estimated framerate in frames per second. Estimated from the smallest difference between two consecutive frames.

  • t_null (int) – Timestamp of the first recorded frame

floodlight.io.kinexon.read_position_data_csv(filepath_data)[source]

Parses a Kinexon csv file and extracts position data.

Kinexon’s local positioning system delivers one .csv file containing the position data. This function provides a high-level access to Kinexon data by parsing “the full file” given the path to the file.

Parameters

filepath_data (str or pathlib.Path) – Full path to Kinexon .csv-file.

Returns

positions – List of XY-objects for the whole game, one per group. The order of groups is ascending according to their group_id. If no groups are specified in the file, all data gets assigned to a dummy group “0”. The order inside the groups is ascending according to their appearance in the data.

Return type

List[XY]