bhf_smarthealth.process.gps_process

bhf_smarthealth.process.gps_process#

This module utilises functions from the parse.GPS_parser module to batch process raw GPS data

Attributes#

Functions#

process_gps_file(...)

Process an individual raw GPS .json file

process_day(in_dir, out_paths, lsoa_data, date_str)

Process a daily batch of raw GPS .json files

Module Contents#

bhf_smarthealth.process.gps_process.logger#
bhf_smarthealth.process.gps_process.process_gps_file(part_path: pathlib.Path, lsoa_data: geopandas.GeoDataFrame) → pandas.DataFrame | geopandas.GeoDataFrame[source]#

Process an individual raw GPS .json file

Parameters:
  • part_path (Path) – Path to subdirectory containing raw GPS .json file to be processed

  • lsoa_data (GeoDataFrame) – DataFrame containing reference LSOA information

Returns:

DataFrame containing the aggregated, pseudonymised LSOA data and mobility measures

Return type:

DataFrame | GeoDataFrame

Raises:

FileNotFoundError – Raised if a *_gps.json file cannot be located in this subdirectory

bhf_smarthealth.process.gps_process.process_day(in_dir: pathlib.Path, out_paths: dict[str, pathlib.Path], lsoa_data: geopandas.GeoDataFrame, date_str: str)[source]#

Process a daily batch of raw GPS .json files

Parameters:
  • in_dir (Path) – Path of the subdirectory of raw GPS data to batch process

  • out_paths (dict[str, Path]) – Dictionary of Paths (values) for the required output tables (keys)

  • lsoa_data (GeoDataFrame) – DataFrame containing reference LSOA information