Skip to content
Snippets Groups Projects
Commit 378dcb7e authored by jay's avatar jay
Browse files

Finishing the merge cleanly

parent 932c3591
No related branches found
No related tags found
No related merge requests found
<<<<<<< HEAD import numpy as np
import math
=======
>>>>>>> upstream/master
import numpy as np
import pandas as pd import pandas as pd
def read_gpf(input_data): def read_gpf(input_data):
...@@ -47,9 +43,7 @@ def read_gpf(input_data): ...@@ -47,9 +43,7 @@ def read_gpf(input_data):
assert int(cnt) == len(df) assert int(cnt) == len(df)
return df return df
<<<<<<< HEAD
=======
def save_gpf(df, output_file): def save_gpf(df, output_file):
""" """
Write a socet gpf file from a gpf-defined pandas dataframe Write a socet gpf file from a gpf-defined pandas dataframe
...@@ -61,7 +55,7 @@ def save_gpf(df, output_file): ...@@ -61,7 +55,7 @@ def save_gpf(df, output_file):
output_file : str output_file : str
path to the output data file path to the output data file
Returns Returns
------- -------
int : success value int : success value
...@@ -74,10 +68,10 @@ def save_gpf(df, output_file): ...@@ -74,10 +68,10 @@ def save_gpf(df, output_file):
except: except:
print ('Unable to open output gpf file: {0}'.format(output_file)) print ('Unable to open output gpf file: {0}'.format(output_file))
return 1 return 1
#grab number of rows in pandas dataframe #grab number of rows in pandas dataframe
numpts = len(df) numpts = len(df)
#Output gpf header #Output gpf header
outGPF.write('GROUND POINT FILE\n') outGPF.write('GROUND POINT FILE\n')
outGPF.write('{0}\n'.format(numpts)) outGPF.write('{0}\n'.format(numpts))
...@@ -89,7 +83,6 @@ def save_gpf(df, output_file): ...@@ -89,7 +83,6 @@ def save_gpf(df, output_file):
outGPF.write('{0} {1} {2}\n'.format(row['lat_y_North'], row['long_X_East'], row['ht'])) outGPF.write('{0} {1} {2}\n'.format(row['lat_y_North'], row['long_X_East'], row['ht']))
outGPF.write('{0} {1} {2}\n'.format(row['sigma0'], row['sigma1'], row['sigma2'])) outGPF.write('{0} {1} {2}\n'.format(row['sigma0'], row['sigma1'], row['sigma2']))
outGPF.write('{0} {1} {2}\n\n'.format(row['res0'], row['res1'], row['res2'])) outGPF.write('{0} {1} {2}\n\n'.format(row['res0'], row['res1'], row['res2']))
outGPF.close() outGPF.close()
return 0 return
>>>>>>> upstream/master
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment