ThomasLecocq/msnoise-tomo

strange behavior for small alpha2 value

Opened this issue · 5 comments

We are getting some strange behavior (or we think it is strange) regarding alpha_2. When alpha_2 is zero, we get a smoother model than when alpha_2 is 10^-6. See attached image. We are setting the _1 variables to 0 so that as many data as possible are kept. Then we vary alpha_2 to see how the final model is smoothed. Any ideas about what is going on?
GeoPark

Humm... strange indeed.

This is a bug. I have done a bunch of tests now to isolate the issue. I am curious if you have an idea for the solution.

This only occurs for the special case when the user tries to enter a value at the command line for one of the inversion parameters. For example, if I run the following tomography

msnoise p tomo answt -p 0.053 -f 14 --b1 0 --b2 0 --a1 0 --a2 0.0

The code will actual use whatever the values are in the tomo config page. It is because of the line below where alpha2 is zero, so it grabs the config value.

alpha2 = a2 if a2 else float(get_config(db, "alpha2", plugin="Tomo"))

The code sees a 0 as False, not a value. The way to fix this is with the following line.

alpha2 = a2 if a2 is not None else float(get_config(db, "alpha2", plugin="Tomo"))

This needs to be done for all regularization parameters that can be overridden at the CLI. This will be fixed in Dylan's rewrite of ANSWT.py. Of note, alpha and beta are both zero, a new error pops up. I will open another issue about this. It is related to the Q matrix.

indeed, this is a nasty bug!

Fixed in commit 3285c04. Still have this other bug. Should probably just do a check on a1,b1 and a2,b2 and change the matrix...either add Q or not depending on if a1,b1 or a2,b2 are both zero.

(my own references: similar stuff here obspy/obspy#2749)