aidapy.tools.sitl_parsing module

aidapy.tools.sitl_parsing.convert_sitl(file_path, specific_output_path=None)[source]

Convert the SITL report into file readable by Pandas. It is written in the formated folder.

Parameters
  • file_path (str) – File path of the SITL report.

  • specific_output_path (str) – Specific the name of the folder (in the SITL report folder) where we want to save the converted report.

aidapy.tools.sitl_parsing.generate_event_dict()[source]
aidapy.tools.sitl_parsing.generate_location_dict()[source]
aidapy.tools.sitl_parsing.generate_output_path(input_file_path, specific_output_path=None)[source]

Generate the output path where to write a new file from the path of an existing file. By default, the new output_path is in the ‘formated’ folder present in the folder of the existing file.

Parameters
  • input_file_path (str) – File path of the existing file.

  • specific_output_path (str) – Specific the name of the folder (in the SITL report folder) where we want to save the converted report.

Returns

output_path – Output path for the new files. By default, associated path to ‘formated’

Return type

str

aidapy.tools.sitl_parsing.get_info(discussion_column, category='location')[source]

Generate a list of keys (from category) from a Serie of strings.

Parameters
  • discussion_column (Series object) – Specific column from the SITL associated to the SITL discussion.

  • category (str) – Specify which category are generated (location, events, etc.)

Returns

output – A df with all the information from the SITL report. Start time, end time, the location, and the associated text.

Return type

list of XXXX

aidapy.tools.sitl_parsing.look_for(string, category=None)[source]

Look for the presence of specific patterns in the SITL comments.

Parameters

string (str) – SITL discussion string

Returns

output_key – Key associated to the identified pattern. Example: ‘ms’ if ‘magnetosphere’ has been identified in string.

Return type

str

aidapy.tools.sitl_parsing.path_leaf(path)[source]

Extract the file name from a path. If the file ends with a slash, the basename will be empty, so the function to deal with it

Parameters

path (str) – Path of the file

Returns

output – The name of the file

Return type

str

aidapy.tools.sitl_parsing.prepare_small_string(string)[source]
aidapy.tools.sitl_parsing.read_and_transform(file_name, category='location')[source]

Read the formated SITL report (preprocessed and ready to be read) as a Pandas Dataframe and add new columns (location, events, etc.)

Parameters
  • file_name (str) – File name of the cleaned and prepared SITL report.

  • category (str) – Specify which category are generated (location, events, etc.)

Returns

df – A df with all the information from the SITL report. Start time, end time, the location, and the associated text.

Return type

DataFrame object