Commit e12b8672 authored by Michele Valentini's avatar Michele Valentini

added the option to disable some messages in the op_demod_phase method

parent 98a8b84f
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment