Interpolation with two conditions

144 Views Asked by At

I have two towns. For the town1 I have hourly temperatures throughout the whole day for the whole year. For the town2 I have temperatures at 07:00, 14:00, 22:00. That looks something like this:

Time                  Town1    Town2
01.01.2017. 00:00     -4
01.01.2017. 01:00     -4
01.01.2017. 02:00     -5
01.01.2017. 03:00     -7
01.01.2017. 04:00     -6
01.01.2017. 05:00     -5 
01.01.2017. 06:00     -6
01.01.2017. 07:00     -7        -2 
01.01.2017. 08:00     -7
01.01.2017. 09:00      2
01.01.2017. 10:00      4
01.01.2017. 11:00      5
01.01.2017. 12:00      6
01.01.2017. 13:00      8
01.01.2017. 14:00      9         12
01.01.2017. 15:00      9
01.01.2017. 16:00      5
01.01.2017. 17:00      4
01.01.2017. 18:00      1
01.01.2017. 19:00      0
01.01.2017. 20:00     -3
01.01.2017. 21:00     -4
01.01.2017. 22:00     -4        -1
01.01.2017. 23:00     -5  

So I would like to interpolate missing values for the town2. I can do linear interpolation between 07:00 and 14:00, between 14:00 and 22:00, and between 22:00 and 07:00. But I would also like to include the data that I have for the town1, because I think it would be more accurate that way.
Is it possible to include both criteria?