From 4e8ed38bfa11620912dcbe9c6f9e69425e55d7e7 Mon Sep 17 00:00:00 2001 From: "David P. Mayer" <dpmayer@usgs.gov> Date: Fri, 9 Feb 2018 08:03:10 -0700 Subject: [PATCH] Typo fixes in io_gpf.py (#22) * Typo fixes in io_gpf.py. Column labels now match case of headers in Socet Set spec for GPF files. * More typo fixes for GPF column labels in IO script and test data --- plio/examples/SocetGXP/InSightE08_XW.csv | 2 +- plio/io/io_gpf.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plio/examples/SocetGXP/InSightE08_XW.csv b/plio/examples/SocetGXP/InSightE08_XW.csv index 29e9480..187caf9 100644 --- a/plio/examples/SocetGXP/InSightE08_XW.csv +++ b/plio/examples/SocetGXP/InSightE08_XW.csv @@ -1,4 +1,4 @@ -point_id,stat,known,lat_y_North,long_X_East,ht,sigma0,sigma1,sigma2,res0,res1,res2 +point_id,stat,known,lat_Y_North,long_X_East,ht,sigma0,sigma1,sigma2,res0,res1,res2 1,1,1,0.08538133869186999,2.38013146162178,-2697.2374469465,0.0,0.0,1.707214,16.348041000000002,-13.917623,-0.151001 2,1,1,0.08508542650082002,2.3808135855714703,-2702.0,0.0,0.0,1.0,15.983285999999998,-16.869508,0.103341 3,1,1,0.08626480095809,2.3870838392611,-2714.16003756809,0.0,0.0,3.828854,12.831839,-34.360639,-2.2058459999999998 diff --git a/plio/io/io_gpf.py b/plio/io/io_gpf.py index 4d34930..ae507ea 100644 --- a/plio/io/io_gpf.py +++ b/plio/io/io_gpf.py @@ -13,7 +13,7 @@ def read_gpf(input_data): Returns ------- df : pd.DataFrame - containing the gfp data with appropriate column names and indices + containing the gpf data with appropriate column names and indices """ # Check that the number of rows is matching the expected number @@ -32,7 +32,7 @@ def read_gpf(input_data): #TODO: cols should be used to dynamically generate the column names df = pd.DataFrame(d, columns=['point_id', 'stat', 'known', - 'lat_y_North', 'long_X_East','ht', + 'lat_Y_North', 'long_X_East','ht', 'sigma0', 'sigma1', 'sigma2', 'res0', 'res1', 'res2']) @@ -80,7 +80,7 @@ def save_gpf(df, output_file): for index,row in df.iterrows(): #Output coordinates to gpf file outGPF.write('{0} {1} {2}\n'.format(row['point_id'], row['stat'], row['known'])) - 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\n'.format(row['res0'], row['res1'], row['res2'])) -- GitLab