NaN, Inf & Zeros in calculated adjoint sources
AbolfazlKhanMo opened this issue · 2 comments
Hi everyone,
I am trying to run SeisFlows inversion workflow for my simple elastic case (a photo is attached) using SPECFEM2D. I don't know why exactly I'm getting nan , inf and zero values in my calculated adjoint sources. There most be a normalization parameter which I don't understand. I'm attaching observed and synthetic seismograms. The simulation stops in 2023-02-20 19:15:31 (I) | stop workflow at
stop_after: evaluate_initial_misfit
step.
Here is the error (warning) I'm getting:
RuntimeWarning: divide by zero encountered in true_divide time_array = time_array / self.stats.sampling_rate
Here are the observed and synthetic seismograms.
-8.0000000000000002E-002 0.0000000000000000
-7.9990000000000006E-002 0.0000000000000000
-7.9979999999999996E-002 0.0000000000000000
-7.9969999999999999E-002 0.0000000000000000
-7.9960000000000003E-002 0.0000000000000000
-7.9950000000000007E-002 0.0000000000000000
-7.9939999999999997E-002 0.0000000000000000
-7.9930000000000001E-002 0.0000000000000000
-7.9920000000000005E-002 0.0000000000000000
-7.9909999999999995E-002 0.0000000000000000
-8.0000000000000002E-002 0.0000000000000000
-7.9990000000000006E-002 0.0000000000000000
-7.9979999999999996E-002 0.0000000000000000
-7.9969999999999999E-002 0.0000000000000000
-7.9960000000000003E-002 0.0000000000000000
-7.9950000000000007E-002 0.0000000000000000
-7.9939999999999997E-002 0.0000000000000000
-7.9930000000000001E-002 0.0000000000000000
-7.9920000000000005E-002 0.0000000000000000
-7.9909999999999995E-002 0.0000000000000000
Here is what I'm getting for my adjoint source:
nan 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
inf 0.0000000
Thanks very much.
Hi @AbolfazlKhanMo, sorry for the slow response to this issue! That's strange as the left column of the adjoint sources should just be time stamps.
It looks like that warning message is coming from Obspy's Trace.times() function.
Some questions that might help solve this:
- what preprocessing module are you using, and
- what is the
dt
value of your simulations?
My guess is that somewhere the synthetic data are read in as ObsPy objects, but the sampling rate is defined incorrectly such that getting the time array causes nans and infs to be returned.
Sorry for the late reply.
I am using the default preprocessing parameters, and my dt
is 1E-5