Finding specific points in data array

In summary, the conversation discusses using a function to calculate a moving average for noisy data and finding the corresponding temperature value at a given time. Different options for handling time values that fall in between the set time points are mentioned, such as extrapolation or interpolation.
  • #1
lee403
16
1
I have this really noisy data and I'm wanting to plot Temperature v. Time. I used this function to calculate a moving average. Here's some sample code.

Python:
BA1='ANP-Heat-BA1.csv'

#Time Trial 1
time1=pd.read_csv(BA1,skiprows=0)
time1=time1['Time(s)']

#Temperature 
tmp1=pd.read_csv(BA1,skiprows=0)
tmp1=tmp1['Temp']

def movingaverage (values, window):
    weights = np.repeat(1.0, window)/window
    sma = np.convolve(values, weights, 'valid')
    return sma
   
tmp1MA=movingaverage(tmp1, 10)

p.plot(time1[len(time1)-len(tmp1MA):],tmp1MA)

The moving average function seems to work fine at removing some of the random noise, but now I want to find the point in the array tmp1MA that corresponds to a given time1 value. For example, I would like be able to find the averaged temperature at time 500.
 
  • #3
Hey lee403.

You'd have to define a model and then look at the expectation of that random variable.

What model are you using?
 
  • #4
You have the moving average values, MAi for a specific set of time points ti. Any particular value of time, t, might be exactly one of the ti values, or in between two ti values or above all of the tis or below all of the tis.

There are a few things you need to decide. Do you want to extrapolate above or use the value of the highest ti? Same question for t below the lowest ti. Do you want to linearly interpolate for between tis or fit a polynomial and use that? You can also do a spline fit to the values and evaluate the spline at t.
 

What is the purpose of finding specific points in a data array?

The purpose of finding specific points in a data array is to identify and extract particular values or elements from a larger set of data. This can help with data analysis and decision making in scientific research.

What are some common methods for finding specific points in a data array?

Common methods for finding specific points in a data array include using indexing or keying functions, sorting algorithms, and data visualization techniques.

How do you determine the best approach for finding specific points in a data array?

The best approach for finding specific points in a data array will depend on the size and complexity of the data set, as well as the goals of the analysis. It is important to consider the efficiency, accuracy, and interpretability of different methods before selecting one.

What challenges may arise when finding specific points in a data array?

Some challenges that may arise when finding specific points in a data array include dealing with missing or incomplete data, identifying and handling outliers or anomalies, and balancing between precision and generalizability of the results.

How can finding specific points in a data array contribute to scientific discoveries?

By finding specific points in a data array, scientists can uncover patterns, relationships, and trends that may not be obvious at first glance. This can lead to new insights and discoveries in various fields of science.

Similar threads

Replies
3
Views
766
  • Programming and Computer Science
Replies
11
Views
994
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Programming and Computer Science
Replies
10
Views
25K
  • General Math
Replies
1
Views
731
  • Calculus
Replies
3
Views
1K
  • Programming and Computer Science
Replies
1
Views
932
  • Programming and Computer Science
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
Replies
1
Views
1K
Back
Top