Hi I am a newbie in awk scripting.
I'm working with a file with xy coordinates that were acquired with a time stamp. All the time stamps were recorded but not the XY coordinates. Let see an example:
FFID X Y UNIX TIME TIMEGAP
10001 469557,9 4266045,60 1386557563,76
10002 469558,32 4266046,88 1386557564,65
10003 469558,65 4266048,13 1386557565,55
10004 1386557566,45
10005 1386557567,36
10006 1386557568,25
10007 469559,82 4266051,82 1386557569,16 3,61
10008 469560,48 4266053,00 1386557570,05
10009 469561,10 4266054,12 1386557570,95
10010 469561,64 4266055,28 1386557571,85
10011 469562,00 4266056,50 1386557572,76
10012 469562,25 4266057,80 1386557573,66
10013 469562,52 4266059,11 1386557574,55
10014 1386557575,45
10015 1386557576,35
10016 1386557577,25
10017 1386557578,16
10018 469564,31 4266063,98 1386557579,06 4,51
.
.
.
.
.
What I need to implement in awk is a interpolation by time e.g:
For the gap 10004-10006 fill the X gaps with this formula
x(i) = x1 + t(i)-t(1)/timegap e.g
10004 = x(10003) + [[t(10004)-t(10003)]/3.61]
10005 = x(10003) + [[t(10005)-t(10003)/3.61]
10006 = x(10003) + [[t(10006)-t(10003)]/3.61]
where t is UNIX TIME and so one for the next gaps.
Can anyone please help me.
Thanks in advance.