Skip to content

Commit

Permalink
Update compare_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntian236 authored Feb 20, 2024
1 parent db28150 commit af0da07
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lightshow/postprocess/compare_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def compare_between_spectra(
Parameters
----------
spectrum1 and spectrum2 : two-column arrays of energy vs. intensity XAS
method : 'pearson', 'spearman', or 'coss' (cosine similarity).
method : 'pearson', 'spearman', or 'coss' (cosine similarity).
Empirically 'coss' works well
Return
Expand Down Expand Up @@ -108,7 +108,7 @@ def spectraCorr(
Returns
-------
correlation: list; pearson, spearman, or cosine similarity.
correlation: list; pearson, spearman, or cosine similarity.
If method == 'all', all three correlations are returned.
"""
if GRID is None:
Expand Down Expand Up @@ -176,16 +176,16 @@ def maxCorr(
GRID=None,
method="coss",
):
"""Calculate the correlation between two spectra,
"""Calculate the correlation between two spectra,
and the amout of shift to obtain maximum correlation
Parameters
----------
spectrum1 and spectrum2 : two-column arrays of energy vs. intensity XAS
start, stop, and step : shift of spectrum2 ranges from start to stop
start, stop, and step : shift of spectrum2 ranges from start to stop
with stepsize=step
GRID : common grid for interpolation
method : 'pearson', 'spearman', or 'coss' (cosine similarity).
method : 'pearson', 'spearman', or 'coss' (cosine similarity).
Empirically 'coss' works well
Returns
Expand Down Expand Up @@ -238,8 +238,8 @@ def maxCorr(
pass
else:
print(
"XAS edge positions might not align. " \
"Better to plot and check the spectrum. "
"XAS edge positions might not align. "
"Better to plot and check the spectrum."
)
return correlation, m_shift

Expand Down

0 comments on commit af0da07

Please sign in to comment.