physped.io package

Submodules

physped.io.readers module

Data readers for the physics based pedestrian modeling code.

physped.io.readers.filter_part_of_the_domain(df, xmin, xmax, xcol='x_pos', ycol='y_pos')[source]
physped.io.readers.get_background_image_from_remote_zip(config: DictConfig) Image[source]

Read the background image from a remote archive.

Parameters:

config – The configuration parameters.

Returns:

The background image as a PIL Image object.

physped.io.readers.get_background_image_from_zenodo(config: DictConfig, filename: str = None) Image[source]

Read image file from Zenodo using PIL

Parameters:
  • config – The configuration parameters.

  • filename – Name of file to read. If None, will read first image file

  • found

Returns:

PIL Image object

physped.io.readers.get_background_image_local(config: DictConfig) Image[source]

Read the background image from a local file.

Parameters:

config – The configuration parameters.

Returns:

The background image as a PIL Image object.

physped.io.readers.get_zenodo_data(url: str) BytesIO[source]

Download data from Zenodo URL into memory

physped.io.readers.list_zenodo_files(config: DictConfig, pattern: str = None) List[dict][source]

List all files in a Zenodo record, optionally filtered by pattern

Parameters:

config – The configuration parameters.

Returns:

List of file information dictionaries

physped.io.readers.read_asdz_pf12_paths(config: DictConfig) DataFrame[source]

Read the Amsterdam Zuid platform 1-2 paths data set.

The trajectories are read from local or remote sources based on the configuration. The spatial coordinates of the trajectories are converted from milimeters to meters.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Amsterdam Zuid platform 1-2 paths.

physped.io.readers.read_asdz_pf12_paths_4tu(config: DictConfig) DataFrame[source]

Read the Amsterdam Zuid platform 1-2 paths data set from 4TU.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Amsterdam Zuid platform 1-2 paths

physped.io.readers.read_asdz_pf12_paths_local(config: DictConfig) DataFrame[source]

Read the Amsterdam Zuid platform 1-2 paths data set from a local file.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Amsterdam Zuid platform 1-2 paths

physped.io.readers.read_asdz_pf34_paths(config: DictConfig) DataFrame[source]
physped.io.readers.read_asdz_pf34_paths_4tu(config: DictConfig) DataFrame[source]
physped.io.readers.read_asdz_pf34_paths_local(config: DictConfig) DataFrame[source]
physped.io.readers.read_curved_paths_synthetic(config: DictConfig) DataFrame[source]

Read the synthetic curved paths data set.

Parameters:

config – The configuration parameters.

Returns:

The synthetic curved paths dataset.

physped.io.readers.read_ehv_pf34_paths_geert(config: DictConfig) DataFrame[source]

Read the Eindhoven platform 3-4 paths data set from Geert.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Eindhoven platform 3-4 paths

physped.io.readers.read_ehv_pf34_paths_local(config: DictConfig) DataFrame[source]

Read the Eindhoven platform 3-4 paths data set from a local file.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Eindhoven platform 3-4 paths

physped.io.readers.read_ehv_pf34_paths_zenodo(config: DictConfig) DataFrame[source]

Read the Eindhoven platform 3-4 paths data set from a local file.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Eindhoven platform 3-4 paths

physped.io.readers.read_eindhoven_pf34_paths(config: DictConfig) DataFrame[source]

Read the Eindhoven platform 3-4 paths data set.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Eindhoven platform 3-4 paths.

physped.io.readers.read_intersecting_paths(config: DictConfig) DataFrame[source]

Read the intersecting paths data set.

The intersecting paths dataset is created by combining the left-to-right and right-to-left paths from the narrow corridor dataset. The paths from the right-to-left dataset are rotated by 90 degrees to create intersecting paths.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with intersecting paths.

physped.io.readers.read_narrow_corridor_paths(config: DictConfig) DataFrame[source]

Read the narrow corridor data set.

The trajectories are read from local or remote sources based on the configuration.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with single paths.

physped.io.readers.read_narrow_corridor_paths_4tu(config: DictConfig) Tuple[DataFrame, DataFrame][source]

Read the narrow corridor paths archive from 4TU remote repository.

Parameters:

config – The configuration parameters.

Returns:

  • df_ltr: Paths of pedestrians walking from left to right.

  • df_rtl: Paths of pedestrians walking from right to left.

Return type:

A tuple containing two DataFrames

physped.io.readers.read_narrow_corridor_paths_local(config: DictConfig) Tuple[DataFrame, DataFrame][source]

Read the narrow corridor paths archive from a local zip.

Parameters:

config – The configuration parameters.

Returns:

  • df_ltr: Paths of pedestrians walking from left to right.

  • df_rtl: Paths of pedestrians walking from right to left.

Return type:

A tuple containing two DataFrames

physped.io.readers.read_parquet_from_zenodo(config: DictConfig) DataFrame[source]

Read parquet file from Zenodo using Pandas

Parameters:

config – The configuration parameters.

Returns:

DataFrame from Pandas

physped.io.readers.read_piecewise_potential(config: DictConfig) PiecewisePotential[source]
physped.io.readers.read_piecewise_potential_from_file(filepath: Path) PiecewisePotential[source]

Read piecewise potential from file.

Parameters:

filepath – Path to the file containing the piecewise potential.

Returns:

The piecewise potential.

physped.io.readers.read_trajectories(config) DataFrame[source]
physped.io.readers.read_trajectories_from_file(filepath: Path) DataFrame[source]

Read preprocessed trajectories from a csv file.

Mainly used to read intermediate outputs.

Parameters:

config – The configuration parameters.

Returns:

The preprocessed trajectory dataset.

physped.io.readers.read_utrecht_pf5_paths(config: DictConfig) DataFrame[source]

Read the Utrecht Centraal platform 5 paths data set.

The trajectories are read from local or remote sources based on the configuration. The spatial coordinates of the trajectories are converted from milimeters to meters.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Utrecht Centraal platform 5 paths.

physped.io.readers.read_utrecht_pf5_paths_4tu(config: DictConfig)[source]

Read the Utrecht Centraal platform 5 paths data set from 4TU.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Utrecht Centraal platform 5 paths

physped.io.readers.read_utrecht_pf5_paths_local(config: DictConfig)[source]

Read the Utrecht Centraal platform 5 paths data set from a local file.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with Utrecht Centraal platform 5 paths.

physped.io.readers.read_wide_corridor_paths(config: DictConfig) DataFrame[source]

Read the wide corridor data set from a local file.

Parameters:

config – The configuration parameters.

Returns:

The trajectory dataset with paths in the wide corridor.

physped.io.writers module

physped.io.writers.save_piecewise_potential(grid: PiecewisePotential, folderpath: Path, filename: str = 'piecewise_potential.pickle') None[source]

Save piecewise potential

Parameters:
  • grid – The piecewise potential to save.

  • folderpath – The folder to save the piecewise potential in.

  • filename – The filenam to save the piecewise potential in.

  • "piecewise_potential.pickle". (Defaults to)

physped.io.writers.save_trajectories(trajectories: DataFrame, folderpath: Path, filename: str) None[source]

Save trajectories

Parameters:
  • trajectories – The trajectories to save.

  • folderpath – The folder to save the trajectories in.

  • filename – The name of the file to save the trajectories in.

Module contents