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

Add option of padding zero #17

Open
vsilwal opened this issue May 31, 2018 · 2 comments
Open

Add option of padding zero #17

vsilwal opened this issue May 31, 2018 · 2 comments

Comments

@vsilwal
Copy link

vsilwal commented May 31, 2018

trace.trim(cut_starttime, cut_endtime)

It might be good to have the option of padding zeroes here. One example were this would be beneficial would be when filtering specfem synthetics (that start from time=0) for near-field stations.

@wjlei1990
Copy link
Collaborator

Good point!

Are you talking about something like this

I think I originally may think out that, but I realized there are 4 cases that I have to handle, which might lead me to give up code it up.

  1. cut start time < trace start time
  2. cut start time >= trace start time
  3. cut end time < trace end time
  4. cut end time >= trace end time

@vsilwal
Copy link
Author

vsilwal commented May 31, 2018

Great to see its already there.

Wouldn't trace.trim(cut_starttime, cut_endtime, pad=True, fill_value=0) take care of this?

For (1. start time < trace start time) and (4. end time >= trace end time) that would pad zero, and
for (2. start time >= trace start time) and (3. end time < trace end time) it would cut.

Thanks,

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

2 participants