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

Change definition of time parameters #27

Open
bsmithyman opened this issue Mar 18, 2016 · 0 comments
Open

Change definition of time parameters #27

bsmithyman opened this issue Mar 18, 2016 · 0 comments
Assignees
Labels

Comments

@bsmithyman
Copy link
Member

Transcribing the time issue into GH for tracking purposes.

Hi @bsmithyman

Your code has a test for the number of samples in the source wavelet: ns == 2 * nom

This is 1. incorrect and also 2. too restrictive.

  1. The error is you assume time = ns * dt, when it should be (ns-1)*dt.
  2. The restriction is as follows:

We want df to equal the inverse of the total time window, ie df = 1 / (ns - 1)*dt.

Given that, then

(ns - 1) = 1 / dt*df

To get this in terms of nom, note that nom = fmax / df

(ns -1) = nom / dt*fmax

(If we happen to choose fmax = fny = 1/ 2*dt then (ns -1) = nom*2*dt/dt = nom * 2 as in your test).

This is too restrictive - we often use forward modelling where fmax != fny.

Bottom line
Can you change the test to:
ns == 1 + nom / dt*fmax ?

For example, @ShaunHadden and I are building a model with dt = .15625 ms, nt = 161, total time (ns -1)*dt = 25 ms, df = 1 / 0.025 = 40 Hz.

With fmax=1600, nom=1600/40=40

So nom != 2 * ns and your test fails, but my test gives 1 + nom / dt*fmax = 1 + 40 / .0015625*1600 = 161 which is correct.

Thanks, @gerhardpratt

@bsmithyman bsmithyman added the bug label Mar 18, 2016
@bsmithyman bsmithyman self-assigned this Mar 18, 2016
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

1 participant