0

I have a dataset of compass bearing in radians taken at random time intervals:

TimeOfRecord
1799159018.12
1799159018.12
1799159019.11
1799159019.11
1799159019.62
1799159019.62
1799159020.61
1799159020.61
1799159021.12
1799159021.12
1799159021.62
1799159021.62

Heading
3.905653879
3.905630454
3.905653879
3.905630454
3.905653879
3.905630454
4.321653879
3.905630454
5.101653879
3.905630454
5.777653879
3.905630454
5.777653879
3.905630454

and I need to linearly interpolate the Heading data in order to match location data to it that was taken in the same time period but not at the same time intervals.

Any ideas how to go about this?

martineau
  • 119,623
  • 25
  • 170
  • 301
G.Peach
  • 59
  • 2
  • 8
  • 4
    Can you demonstrate *any* effort at solving this yourself? – Scott Hunter Jan 27 '17 at 23:49
  • Here's what will eventually help: https://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html – DYZ Jan 27 '17 at 23:50
  • 1
    "Any ideas how to go about this" -> Start by googling Python and Linear Interpolation. Find some package. Try and work with that package. Could be numpy or scipy... Then come back once what you tried doesn't work. – cadolphs Jan 27 '17 at 23:51
  • Why are you trying to linearly interpolate these data anyways? Linear interpolation is rarely the way to go. – Eli Sadoff Jan 27 '17 at 23:52
  • @EliSadoff If the samples are dense and the function is smooth, there is little, if any, difference between linear and higher-order interpolation, except that the former is much faster. – DYZ Jan 27 '17 at 23:55
  • @dyz except for differentiability at the points. – Eli Sadoff Jan 27 '17 at 23:58
  • 1
    @EliSadoff The OP's task is of a very practical nature and (presumably) does not concern itself with differentiability. – DYZ Jan 28 '17 at 00:03
  • @dyz it's the heading part I'm struggling with, interpolating over a circular domain instead of the interpolation treating it as a linear domain by default – G.Peach Jan 29 '17 at 10:10

0 Answers0