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

Calculating source_waveform length (tt) manually? #28

Open
PhysMa opened this issue Jul 22, 2024 · 0 comments
Open

Calculating source_waveform length (tt) manually? #28

PhysMa opened this issue Jul 22, 2024 · 0 comments

Comments

@PhysMa
Copy link

PhysMa commented Jul 22, 2024

In fdtdz there is:

  out_start, out_stop, out_interval = output_steps
  out_num = len(range(out_start, out_stop, out_interval))
  tt = out_start + out_interval * (out_num - 1) + 1

  if not (source_waveform.ndim == 2 and source_waveform.shape == (tt, 2)):
    raise ValueError(
        f"source_waveform must be of shape (tt, 2) = ({tt}, 2), but got "
        f"{source_waveform.shape} instead.") 

Since tt is calculated internally, one would need to do the same calculation outside to figure out the length of the input param source_waveform -- is this intended? One consequence is that whenever one changes output_steps, even just the interval value, this ValueError is often raised. Maybe allow source_waveform to be longer and only use the first tt elements?

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

No branches or pull requests

1 participant