7. Visualisation Module#
This module contains the plot functions of BuckPy result files.
- buckpy.buckpy_visualisation.assembly_dataframe_bend_sleeper_ilt(df)[source]#
Read the route bend data from the BuckPy input file and select the KP of the ‘Bend’, ‘Sleeper’, ‘RCM’ and ‘ILT’ from the ‘Route Type’ column.
- Parameters:
df (pandas DataFrame) – DataFrame containing the data in the ‘Route’ tab.
- Returns:
df1 (pandas DataFrame) – DataFrame containing the ‘Bend’ route type data.
df2 (pandas DataFrame) – DataFrame containing the ‘Sleeper’ route type data.
df3 (pandas DataFrame) – DataFrame containing the ‘RCM’ route type data.
df4 (pandas DataFrame) – DataFrame containing the ‘ILT’ route type data.
- buckpy.buckpy_visualisation.assembly_dataframe_plot(df_sets, df_pps)[source]#
Assemble the dataframes on the probabilistic results and post-processing input data from BuckPy.
- Parameters:
df_sets (pandas DataFrame) – DataFrame containing the output data in the ‘Sets’ tab.
df_pps (pandas DataFrame) – DataFrame containing the input data in the ‘Post-Processing’ tab.
- Returns:
df – DataFrame containing the doubled rows of KP and results.
- Return type:
pandas DataFrame
- buckpy.buckpy_visualisation.assembly_double_rows(df)[source]#
Double each row of the dataframe based on KP.
- Parameters:
df (pandas DataFrame) – DataFrame containing the KP and results.
- Returns:
df – DataFrame containing the doubled rows of KP and results.
- Return type:
pandas DataFrame
- buckpy.buckpy_visualisation.plot_bend_sleeper_ilt(a1, df1, df2, df3, df4, y_max)[source]#
Plot route bend, sleeper and ILT.
- Parameters:
a1 (Matplotlib plot) – Axis of the Matplotlib plot.
df1 (pandas DataFrame) – Dataframe containing the locations of the route bends.
df2 (pandas DataFrame) – Dataframe containing the locations of sleepers.
df3 (pandas DataFrame) – Dataframe containing the locations of RCMs.
df4 (pandas DataFrame) – Dataframe containing the locations of ILTs.
- buckpy.buckpy_visualisation.plot_buckpy(work_dir, input_file_name, pipeline_id, scenario_no, bl_verbose=False)[source]#
Plot the probabilistic buckling results from BuckPy result files.
- Parameters:
work_dir (str) – The working directory where the analysis files are located.
input_file_name (str) – The name of the input file.
pipeline_id (str) – Identifier of the pipeline.
scenario_no (int) – The scenario number.
- buckpy.buckpy_visualisation.plot_results(file_name, df_no_buckles, df_force_profiles, df_bends, df_sleepers, df_rcms, df_ilts, df_set_pps)[source]#
Plot probabilistic results of BuckPy in 6 subplots: Row 1: unbuckled EAF, Number of Buckles, VAS; Row 2: buckled EAF, Probobality of Buckling, Friction.
- Parameters:
file_name (str) – The name of the output image file.
df_no_buckles (pandas DataFrame) – DataFrame containing the data related to the number of buckles.
df_force_profiles (pandas DataFrame) – DataFrame containing the force profile data.
df_bends (pandas DataFrame) – DataFrame containing the ‘Bend’ route type data.
df_sleepers (pandas DataFrame) – DataFrame containing the ‘Sleeper’ route type data.
df_rcms (pandas DataFrame) – DataFrame containing the ‘RCM’ route type data.
df_ilts (pandas DataFrame) – DataFrame containing the ‘ILT’ route type data.
df_set_pps (pandas DataFrame) – DataFrame containing the doubled rows of KP and results from ‘Sets’ and ‘Post-Processing’ tabs.
- buckpy.buckpy_visualisation.read_input(work_dir, input_file_name, pipeline_id, scenario_no)[source]#
Read the route bend and post-processing data from the BuckPy input file and select the data for the current scenario.
- Parameters:
work_dir (str) – The working directory where the analysis files are located.
input_file_name (str) – The name of the input file.
pipeline_id (str) – Identifier of the pipeline.
scenario_no (int) – The scenario number.
- Returns:
df_routes (pandas DataFrame) – DataFrame containing the data in the ‘Route’ tab.
df_pps (pandas DataFrame) – DataFrame containing the data in the ‘Post-Processing’ tab.
- buckpy.buckpy_visualisation.read_output(output_file_name)[source]#
Read the data from the BuckPy result file.
- Parameters:
output_file_name (string) – File path of the BuckPy result file.
- Returns:
df_sets (pandas DataFrame) – DataFrame containing the data in the ‘Sets’ tab.
df_buckle (pandas DataFrame) – DataFrame containing the data related to the number of buckles.
df_force_prof (pandas DataFrame) – DataFrame containing the force profile data.