read_data

process_ais_data.read_data(csv_files, options, grid_params)

Iterate through each csv file to segregate each trajectory by its mmsi id.

Reads each csv in csv_files to obtain coordinates and timestamp series associated with each mmsi id encountered.

Optionally, the boundaries of the grid later specified can be inferred by calculating the minimum and maximum longitudes and latitudes by setting options['bound_lon'] and options['bound_lat'] to False, respectively in the config_file.

It can also be specified to only read the first options['max_rows'] of each csv file by setting options['limit_rows'] to True in the config_file.

Parameters
  • csv_files (list) – Paths to all valid csv files found.

  • options (dict) – The script options specified in the config_file.

  • grid_params (dict) – The grid parameters specified in the config_file.

Returns

A pandas DataFrame of all data entries with the format ['MMSI', 'LON', 'LAT', 'TIME'] and a dictionary that specifies the minimum and maximum latitudes and longitudes in the dataset.

Return type

tuple