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

strange behavior for small alpha2 value #15

Open
dylanmikesell opened this issue Aug 6, 2020 · 5 comments
Open

strange behavior for small alpha2 value #15

dylanmikesell opened this issue Aug 6, 2020 · 5 comments
Labels

Comments

@dylanmikesell
Copy link

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

@ThomasLecocq
Copy link
Owner

Humm... strange indeed.

@dylanmikesell
Copy link
Author

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.

@ThomasLecocq
Copy link
Owner

indeed, this is a nasty bug!

@dylanmikesell
Copy link
Author

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.

@ThomasLecocq
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants