# Example: Smoothing the 12C signal from one TDL valve using a spline fit
tdl_file <- read_gasex_file(
PhotoGEA_example_file_path('tdl_sampling_1.dat'),
'TIMESTAMP'
)
tdl_file <- identify_tdl_cycles(
tdl_file,
valve_column_name = 'valve_number',
cycle_start_valve = 20,
expected_cycle_length_minutes = 2.7,
expected_cycle_num_valves = 9,
timestamp_colname = 'TIMESTAMP'
)
spline_smoothing_function <- function(Y, X) {
ss <- smooth.spline(X, Y)
return(ss$y)
}
spline_smoothed_tdl_file <- smooth_tdl_data(
tdl_file, 'Conc12C_Avg', 'valve_number', 20, spline_smoothing_function
)
Run the code above in your browser using DataLab