From x-y data, I'm extracting the x-value once the y-value meets a threshold criteria using a simple function, which works.
However, the issue is that the experimental data sometimes reduces negatively due to the experimental samples, which complicates things! This results in the extracted value being less than the real performance of the sample.
Is there a way to interpolate/impose a criteria which checks that if the previous x-value is higher than the extracted value, to work back to the last x-value which doesn't meet this criteria?
Currently, this is the code and function that I'm using to plot and extract the values for each .csv file used:
This results in extraction of values along the horizontal line shown in the image.
def find_correspond(x_array, y_array, threshold): for x, y in zip(x_array, y_array): if y > threshold: return x return None
It is possible to brute force this by reducing the threshold value to lower points, however due to the variation between samples, this results in innacurate readings below the noise floor of the equipment (i.e. in the jagged bit of the curve).