Skip to content

Commit ef6f180

Browse files
committed
Fix amplitude offset for residual plot
- Minor PEP8 formatting
1 parent a472fac commit ef6f180

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Metallicity_Stack_Commons/plotting/balmer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ def fitting_result(wave: np.ndarray, y_norm: np.ndarray, lambda_cen: float,
111111

112112
# Residuals
113113
idx_sig_2 = np.where(np.abs((wave - lambda_cen)) / line_fit[1] <= 3.0)[0]
114-
fit_dict['residual'] = y_norm[idx_sig_2] - fit_dict['gauss'][idx_sig_2] + line_fit[3]
114+
fit_dict['residual'] = y_norm[idx_sig_2] - fit_dict['gauss'][idx_sig_2] + \
115+
(line_fit[3] + line_fit_neg[2]) # Applies negative amp offset
115116

116117
fit_dict['idx_sig'] = idx_sig_2
117118

@@ -127,7 +128,7 @@ def fitting_result(wave: np.ndarray, y_norm: np.ndarray, lambda_cen: float,
127128

128129

129130
# noinspection PyUnboundLocalVariable
130-
def HbHgHd_fits(fitspath: str, out_pdf_prefix: str ='HbHgHd_fits',
131+
def HbHgHd_fits(fitspath: str, out_pdf_prefix: str = 'HbHgHd_fits',
131132
use_revised: bool = False, verbose: bool = False,
132133
log: Logger = log_stdout()):
133134
"""

0 commit comments

Comments
 (0)