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

NaN, Inf & Zeros in calculated adjoint sources #157

Open
AbolfazlKhanMo opened this issue Feb 20, 2023 · 2 comments
Open

NaN, Inf & Zeros in calculated adjoint sources #157

AbolfazlKhanMo opened this issue Feb 20, 2023 · 2 comments

Comments

@AbolfazlKhanMo
Copy link

AbolfazlKhanMo commented Feb 20, 2023

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.

image

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.

@AbolfazlKhanMo AbolfazlKhanMo changed the title NaN & Inf values in calculated adjoint sources NaN, Inf & Zeros in calculated adjoint sources Feb 20, 2023
@bch0w
Copy link
Member

bch0w commented Feb 28, 2023

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.

@AbolfazlKhanMo
Copy link
Author

Sorry for the late reply.
I am using the default preprocessing parameters, and my dt is 1E-5

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

No branches or pull requests

2 participants