pedpy.methods.flow_calculator module#

Module containing functions to compute flows.

pedpy.methods.flow_calculator.compute_flow(*, nt: DataFrame, crossing_frames: DataFrame, individual_speed: DataFrame, delta_t: int, frame_rate: float) DataFrame[source]#

Compute the flow for the given crossing_frames and nt.

Parameters
  • nt (pd.DataFrame) – DataFrame containing the columns ‘frame’, ‘Cumulative pedestrians’, and ‘Time [s]’ (see result from compute_nt)

  • crossing_frames (pd.DataFrame) – DataFrame containing the columns ‘ID’, and ‘frame’ (see result from compute_nt)

  • individual_speed (pd.DataFrame) – DataFrame containing the columns ‘ID’, ‘frame’, and ‘speed’

  • delta_t (int) – size of the time interval to compute the flow

  • frame_rate (float) – frame rate of the trajectories

Returns

DataFrame containing the columns ‘Flow rate(1/s)’, and ‘Mean velocity(m/s)’

Return type

DataFrame

pedpy.methods.flow_calculator.compute_n_t(*, traj_data: DataFrame, measurement_line: LineString, frame_rate: float) Tuple[DataFrame, DataFrame][source]#

Compute the framewise cumulative number of pedestrians passing the line.

Warning

For each pedestrian only the first passing of the line is considered!

Parameters
  • traj_data (TrajectoryData) – trajectory data

  • measurement_line (shapely.LineString) – line for which n-t is computed

  • frame_rate (float) – frame rate of the trajectory data

Returns

DataFrame containing the columns ‘frame’, ‘Cumulative pedestrians’, and ‘Time [s]’ and DataFrame containing the columns ‘ID’, and ‘frame’.

Return type

Tuple[DataFrame, DataFrame]