Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes previously applied “spike detection” short-circuiting during LTS/OLS processing so that fast-moving seismic arrivals (which can look like spikes under the old heuristic) are still processed.
Changes:
- Removed multiple “data spike” checks that previously skipped processing for certain windows.
- Refactored several scalar assignments to explicitly cast array/scalar results to Python floats.
- Adjusted
np.errstateusage/formatting aroundsigma_taucomputation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
62
to
66
| for jj in range(nits): | ||
|
|
||
| # Check for data spike. | ||
| if (time_delay_mad[jj] == 0) or (np.count_nonzero(tau[:, jj, :]) < (co_array_num - 2)): | ||
| # We have a data spike, so do not process. | ||
| continue | ||
|
|
||
| # Standardize the y-values | ||
| y_var = tau[:, jj, :] / time_delay_mad[jj] | ||
| X_var = xij_standardized |
Comment on lines
899
to
903
| # Loop through time | ||
| for jj in range(data.nits): | ||
|
|
||
| # Check for data spike. | ||
| if (self.time_delay_mad[jj] == 0) or (np.count_nonzero(self.tau[:, jj, :]) < (self.co_array_num - 2)): | ||
| # We have a data spike, so do not process. | ||
| continue | ||
|
|
||
| y_var = self.tau[:, jj, :] / self.time_delay_mad[jj] | ||
| qt = self.q_xij.conj().T @ y_var |
| m_w, _ = np.shape(xij[weights, :]) | ||
| with np.errstate(invalid='raise'): | ||
|
|
||
| with np.errstate(invalid="raise"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the "spike detection" that I think was initially for data glitches/spikes that are rare. This was instead causing some issues with seismic data where the arrivals traverse the array much more quickly and were not getting processed. Addresses #33. Sorry for the delay!