Results Class
Results for Tough 3
- class pytoughreact.results.result_tough_3.ResultTough3(simulatortype, filelocation, filetitle=None, **kwargs)[source]
Class for processing results from Tough3
- __init__(simulatortype, filelocation, filetitle=None, **kwargs)[source]
Initialization of Parameters
- Parameters:
simulator_type (string) – Type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class
file_location (string) – Location of results file on system
file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’
kwargs (dict) –
generation (string) - if generation data exists in the results.
- check_strictly_increasing(sequence)[source]
Check for only strictly increasing data
- Parameters:
sequence (list) – list containing data
- Returns:
output – Retuns strictly increasing data
- Return type:
list
- convert_times(format_of_date)[source]
Convert time to desirable format e.g day, month, year
- Parameters:
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
processed_time_data – List of converted time
- Return type:
list
- del_index(input_list, indexes)[source]
Delete index in data
- Parameters:
input_list (list) – Input list to remove indexes
indexes (list) – indexes for which to remove data
- Returns:
input_list – List after indexes have been removed
- Return type:
list
- duplicate_index(sequence)[source]
Duplicate index in sequence
- Parameters:
sequence (list) – list containing data
- Returns:
output – Output after indexes have been duplicated
- Return type:
list
- get_coord_data(direction, timer)[source]
Get Coordinate Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
- Returns:
direction_value_output – Data for the specified direction.
- Return type:
list
- get_element_data(time, param)[source]
Get Data for elements
- Parameters:
time (float) – Time in which the data should be retrieved.
param (string) – Parameter to be derive data
- Returns:
final_element_data – Data for each of the elements.
- Return type:
list
- get_elements()[source]
Get elements from the simulation
- Returns:
elements – Elements present in the result file.
- Return type:
list
- get_generation_data(param)[source]
Get data from generation.
- Parameters:
param (string) – Parameter to be derive data
- Returns:
result_array – Results from the generation.
- Return type:
list
- get_layer_data(direction, layer_number, timer, param)[source]
Get Layer Data
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
timer (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
param (string) – Parameter to be derive data
- Returns:
layer_data_array – Data for the specified direction.
- Return type:
list
- get_number_of_layers(direction)[source]
Get Number of Layers
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
- Returns:
number_of_layers – Total number of layers.
- Return type:
int
- get_parameters()[source]
Remove space from parameters
- Returns:
parameter_list – Parameters with blanks removed.
- Return type:
list
- get_result_dictionary()[source]
Results in dictionary form
- Returns:
result_dict – Results dictionary
- Return type:
dict
- get_time_index()[source]
Get Index of Time
- Returns:
processed_time_data – Index the time
- Return type:
list
- get_times()[source]
Get times stored for duration of the simulation
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
unprocessed_time_data – Time data directly from file without processing.
- Return type:
list
- get_timeseries_data(param, gridblocknumber)[source]
Get Time series data
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
param (string) – Parameter to be derive data
- Returns:
final_timeseries_data – Time series data for particular parameter.
- Return type:
list
- get_unique_coord_data(direction, timer)[source]
Get Unique Coordinate Data
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_coordinate_data – Data for the unique coordinate.
- Return type:
list
- get_unique_x_data(timer)[source]
Get Unique X Axis Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_x_output_data – Unique data for the x axis.
- Return type:
list
- get_unique_y_data(timer)[source]
Get Unique Y Axis Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_y_output_data – Unique data for the y axis.
- Return type:
list
- get_unique_z_data(timer)[source]
Get Unique Z Axis Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_z_output_data – Unique data for the z axis.
- Return type:
list
- get_x_data(time)[source]
Get X Axis Data
- Parameters:
time (float) – Time in which the data should be retrieved.
- Returns:
output – Data for the x axis.
- Return type:
list
- get_x_depth_data(line_number, param, timer)[source]
Get X Axis And Depth Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
line_number (int) – Line number to retrieve x depth data for
param (string) – Parameter to be derive data
- Returns:
x_depth_data_array – Data for the x depth.
- Return type:
list
- get_x_start_points(timer)[source]
Get X Axis Start Point Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
indices_array – X Axis Start Point Data.
- Return type:
list
- get_y_data(time)[source]
Get Y Axis Data
- Parameters:
time (float) – Time in which the data should be retrieved.
- Returns:
output – Data for the y axis.
- Return type:
list
- get_z_data(time)[source]
Get Z Axis Data
- Parameters:
time (float) – Time in which the data should be retrieved.
- Returns:
output – Data for the z axis.
- Return type:
list
- get_z_layer_data(layer_number, param, timer)[source]
Get Z Layer Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
param (string) – Parameter to be derive data
- Returns:
z_layer_data_output – Data for the z direction.
- Return type:
list
Results for Tough React
- class pytoughreact.results.result_tough_react.ResultReact(simulator_type, file_location, file_title)[source]
Class for processing results from TOUGHREACT
- __init__(simulator_type, file_location, file_title)[source]
Initialization of Parameters
- Parameters:
simulator_type (string) – Type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class
file_location (string) – Location of results file on system
file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’
- convert_times(format_of_date)[source]
Convert time to desirable format e.g day, month, year
- Parameters:
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
processed_time_data – List of converted time
- Return type:
list
- get_coord_data(direction, timer)[source]
Get Coordinate Data
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
timer (float) – Time in which the data should be retrieved.
- Returns:
coordinate_data – Data for the unique coordinate.
- Return type:
list
- get_element_data(time, param)[source]
Get Data for elements
- Parameters:
time (float) – Time in which the data should be retrieved.
param (string) – Parameter to be derive data
- Returns:
final_element_data – Data for each of the elements.
- Return type:
list
- get_elements()[source]
Get elements from the simulation
- Returns:
grid_blocks – Elements present in the result file.
- Return type:
list
- get_layer_data(direction, layer_number, timer, param)[source]
Get Layer Data
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Z’
timer (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
param (string) – Parameter to be derive data
- Returns:
layer_data_array – Data for the specified direction.
- Return type:
list
- get_number_of_layers(direction)[source]
Get Number of Layers
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
- Returns:
number_of_layers – Total number of layers.
- Return type:
int
- get_parameters()[source]
Get Parameters from file
- Returns:
output – Parameters returned as list
- Return type:
list
- get_times()[source]
Get times stored for duration of the simulation
- Returns:
unprocessed_time_data – Time data directly from file without processing.
- Return type:
list
- get_timeseries_data(param, grid_block_number)[source]
Get Time series data
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
param (string) – Parameter to be derived from data
- Returns:
final_timeseries_data – Time series data for particular parameter.
- Return type:
list
- get_unique_coord_data(direction, timer)[source]
Get Unique Coordinate Data
- Parameters:
direction (string) – Direction to get data. Can be ‘X’, ‘Y’, ‘Z’
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_coordinate_data – Data for the unique coordinate.
- Return type:
list
- get_unique_x_data(timer)[source]
Get Unique X Axis Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_x_output_data – Unique data for the x axis.
- Return type:
list
- get_unique_y_data(timer)[source]
Get Unique Y Axis Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_x_output_data – Unique data for the y axis.
- Return type:
list
- get_unique_z_data(timer)[source]
Get Unique Z Axis Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
unique_x_output_data – Unique data for the z axis.
- Return type:
list
- get_x_data(time)[source]
Get X Axis Data
- Parameters:
time (float) – Time in which the data should be retrieved.
- Returns:
output – Data for the x axis.
- Return type:
list
- get_x_depth_data(line_number, param, timer)[source]
Get X Axis And Depth Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
line_number (int) – Line number to retrieve x depth data for
param (string) – Parameter to be derive data
- Returns:
x_depth_data_array – Data for the x depth.
- Return type:
list
- get_x_start_points(timer)[source]
Get X Axis Start Point Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
- Returns:
indices_array – X Axis Start Point Data.
- Return type:
list
- get_y_data(time)[source]
Get Y Axis Data
- Parameters:
time (float) – Time in which the data should be retrieved.
- Returns:
output – Data for the y axis.
- Return type:
list
- get_z_data(time)[source]
Get Z Axis Data
- Parameters:
time (float) – Time in which the data should be retrieved.
- Returns:
output – Data for the z axis.
- Return type:
list
- get_z_layer_data(layer_number, param, timer)[source]
Get Z Layer Data
- Parameters:
timer (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
param (string) – Parameter to be derive data
- Returns:
z_layer_data_output – Data for the z direction.
- Return type:
list
Results for Multiple Files Tough 3
- class pytoughreact.results.multi_result_tough_3.MultiResultTough3(simulator_type, file_location, file_title, prop)[source]
Class for retrieving results from multiple files for Tough3 and TMVOC
- __init__(simulator_type, file_location, file_title, prop)[source]
Initialization of Parameters
- Parameters:
simulator_type (list[string]) – List of type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class
file_location (list[string]) – List of location of results file on system
file_title (list[string]) – List of title or name of the file. Example is ‘kddconc.tec’
prop (string) – Property to be plotted. Example could be ‘portlandite’
- get_multi_element_data(grid_block_number, format_of_date)[source]
DataFrame to retrieve multi element time and results from file
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- get_multi_element_data_per_panel(grid_block_number, panels, format_of_date)[source]
DataFrame to retrieve multi element time and results from file per panel
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
panels (list[string]) – Data to be retrieved for each of the panel in the canvas
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- retrieve_data_multi_file_fixed_time(direction, time)[source]
DataFrame to retrieve time and coordinate results from file
- Parameters:
direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’
time (float) – Time in which the data should be retrieved.
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- retrieve_data_multi_file_fixed_time_layer(direction, time, layer_num)[source]
DataFrame to retrieve distance and results from file
- Parameters:
direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’
time (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- retrieve_data_multi_timeseries(grid_block_number, format_of_date='year')[source]
Function that retrieves time and timeseries results from file
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
Results for Multiple Files Tough React
- class pytoughreact.results.multi_result_tough_react.MultiResultReact(simulator_type, file_location, file_title, prop, **kwargs)[source]
Class for retrieving results from multiple files for TOUGHREACT
- __init__(simulator_type, file_location, file_title, prop, **kwargs)[source]
Initialization of Parameters
- Parameters:
simulator_type (list[string]) – List of type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be toughreact for this class
file_location (list[string]) – List of location of results file on system
file_title (list[string]) – List of title or name of the file. Example is ‘kddconc.tec’
prop (string) – Prperty to be plotted. Example could be ‘portlandite’
kwargs (dict) – Extra property for processing. Takes in x_slice_value as a float to know at what point to slice the data on the x axis.
- get_multi_element_data(grid_block_number, format_of_date='year')[source]
DataFrame to retrieve multi element time and results from file
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- get_multi_file_distance(direction_x, direction_y, time, layer_num)[source]
DataFrame to retrieve multi element time and results from multiple files
- Parameters:
direction_x (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’
direction_y (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’
time (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- get_multi_prop_distance(direction_x, direction_y, time, layer_num)[source]
DataFrame to retrieve multi element time and results from file for properties
- Parameters:
direction_x (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’
direction_y (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’
time (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- retrieve_data_multi_file_fixed_time(direction, time)[source]
DataFrame to retrieve time and coordinate results from file
- Parameters:
direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’
time (float) – Time in which the data should be retrieved.
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- retrieve_data_multi_file_fixed_time_layer(direction, time, layer_num)[source]
DataFrame to retrieve distance and results from file
- Parameters:
direction (string) – Direction of retrieval. Can be ‘X’, ‘Y’ or ‘Z’
time (float) – Time in which the data should be retrieved.
layer_num (int) – Layer number in which to retrieve data
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
- retrieve_data_multi_timeseries(grid_block_number, format_of_date='year')[source]
Function that retrieves time and timeseries results from file
- Parameters:
grid_block_number (int) – The grid block number for which to retrieve the results
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- Returns:
data_table – Dataframe with requested output
- Return type:
pd.Dataframe
Results for Single Files
- class pytoughreact.results.result_single.FileReadSingle(simulatortype, filelocation, filetitle, **kwargs)[source]
Class for processing single file results
- __init__(simulatortype, filelocation, filetitle, **kwargs)[source]
Initialization of Parameters
- Parameters:
simulator_type (string) – Type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class
file_location (string) – Location of results file on system
file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’
kwargs (dict) –
generation (string) - if generation data exists in the results.
restart_files (list[string]) - if restart files exist in the results
experiment (list[strings]) - location of experiment results if available
x_slice_value (integer) - if the plot should be sliced on the x axis
- plot_2d(direction1, direction2, param, timer, grid_type='plain')[source]
Make 2D plot either gridded or not gridded
- Parameters:
direction1 (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’
direction2 (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’
param (string) – Parameter to be plotted
grid_type (string) – Shows if plot should contain grids or not. Options are ‘grid’ and ‘plain’
timer (float) – Time in which the data should be retrieved.
- plot_param_with_layer(direction_x_axis, direction_y_axis, param, layer_num, time)[source]
Make Plot of parameter with layer
- Parameters:
direction_x_axis (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’
direction_y_axis (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’
param (string) – Parameter to be plotted
layer_num (int) – Layer number in which to retrieve data
time (float) – Time in which the data should be retrieved.
- plot_param_with_param(param1, param2, gridblocknumber)[source]
Make Plot of parameter with parameter
- Parameters:
grid_block_number (int) – The grid block number in mesh for which to retrieve the results
param1 (string) – First Parameter to be plotted on x axis
param2 (string) – Second Parameter to be plotted on x axis
- plot_time(param, gridblocknumber, format_of_date='year', labels=None, single_plot=False, style='horizontal', width=12, height=8)[source]
Make Plot of parameter with time
- Parameters:
gridblocknumber (int) – The grid block number in mesh for which to retrieve the results
param (string) – Parameter to be plotted
format_of_date (string) – Provides information to the method on format of the date. For example. year, hour, min or seconds
labels (string) – Labels for the plot (Title)
singlePlot (boolean) – If single plot should be made or multiple plots
style (string) – Orientation of plot (should be ‘vertical’ or ‘horizontal)
width (int) – width of plot
height (int) – height of plot
Results for Multiple Files
- class pytoughreact.results.result_multiple.FileReadMultiple(simulator_type, file_locations, file_titles, props, **kwargs)[source]
Class for processing multiple file results
- __init__(simulator_type, file_locations, file_titles, props, **kwargs)[source]
Initialization of Parameters
- Parameters:
simulator_type (string) – List of type of simulator being run. Can either be ‘tmvoc’, ‘toughreact’ or ‘tough3’. Should be tough3 for this class
file_location (list[string]) – List of location of results file on system
file_title (list[string]) – List of title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’
prop (list[string]) – Properties to be plotted. Example could be ‘portlandite’
kwargs (dict) –
x_slice_value (integer) - if the plot should be sliced on the x axis
per_file (boolean) - if the plot should be made per file and not per property
title (list of strings) - title of each of the plots
- plot_param_with_layer(direction_x, direction_y, layer_num, time, legend)[source]
Plot of Parameter with Layer
- Parameters:
direction_x (string) – Direction to be plotted on the X axis. Can be ‘X’, ‘Y’, ‘Z’
direction_y (string) – Direction to be plotted on the Y axis. Can be ‘X’, ‘Y’, ‘Z’
layer_num (int) – Layer number in which to retrieve data
time (float) – Time in which the data should be retrieved.
legend (list[string]) – List of titles for the legend of the plot
- plot_time(grid_block_number, legend, plot_kind='property', format_of_date='day')[source]
Plot selected parameter on y axis and time on x axis
- Parameters:
grid_block_number (int) – The grid block number in mesh for which to retrieve the results
legend (list[string]) – List of titles for the legend of the plot
plot_kind (string) – If the plot should be made based on property or based on files
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
- plot_time_per_panel(grid_block_number, panels, format_of_date='day')[source]
Plot Multiple plots in a panel
- Parameters:
grid_block_number (int) – The grid block number in mesh for which to retrieve the results
panels (list[string]) – Data to be retrieved for each of the panel in the canvas
format_of_date (str) – Provides information to the method on format of the date. For example. year, hour, min or seconds
Results for Experimental Data
- class pytoughreact.results.simple_experiment_data.Experiment(filelocation, filetitle)[source]
- __init__(filelocation, filetitle)[source]
Initialization of Parameters
- Parameters:
file_location (string) – Location of results file on system
file_title (string) – Title or name of the file. Example is ‘kddconc.tec’ or ‘OUTPUT.csv’
- get_column_names()[source]
Get column names from data table
- Returns:
column_names – column names in file
- Return type:
list
- get_times()[source]
Get times stored for duration of the simulation
- Returns:
unprocessed_time_data – Time data directly from file without processing.
- Return type:
list