From e12b86721f1ea0c498434d11c66e218c9d89017d Mon Sep 17 00:00:00 2001 From: Michele Valentini Date: Sun, 28 Oct 2018 15:13:19 +0100 Subject: [PATCH] added the option to disable some messages in the op_demod_phase method --- pykat/ifo/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pykat/ifo/__init__.py b/pykat/ifo/__init__.py index e8d2539..b50710a 100644 --- a/pykat/ifo/__init__.py +++ b/pykat/ifo/__init__.py @@ -798,7 +798,8 @@ def isCavsStable(kat): return is_stable, ymax -def opt_demod_phase(cdata, x, xbounds=None, err_tol=1e-5, xatol=1e-9, isplot=False): +def opt_demod_phase(cdata, x, xbounds=None, err_tol=1e-5, xatol=1e-9, isplot=False, + verbose=False): ''' Optimizes the demodulation phase of a complex error signal generated by Finesse. Demands that the error signal is smaller than err_tol to compute the slope or @@ -850,7 +851,7 @@ def opt_demod_phase(cdata, x, xbounds=None, err_tol=1e-5, xatol=1e-9, isplot=Fal #print('hej!') return -dy1 sol_2 = minimize_scalar(find_op, bounds=xbounds, method='bounded', - options={'maxiter': 500, 'disp': True, 'xatol': xatol}) + options={'maxiter': 500, 'disp': verbose, 'xatol': xatol}) # print(sol_2) return sol_2.fun @@ -861,7 +862,7 @@ def opt_demod_phase(cdata, x, xbounds=None, err_tol=1e-5, xatol=1e-9, isplot=Fal demod_phase_bounds = slice(min_phase, max_phase, step) phase_bounds = (demod_phase_bounds,) # Searching for optimal demodulation phase. - sol = brute(max_og, ranges=phase_bounds, full_output=True, finish=fmin, disp=False) + sol = brute(max_og, ranges=phase_bounds, full_output=True, finish=fmin, disp=verbose) # Reading out results demod_phase = sol[0][0] optical_gain = -sol[1]*yscale/xscale -- GitLab