trichter / rf

Receiver function calculation in seismology
MIT License
106 stars 62 forks source link

bug in deconv_iterative (sumsq) #43

Closed fabioca closed 1 year ago

fabioca commented 1 year ago

Dear all, I got this error in one specific case: UnboundLocalError: local variable 'sumsq' referenced before assignment on row 541 of deconvole.py : lsfit[c] = 100 - (sumsq * 100)

it occurs when the error is small (in my case) and doe not go inside the loop on row 513 (deconvolce.py):

shouldn't be lsfit[c] = 100 - (sumsq_i * 100) ?? in this case, at least, the UnboundLocalError goes away and there is a Runtime warning (there is a divide by zero).

I am sorry to get a bit unclear, but I am a newby on python. I hope this helps

trichter commented 1 year ago

Hi!

Thanks for reporting. However I cannot find lsfit[c] = 100 - (sumsq * 100) on row 541 or around this line. Are you sure you are using the latest verison of rf? Can you try to update and see if the bug is persistent?

fabioca commented 1 year ago

Hi Tom,

you are right, the bug was in an older version of the code (I was using a forked version). The new one does not have it.

Regards,

On 31 Jan 2023, at 11:30, Tom Eulenfeld @.***> wrote:

Hi!

Thanks for reporting. However I cannot find lsfit[c] = 100 - (sumsq * 100) on row 541 or around this line. Are you sure you are using the latest verison of rf? Can you try to update and see if the bug is persistent?

— Reply to this email directly, view it on GitHub https://github.com/trichter/rf/issues/43#issuecomment-1410115373, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGW6AYAIAANU2R62I5G46LWVDSU7ANCNFSM6AAAAAAUMFZWHI. You are receiving this because you authored the thread.