Created
August 11, 2014 04:48
-
-
Save lemenkov/62a483ba6c09b6cdbe80 to your computer and use it in GitHub Desktop.
Process geodata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
Data = [] | |
Reader = csv.reader(open('data.txt', 'rb'), delimiter=' ',quoting=csv.QUOTE_NONE) | |
for row in Reader: | |
Data += [(row[0], row[2], int(float(row[0])), float(row[2]))] | |
i = 0 | |
while i < len(Data) - 1: | |
print Data[i][2], Data[i][1] | |
diff = Data[i+1][2] - Data[i][2] | |
skew = (Data[i+1][3] - Data[i][3])/diff | |
j = 1 | |
while j < diff: | |
print Data[i][2]+j, "%.6f" % (Data[i][3]+(skew*j)) | |
j += 1 | |
i += 1 | |
print Data[i][2], Data[i][1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment