I have time-series data - Temperature Vs Time. The temperature raises during regular intervals and stays high for some time before returning to a normal value as shown below. I would like to identify each cluster of points (high temperature) and compute the median temperature for each cluster. What would be an effective algorithm to do this? I am using python. Thanks.
1 Answer
This may not be the final algorithm you'd want to use, but I think you could at least start with this:
- Identify a cutoff temperature, say, 110.
- Identify contiguous groups of temperatures above the 110. Might want to ensure that such a group has more than some predetermined number of data points in it, such as 10.
- For each contiguous group, compute its median.
I do have a question, though: if time truly is in seconds, and the temperatures you're recording here are in Fahrenheit, Celsius, Rankine, or Kelvins, what is the mass of the object whose temperature you're recording? In my experience, having such large temperature swings in that short an amount of time is extremely rare in most physical situations.