-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error when trying to estimate position only #6
Comments
Thank you 4 your finding, this certainly is a bug in this version GARPOS. You can add a if sentence in line-135 of setup_model.py to solve this problem. That is to say, changing the code "
nknots = [ int(obsdur/knint) for knint in knotintervals ]
" to "
zero_num = np.sum(i < 1e-4 for i in knotintervals)
if zero_num == len(knotintervals):
nknots = [0 for _ in knotintervals]
else:
nknots = [ int(obsdur/knint) for knint in knotintervals ]
" can fix bugs. Hope this method can help you.
Best wishes!
from Nameless
| |
冠旭
|
|
***@***.***
|
---- Replied Message ----
| From | ***@***.***> |
| Date | 4/30/2024 20:33 |
| To | ***@***.***> |
| Cc | ***@***.***> |
| Subject | [s-watanabe-jhod/garpos] Error when trying to estimate position only (Issue #6) |
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
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: