Question
I have this file with dates and accumulated goals (scored by Messi) and I want to add new records every 3 days (for example). How can I do it?
cat << EOF > goles.txt
2004-01-18 1
2004-02-08 2
2004-03-03 5
EOF
Desired output (done with vlookupt in excel)
2004-01-18T00:00:00 1
2004-01-21T00:00:00 1
2004-01-24T00:00:00 1
2004-01-27T00:00:00 1
2004-01-30T00:00:00 1
2004-02-02T00:00:00 1
2004-02-05T00:00:00 1
2004-02-08T00:00:00 2
2004-02-11T00:00:00 2
2004-02-14T00:00:00 2
2004-02-17T00:00:00 2
2004-02-20T00:00:00 2
2004-02-23T00:00:00 2
2004-02-26T00:00:00 2
2004-02-29T00:00:00 2
2004-03-03T00:00:00 5
What I have try
I try to interpolate with sample1d and nearest point. It is wrong because it says that are goals.
Obviously it does not work because it finds the closest point. You would need an interpolation method that uses the previous values regardless of the distance until the new value appears.
`gmt sample1d goles.txt -fT --TIME_UNIT=d -I3 -Fn > goles_Fn.txt.
2004-01-18T00:00:00 1
2004-01-21T00:00:00 1
2004-01-24T00:00:00 1
2004-01-27T00:00:00 1
2004-01-30T00:00:00 2 # Here 2 is wrong
2004-02-02T00:00:00 2
2004-02-05T00:00:00 2 # Until here.
2004-02-08T00:00:00 2
2004-02-11T00:00:00 2
2004-02-14T00:00:00 2
2004-02-17T00:00:00 2
2004-02-20T00:00:00 5 # Here 5 is wrong
2004-02-23T00:00:00 5
2004-02-26T00:00:00 5
2004-02-29T00:00:00 5 # Until here
2004-03-03T00:00:00 5
Context:
The file would use as timefile for Movie an the the second column would be use for the label as shown here.