From c89ab05e9f570fc0e664ca705afc7a50f40b4129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Sousa?= Date: Mon, 22 Jun 2020 16:32:29 +0100 Subject: [PATCH] add new test function --- ares_cython/ares_module.pyx | 75 +++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 3 deletions(-) diff --git a/ares_cython/ares_module.pyx b/ares_cython/ares_module.pyx index 7946661..198f8b3 100755 --- a/ares_cython/ares_module.pyx +++ b/ares_cython/ares_module.pyx @@ -404,6 +404,8 @@ def getMedida_pyfit(ll, flux, line, space, rejt, smoothder, distline, plots_flag y = yl #np.savetxt('test.out', (x,y)) + print("Acoef:", acoef) + #mod, out, init = lmfit_ngauss(x,y, acoef) mod, out, init = lmfit_ngauss_constrains(x,y, acoef, constrains) values = out.best_values @@ -489,7 +491,7 @@ def getMedida_coefs(x, ynorm, lc, ld, distline): """ acoef = np.zeros(lc.shape[0]*3) constrains = [] - sigma_const = 0.05*2 + sigma_const = 0.05 for i in range(lc.shape[0]): # We may need to play a bit with the constrains acoef[i*3] = (ld[i] - 1) * (sigma_const*sqrt(2*pi)) @@ -561,7 +563,8 @@ def getMedida_compile_ew(out, x, y, init, line, distline, plots_flag = False): error_ew = 0. news = 0 line_is_found = 0 - for i in range(0,len(out.params)/nparam_gauss): +# for i in range(0,len(out.params)/nparam_gauss): + for i in range(0,len(out.params)/5): pref = "g%02i_" % (i) if abs(line - values[pref+'center']) < distline: ew+=values[pref+'amplitude']*1000*-1 @@ -687,6 +690,71 @@ def getMedida_pyfit_sep(ll, flux, line, space, rejt, smoothder, distline, plots_ +# double yfit2[nx]; +# for (i=0;i