Skip to content

Commit

Permalink
handling NaNs in cross correlation
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Sep 24, 2024
1 parent 00e8f6c commit 374a30a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/lvmdrp/core/spectrum1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ def _cross_match_float(
# Normalize the cross correlation
cross_corr = cross_corr.astype(numpy.float32)
cross_corr /= norm(stretched_signal1) * norm(obs_spec_)
cross_corr = numpy.nan_to_num(cross_corr)

# Get the correlation shifts
shifts = signal.correlation_lags(
Expand Down

0 comments on commit 374a30a

Please sign in to comment.