Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code enhancements and test data for file mode geoid interpolation #89

Merged
merged 2 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dynadjust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ if (BUILD_TESTING)
add_test (NAME geo-interpolate-01 COMMAND $<TARGET_FILE:dnageoidwrapper> -g ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network-geoid.gsb --interactive --latitude -36.3348253617 --longitude 145.5741006771)
add_test (NAME geo-interpolate-02 COMMAND $<TARGET_FILE:dnageoidwrapper> -g ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network-geoid.gsb --interactive --latitude -36.2704890597 --longitude 146.4809871537 --interpolation-method 0)
add_test (NAME geo-interpolate-03 COMMAND $<TARGET_FILE:dnageoidwrapper> -g ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network-geoid.gsb --summary)
add_test (NAME geo-interpolate-04 COMMAND $<TARGET_FILE:dnageoidwrapper> --version)
add_test (NAME geo-interpolate-05 COMMAND $<TARGET_FILE:dnageoidwrapper> -g ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network-geoid.gsb -t ${CMAKE_SOURCE_DIR}/../sampleData/geoid-points-dat.txt)
add_test (NAME geo-interpolate-06 COMMAND $<TARGET_FILE:dnageoidwrapper> -g ${CMAKE_SOURCE_DIR}/../sampleData/gnss-network-geoid.gsb -t ${CMAKE_SOURCE_DIR}/../sampleData/geoid-points-csv.csv)

# bash command to check results
add_test (NAME test-gnss-network COMMAND bash -c "diff <(tail -n +53 gnss.simult.adj) <(tail -n +53 ${CMAKE_SOURCE_DIR}/../sampleData/gnss.simult.adj.expected)")
Expand Down
7 changes: 6 additions & 1 deletion dynadjust/dynadjust/dnageoidwrapper/dnageoidwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,12 @@ bool InterpolateGridPointFile(dna_geoid_interpolation* g, const char* inputfileP
{
path inputFile(inputfilePath);
if (inputFile.has_extension())
outputfilePath = inputFile.parent_path().string() + inputFile.stem().string() + "_out" + inputFile.extension().string();
{
if (inputFile.parent_path().empty())
outputfilePath = inputFile.stem().string() + "_out" + inputFile.extension().string();
else
outputfilePath = inputFile.parent_path().string() + "/" + inputFile.stem().string() + "_out" + inputFile.extension().string();
}
else
{
outputfilePath = inputfilePath;
Expand Down
16 changes: 16 additions & 0 deletions sampleData/geoid-points-csv.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
a,-10.498408428,153.001072611,100.00, Outside the grid limits
b,-36.3348253617,145.5741006771,100.00, Valid point
c,-37.624636162,,100.000, No longitude
,,144.210,100.0, No latitude
,-36.334820,145.574100,
d, -97.595974127, 164.206007396, Invalid latitude
e, -37.610172924, -144.213914283, Outside the grid limits
211300470, -36.3348253617, 145.5741006771, 172.193, BENALLA PM 47
211300940, -36.3238821312, 145.5821570921, 167.563, BENALLA PM 94
211301000, -36.3353281708, 145.5821278516, 171.502, BENALLA PM 100
211301080, -36.3308068703, 145.5854626679, 169.942, BENALLA PM 108
211301110, -36.3259313985, 145.5932297805, 170.208, BENALLA PM 111
211301630, -36.3219294809, 145.5958131466, 169.421, BENALLA PM 163
220700210, -36.5740496878, 145.4736891210, 332.233, BORODOMANIN PM 21
222000390, -36.4508400411, 145.3332108846, 171.931, BRANJEE PM 39
222701160, -36.4342838852, 146.5807975413, 311.928, BRIGHT PM 116
16 changes: 16 additions & 0 deletions sampleData/geoid-points-dat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
a -10.498408428 153.001072611 100.00 Outside the grid limits
b -36.3348253617 145.5741006771 100.00
c -37.624636162 100.000 No longitude
144.210 100.0 No latitude
-36.334820 145.574100
d -97.595974127 164.206007396 Invalid latitude
e -37.610172924 -144.213914283 Outside the grid limits
211300470 -36.3348253617 145.5741006771 172.193 BENALLA PM 47
211300940 -36.3238821312 145.5821570921 167.563 BENALLA PM 94
211301000 -36.3353281708 145.5821278516 171.502 BENALLA PM 100
211301080 -36.3308068703 145.5854626679 169.942 BENALLA PM 108
211301110 -36.3259313985 145.5932297805 170.208 BENALLA PM 111
211301630 -36.3219294809 145.5958131466 169.421 BENALLA PM 163
220700210 -36.5740496878 145.4736891210 332.233 BORODOMANIN PM 21
222000390 -36.4508400411 145.3332108846 171.931 BRANJEE PM 39
222701160 -36.4342838852 146.5807975413 311.928 BRIGHT PM 116