diff --git a/qsoabsfind/absfinder.py b/qsoabsfind/absfinder.py index 0c393ea..d5b05d8 100644 --- a/qsoabsfind/absfinder.py +++ b/qsoabsfind/absfinder.py @@ -262,7 +262,7 @@ def convolution_method_absorber_finder_in_QSO_spectra(spec_index, absorber='MgII dr, min_dr, max_dr = 0, 0, -1 #failure case ew1_snr, ew2_snr = 0, 0 # failure case - if (gaussian_parameters > bound[0]+0.001).all() and (gaussian_parameters < bound[1]-0.001).all() and lower_del_lam <= c1 - c0 <= upper_del_lam and sn1 > sn_line1 and sn2 > sn_line2 and vel1 > 0 and vel2 > 0 and min_dr < dr < max_dr and ew1_snr >1 and ew2_snr>1: + if (gaussian_parameters > bound[0]+0.001).all() and (gaussian_parameters < bound[1]-0.001).all() and lower_del_lam <= c1 - c0 <= upper_del_lam and sn1 >= sn_line1 and sn2 >= sn_line2 and vel1 > 0 and vel2 > 0 and min_dr < dr < max_dr and ew1_snr >1 and ew2_snr>1: pure_z_abs[m] = z_new pure_gauss_fit[m] = fit_param_temp[0] pure_gauss_fit_std[m] = fit_param_std_temp[0] diff --git a/qsoabsfind/ew.py b/qsoabsfind/ew.py index 3b31069..bcb7073 100644 --- a/qsoabsfind/ew.py +++ b/qsoabsfind/ew.py @@ -221,8 +221,8 @@ def measure_absorber_properties_double_gaussian(index, wavelength, flux, error, EW_first_line_error, EW_second_line_error, EW_total_error ) - #np.random.seed(1234) # for reproducibility of initital condition for k in range(size_array): + np.random.seed(int(absorber_redshift[k] * 1e6) % 2**32) # for reproducibility absorber_rest_lam = wavelength / (1 + absorber_redshift[k]) # rest-frame conversion of wavelength lam_ind = np.where((absorber_rest_lam >= ix0) & (absorber_rest_lam <= ix1))[0] lam_fit = absorber_rest_lam[lam_ind]