Skip to content

Remove spike detection#39

Open
davidfee5 wants to merge 1 commit into
masterfrom
spikes
Open

Remove spike detection#39
davidfee5 wants to merge 1 commit into
masterfrom
spikes

Conversation

@davidfee5

@davidfee5 davidfee5 commented Jul 3, 2026

Copy link
Copy Markdown
Member

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!

Copilot AI review requested due to automatic review settings July 3, 2026 17:13
@davidfee5 davidfee5 linked an issue Jul 3, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.errstate usage/formatting around sigma_tau computation.

💡 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"):
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.

Why is there 'spike detection' and how are spikes defined?

2 participants