catalight.analysis.irdata.IRData
- class catalight.analysis.irdata.IRData(IR_data_path)
Bases:
objectIR camera data and associated processing methods.
IRData compiles and acts on the data collected by a FLIR infrared camera. In the current state, this class loads in a csv file of specific format representing the mean/max temperature of an ROI representing the catalysts. This is a developmental script and may change in future iterations of catalight
- __init__(IR_data_path)
Initiate IR camera data class using file location.
On init, this calls
import_data()andremove_dropped_frames()- Parameters:
IR_data_path (str) – full path string to filepath. Should be csv file.
Methods
__init__(IR_data_path)Initiate IR camera data class using file location.
compute_avg_surface_temps(expts[, ...])Computes the average surface temperatures during experiments.
import_data(IR_data_path)Import IR cam data as a csv using
read_csv().plot_averaging([rezero])Plots results of temporal averaging of surface temp data.
Plots the raw and filtered data.
remove_dropped_frames([column_name, ...])Attemps to remove odd frames that are sometimes captured.
rezero_time_axis(t0)Adds new relative time to surface temp data sets starting a t0.
Attributes
Uneditted data from csv imported with
import_data()Filtered data after
remove_dropped_frames()Avg surface temperatures for each experiment step.
Date format used in the imported csv data.
- avg_surface_temps
Avg surface temperatures for each experiment step.
Computed after running the
compute_avg_surface_temps()method.- Type:
- compute_avg_surface_temps(expts, measurement_range=20)
Computes the average surface temperatures during experiments.
Imports a list of catalight experiments. Uses the start time of the experiment and the abstime column of the imported IR camera data to determine the time averaged surface temperature of catalyst.
All experiments will have a new attribute “surface_temps” added to it. “surface_temps is a python
dictwith keys “max” and “min” the value for each key is a list of time averaged temperatures for each step of the experiment.- Parameters:
expts (list[
Experiment]) –List of catalight experiments to perform analysis on.
All experiments will have a new attribute “surface_temps” added to it. “surface_temps is a python
dictwith keys “max” and “min” the value for each key is a list of time averaged temperatures for each step of the experiment.measurment_range (int or float) – [minutes] Length of time to average temp on each expt step.
- filtered_data
Filtered data after
remove_dropped_frames()- Type:
- import_data(IR_data_path)
Import IR cam data as a csv using
read_csv().data format should have [“abstime”, “reltime”, max temp, mean temp] The names of columns -1 and -2 are converted to ‘surface temperature - mean’ and ‘surface temperature - max’, respectively
- Parameters:
IR_data_path (str) – Full path to IR cam data as a csv file
- plot_averaging(rezero=True)
Plots results of temporal averaging of surface temp data.
The point of this function is so that the user can verify whether the IR camera data is being temporally averaged in a satisfactory way. If called with rezero set to True, the user will be able to redefine the start point of the “experimental study” to not plot the full data collection range.
- Parameters:
rezero (bool, optional) – If true, ask user to click new time = zero point, by default True
- plot_raw_data()
Plots the raw and filtered data.
Plot the raw and filtered data such that the user can verify if the filtering is satisfactory.
- Returns:
Figure and axes handles for graphic.
- Return type:
~matplotlib.figure.Firgure, ~matplotlib.axes.Axes
- raw_data
Uneditted data from csv imported with
import_data()- Type:
- remove_dropped_frames(column_name='surface temperature - mean', window_size=50, threshold=10)
Attemps to remove odd frames that are sometimes captured.
Drop frames that fall “threshold” away from the mean using rolling mean.
- Parameters:
column_name (str, optional) – name of the column to use for computing the rolling mean and dropping frames, by default ‘surface temperature - mean’
window_size (int, optional) – number of datapoint to use when computing rolling mean, by default 50
threshold (int, optional) – Degrees K to count as a normal deviation from the rolling mean. A variation larger than this is considered a “dropped” frame that was incorrectly measured by IR camera, by default 10
- rezero_time_axis(t0)
Adds new relative time to surface temp data sets starting a t0.
Add the column “graph_time” to
raw_dataandfiltered_dataand adds [‘t1 - rel’] and [‘t2 - rel’] columns toavg_surface_temps. These new time values are relative times in which time zero starts at t0.This time rezeroing can be performed by calling
plot_averaging()- Parameters:
t0 (pandas.Timestamp) – Pandas timestamp for the t0 value