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

Pick detect integration #11

Merged
merged 4 commits into from
Apr 19, 2020
Merged

Conversation

lyndonboone
Copy link
Collaborator

Builds on previous changes in newbranch. Added some functions in a new file to integrate the detector and picker, along with additional functionality to convert results to pandas dataframe tables.

The functionality works as follows: find_runs_with_gaps works similarly to find_nonzero_runs except it allows max_gap number of zeros in between runs of nonzero probability to generate runs to pick over. If there is neither a nonzero p or s probability for more than max_gap windows, it stops grouping windows. I did this to avoid having windows separated by one zero probability being picked separately, because they could potentially contain the same event in the waveform.

yield_pick_windows is a generator function which yields the runs subsets of the array corresponding to runs picked out by the find_runs_with_gaps function.

generate_picks uses this generator to create a dictionary of picktimes for p and s with their assigned confidences from the model.

detects2table and picks2table take in output from the detect and geneate_picks functions, respectively, and convert the results into an easy to read pandas DataFrame object which can be viewed or saved to a .csv file.

@lijunzh
Copy link
Member

lijunzh commented Apr 19, 2020

@lyndonboone Thanks for the PR. Like #8, I will merge the PR and work on the test later.

@lijunzh lijunzh merged commit c3fe58a into yewsg:master Apr 19, 2020
lijunzh pushed a commit that referenced this pull request Apr 20, 2020
* added functionality to chunks function in cpic/utils.py

* chunk large arrays for detection

* removed trailing whitespace

* added integration functionality and extras

Co-authored-by: Lyndon Boone <lyndonboone@valley.physics.utoronto.ca>
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

Successfully merging this pull request may close these issues.

None yet

2 participants