Skip to content

Commit

Permalink
fixing cross-corr
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jul 15, 2018
1 parent 0c600ca commit 3a29844
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aesop/spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@ def cross_corr(target_spectrum, model_spectrum, kernel_width):
smoothed_model_flux = gaussian_filter1d(model_spectrum.masked_flux,
kernel_width)

corr = np.correlate(target_spectrum.masked_flux,
smoothed_model_flux, mode='same')
corr = np.correlate(target_spectrum.masked_flux - target_spectrum.masked_flux.mean(),
smoothed_model_flux - smoothed_model_flux.mean(), mode='same')

max_corr_ind = np.argmax(corr)
index_shift = corr.shape[0]/2 - max_corr_ind
Expand Down

0 comments on commit 3a29844

Please sign in to comment.