Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Extracting a specific value from an unusual set of data

$
0
0

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?

This is probably easier explained by the annotated graph below, where the red dashed line is an example extraction point, and the red circle highlights the point at which I would like to extract from

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).


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>