Giter VIP home page Giter VIP logo

garpos's Introduction

GARPOS

"GARPOS" (GNSS-Acoustic Ranging combined POsitioning Solver) is an analysis tool for GNSS-Acoustic seafloor positioning.

Version

Latest version is GARPOS v1.0.1 (Apr. 5. 2022)

Major change(s)

  • v1.0.1: to set B-spline's knots by time interval (also need to change "Setup.ini" file)
  • v1.0.1: to use Cholesky decomposition (module "sksparse" is needed)
    • NOTE: some reported that "sksparse" cannot be used on Apple M1 Chip.

Citation

for methodology

Watanabe, S., Ishikawa, T., Yokota, Y., & Nakamura, Y. (2020). GARPOS: analysis software for the GNSS-A seafloor positioning with simultaneous estimation of sound speed structure, Front. Earth Sci. (https://doi.org/10.3389/feart.2020.597532).

for code

Shun-ichi Watanabe, Tadashi Ishikawa, Yuto Nakamura & Yusuke Yokota. (2022). GARPOS: Analysis tool for GNSS-Acoustic seafloor positioning (Version 1.0.1). Zenodo. (https://doi.org/10.5281/zenodo.6414642)

Corresponding author

License

"GARPOS" is distributed under the [GPL 3.0] (https://www.gnu.org/licenses/gpl-3.0.html) license.

Algorithm and documentation

Please see Watanabe, S., Ishikawa, T., Yokota, Y., and Nakamura, Y., (2020) https://doi.org/10.3389/feart.2020.597532

Requirements

  • Python 3.7.3
  • Packages NumPy, Scipy, Pandas, Matplotlib, and Scikit-sparse are also required.
  • Fortran 90 compiler (e.g., gfortran)

Environments under Anaconda for Linux is tested.

Compilation of Fortran90-based library

For the calculation of travel time, a Fortran90-based library is needed. For example, the library can be compiled via gfortran as,

gfortran -shared -fPIC -fopenmp -O3 -o lib_raytrace.so sub_raytrace.f90 lib_raytrace.f90

Path to the library should be indicated in "Settings.ini".

Usage

When using GARPOS, you should prepare the following files.

  • Initial site-parameter file (e.g., *initcfg.ini)
  • Acoustic observation data csv file
  • Reference sound speed data csv file
  • Settings file (e.g., Settings.ini)

"bin/solveSingleEpoch.py" is a driver code. Two observation epochs are stored in "sample" directory as demo data.

cd sample
./demo.sh

or run the program manually.

cd sample

# to solve position for each transponder (for epoch SAGA.1903)
solveSingleEpoch.py -i Settings-prep.ini -f initcfg/SAGA/SAGA.1903.kaiyo_k4-initcfg.ini -d demo_prep/SAGA
# to solve position for each transponder (for epoch SAGA.1905)
solveSingleEpoch.py -i Settings-prep.ini -f initcfg/SAGA/SAGA.1905.meiyo_m5-initcfg.ini -d demo_prep/SAGA

# to make the averaged array
makeFixCfg.py -d cfgfix --res_singles "demo_prep/SAGA/*res.dat"

# to solve in array-constraint condition (for epoch SAGA.1903)
solveSingleEpoch.py -i Settings-fix.ini -f cfgfix/SAGA/SAGA.1903.kaiyo_k4-fix.ini -d demo_res/SAGA
# to solve in array-constraint condition (for epoch SAGA.1905)
solveSingleEpoch.py -i Settings-fix.ini -f cfgfix/SAGA/SAGA.1905.meiyo_m5-fix.ini -d demo_res/SAGA

The following files will be created in the directory (specified with "-d" option).

  • Estimated site-parameter file (*res.dat)
  • Modified acoustic observation data csv file (*obs.csv)
  • Model parameter list file (*m.p.dat)
  • A posteriori covariance matrix file (*var.dat)

Note

Please be aware of your storage when searching hyperparameters,

since it will create result files for all combinations of hyperparameters.

List of functions

  • drive_garpos (in garpos_main.py)
  • parallelrun (in garpos_main.py)
    • MPestimate (in mp_estimation.py)
      • init_position (in setup_model.py)
      • make_splineknots (in setup_model.py)
      • derivative2 (in setup_model.py)
      • data_correlation (in setup_model.py)
      • calc_forward (in forward.py)
        • corr_attitude (in coordinate_trans.py)
        • calc_traveltime (in traveltime.py)
      • calc_gamma (in forward.py)
      • jacobian_pos (in forward.py)
        • corr_attitude (in coordinate_trans.py)
        • calc_traveltime (in traveltime.py)
      • outresults (in output.py)

Index list of obs.csv data

No. Index Description
00 SET Names of subset in each observation (typically S01, S02,...)
01 LN Names of survey lines in each observation (typically L01, L02,...)
02 MT ID of mirror transponder (should be consistent with Site-parameter file)
03 TT Observed travel time
04 ResiTT Residuals of travel time (observed - calculated)
05 TakeOff Takeoff angle of ray path (in degrees, Zenith direction = 180 deg.)
06 gamma Correction term setting in the observation equations
07 flag True: data of this acoustic shot is not used as data
08 ST Transmission time of acoustic signal
09 ant_e0 GNSS antenna position (eastward) at ST
10 ant_n0 GNSS antenna position (northward) at ST
11 ant_u0 GNSS antenna position (upward) at ST
12 head0 Heading at ST (in degree)
13 pitch0 Pitch at ST (in degree)
14 roll0 Roll at ST (in degree)
15 RT Reception time of acoustic signal
16 ant_e1 GNSS antenna position (eastward) at RT
17 ant_n1 GNSS antenna position (northward) at RT
18 ant_u1 GNSS antenna position (upward) at RT
19 head1 Heading at RT (in degree)
20 pitch1 Pitch at RT (in degree)
21 roll1 Roll at RT (in degree)
22 dV0 Sound speed variation (for dV0)
23 gradV1e Sound speed variation (for east component of grad(V1))
24 gradV1n Sound speed variation (for north component of grad(V1))
25 gradV2e Sound speed variation (for east component of grad(V2))
26 gradV2n Sound speed variation (for north component of grad(V2))
27 dV Correction term transformed into sound speed variation (gamma x V0)
28 LogResidual Actual residuals in estimation (log(TT) - log(calculated TT)

*Indices #04-#07, #22-#28 will be updated after the estimation.

garpos's People

Contributors

s-watanabe-jhod avatar yusuke-yokota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

garpos's Issues

How to resolve scikit-sparse not fitting Apple Silicon Mac

Solution to the problem that scikit-sparse required for GARPOS does not fit into Apple Silicon (M1, etc.) macs even if the dependent package is installed as per HP.

  • Problem with installation

Find the correct path to the library as follows;

  1. Open Finder.
  2. Press Cmd + Shift + G.
  3. Type /opt/homebrew/Cellar/suite-sparse and press Enter.
  4. Find the directory, as shown in the attached screenshots.

path_to_include
path_to_lib

Now, you can pip install as follows, specifying the correct path to the library. Ensure the paths match.
SUITESPARSE_INCLUDE_DIR=/opt/homebrew/Cellar/suite-sparse/7.7.0/include/suitesparse SUITESPARSE_LIBRARY_DIR=/opt/homebrew/Cellar/ suite-sparse/7.7.0/lib pip install scikit-sparse

  • Problem with import
    In my Anaconda environment, I was able to install, but an error occurred on import. I was able to deactivate Anaconda and install and import successfully with another python.

There may be a bug for function "derivative2" in setup_model.py

The 2nd derivative matrix of the B-spline basis should be (delta.T @ w^(-1)) @ delta, not (delta.T @ w) @ delta. The formula can be fond in the book "Nonparametric Regression and Generalized Linear Models A roughness penalty approach" by P.J. Green, Bernard. W. Silverman, page 25

Error when trying to estimate position only

Dear mainteners,

I have tried to run GARPOS with estimating seafloor coordinates only (no gradient parameters) by setting the parameter inversiontype of the config file to 0.
However, this returns an error message from setup_model.py due to a division by zero.

I managed to make a quick and dirty fix that allows to make the program work. But further modification should be made for consistency.

Best regards,

EL

Modification :

mp_estimation.py
if invtyp == 0:
#knotint0 = 0.
#knotint1 = 0.
#knotint2 = 0.
pass

Error message :

suffix lamb0 lgrad mu_t mu_m
0 0.1 0.1 0.0 0.5
bin/garpos_v101/setup_model.py:135: RuntimeWarning: divide by zero encountered in scalar divide
nknots = [ int(obsdur/knint) for knint in knotintervals ]
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "multiprocessing/pool.py", line 51, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "bin/garpos_v101/mp_estimation.py", line 157, in MPestimate
knots = make_knots(shots, spdeg, knotintervals)
File "bin/garpos_v101/setup_model.py", line 135, in make_knots
nknots = [ int(obsdur/knint) for knint in knotintervals ]
File "bin/garpos_v101/setup_model.py", line 135, in
nknots = [ int(obsdur/knint) for knint in knotintervals ]
OverflowError: cannot convert float infinity to integer
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "bin//solveSingleEpoch.py", line 47, in
rf = drive_garpos(options.cfgfile, options.invcfg, odir, options.suf, mc)
File "bin/garpos_v101/garpos_main.py", line 169, in drive_garpos
outputs = parallelrun(inputs, maxcore)
File "bin/garpos_v101/garpos_main.py", line 65, in parallelrun
reslist = p.starmap(MPestimate, inp)
File "multiprocessing/pool.py", line 375, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "multiprocessing/pool.py", line 774, in get
raise self._value
OverflowError: cannot convert float infinity to integer

High memory usage during the fix step

I am using data from two different surveys at one site. The initial procedure works well using Log_Lambda0 = -1 and mu_t = 0.0. For the fix step, higher mu_t values (in this case 0.5) leads to a program failure due too much memory usage. I have tracked this down to the data correlation step, specifically with lu.solve in line 263 of setup_model.py. I am uncertain if there is a more efficient/less memory intensive way of addressing this issue. Here is the information for matrix E:

<66864x66864 sparse matrix of type '<class 'numpy.float64'>'
with 4331926 stored elements in List of Lists format>

Currently, my RAM is limited to 64 gb. I would be happy to pack the data into a zip file and provide it through Google Drive, if you would like to use it for a test case. I understand if this an impossible issue at the moment, and I greatly appreciate your time.

How to learn the software

Dear author, hello. I am a student who has just started learning about underwater positioning. Currently, I am not sure about the specific purpose of this software, how to use the files it generates, and what the software does. I would like to ask if you have any relevant learning documents and how to use this software.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.