pedarProbe.parse.Pedar_asc#

class pedarProbe.parse.Pedar_asc(path: str, skiprows: int = 9, header: int = 9, index_col: int = 0)[source]#

Bases: object

Reader for .asc file exported from pedar.

Parameters:
  • path – path of the .asc file exported from pedar.

  • skiprows – number of rows to be skipped in file reading.

  • header – the index of row to be set as self.doc’s header.

  • index_col – the index of column to be set as the self.doc’s index.

Note

Class Attributes

self.path str

path of the .asc file exported from pedar.

self.doc pandas.core.frame.DataFrame

loaded data frame, with sensor IDs as the columns (0~98 for left foot and 99 ~ 197 for the right foot) and time values as the rows.

Tip

There are two sensor ID numbering conventions. Please refer to id_map() for more information.

__init__(path: str, skiprows: int = 9, header: int = 9, index_col: int = 0)[source]#

Methods

__init__(path[, skiprows, header, index_col])

get_sensor_seq(foot, sensor_id, start_time, ...)

Get a sequence of values with sensor ID and start & end time.

get_time_sensor(foot, time, sensor_id)

Get value with time and sensor ID.

get_time_sensor_slice(foot, start_time, end_time)

Get a frame of values with start & end sensor IDs and start & end time.

get_time_seq(foot, time, start_sensor_id, ...)

Get a sequence of values with time and start & end sensor IDs.

id_map(foot, sensor_id)

Maps sensor ID numbering from pedar convention to pedarProbe convention:

id_map(foot: str, sensor_id: int) int[source]#

Maps sensor ID numbering from pedar convention to pedarProbe convention:

  • pedar convention: for each foot, sensors are numbered as 1~99.

  • pedarProbe convention: 0~98 for left foot sensors and 99 ~ 197 for the right foot sensors.

Parameters:
  • foot'L' as left foot and 'R' as right foot.

  • sensor_id – sensor ID in pedar convention.

Returns:

sensor ID in pedarProbe convention.

Return type:

int

get_time_sensor(foot: str, time: float, sensor_id: int) float64[source]#

Get value with time and sensor ID.

Parameters:
  • foot'L' as left foot and 'R' as right foot.

  • time – time value.

  • sensor_id – sensor ID in pedar convention.

Return type:

numpy.float64

get_time_seq(foot: str, time: float, start_sensor_id: int, end_sensor_id: int) Series[source]#

Get a sequence of values with time and start & end sensor IDs.

Parameters:
  • foot'L' as left foot and 'R' as right foot.

  • time – time value.

  • start_sensor_id – start sensor ID in pedar convention.

  • end_sensor_id – end sensor ID in pedar convention.

Return type:

pandas.core.series.Series

get_sensor_seq(foot: str, sensor_id: int, start_time: float, end_time: float) Series[source]#

Get a sequence of values with sensor ID and start & end time.

Parameters:
  • foot'L' as left foot and 'R' as right foot.

  • sensor_id – start sensor ID in pedar convention.

  • start_time – start time value.

  • end_time – end time value.

Return type:

pandas.core.series.Series

get_time_sensor_slice(foot: str, start_time: float, end_time: float, start_sensor_id: int = 1, end_sensor_id: int = 99) DataFrame[source]#

Get a frame of values with start & end sensor IDs and start & end time.

Parameters:
  • foot'L' as left foot and 'R' as right foot.

  • start_sensor_id – start sensor ID in pedar convention.

  • end_sensor_id – end sensor ID in pedar convention.

  • start_time – start time value.

  • end_time – end time value.

Return type:

pandas.core.frame.DataFrame