Commit f2b0dfba authored by Alexis Carlotti's avatar Alexis Carlotti
Browse files

Fixed logging bug (no more duplicated log messages)

parent 5db9326e
......@@ -27,10 +27,10 @@ gamma = 1#%0.1;%1;
rot_flag = 1
#Flag for missing segments (1 = missing segments ; 0 = no missing segments)
miss_flag = 1
miss_flag = 0
#Flag for E-ELT M1 phase aberrations
eeltphase_flag = 1
eeltphase_flag = 0
#Flag for cross-talk and diffusion ; FWHM=1pix across x ; 2pix across lambda ; 0.5% diffusion across lambda
crosstalk_flag = 0
......@@ -62,7 +62,7 @@ RMS_gamma = 1 #%0.6;%0.3;
# Gamma factor to increase the strengh of the AO residuals (for DSP_gamma >1)
DSP_gamma = 1
APODIZER = 'SP_1'
APODIZER = 'SP_2'
#disp(['Observation time will be: ' num2str(Delta_HA) 'h'])
#disp(['Observation starts ' num2str(HA_offset) 'h before meridian'])
......@@ -91,7 +91,7 @@ T_exp = 1/60
N_exp = np.int(T_obs/T_exp)# %60 exposures per hour = 1 per minute
##############################################################################
BAND = 'TEST_H' # %Choose between the bands defined hereafter (use a valid string)
BAND = 'TEST_K' # %Choose between the bands defined hereafter (use a valid string)
### Bands ###
......@@ -115,7 +115,7 @@ K1_high = [2.024, 2.113, 2.202, 17000]
K2_high = [2.197, 2.294, 2.390, 17000]
if BAND=='TEST_H':
N_LD = 3#48
N_LD = 3
LBD_min = H_band[0]*1e-6
LBD_max = H_band[2]*1e-6
if APODIZER == 'SP_1':
......@@ -349,8 +349,9 @@ logging.basicConfig(filename=path_directory + 'simulation_log.txt', filemode='w'
format='%(message)s', level=logging.DEBUG)
log = logging.getLogger('harmoni-hc')
handler = logging.StreamHandler(sys.stdout)
log.addHandler(handler)
if not log.handlers:
handler = logging.StreamHandler(sys.stdout)
log.addHandler(handler)
log.info('DATA MAKER')
log.info('Number of exposures: {0}'.format(N_exp))
......@@ -699,7 +700,7 @@ for i in range(len(HA_vect)):
FTO_tel_0_ForSR = ft(I_s_0_ForSR,1,2*OWA,2*OWA,DiamFTO,DiamFTO,1,len(dsp),len(dsp))
SR = np.sum(np.abs(FTO_tel_0_ForSR*FTO_atm))/np.sum(np.abs(FTO_tel_0_ForSR))
log.info('Wavelength {:4d}/{:4d} - {:.2f} min left'.format(k, N_LD, t_left))
log.info('Wavelength {:4d}/{:4d} - {:.2f} min left'.format(k+1, N_LD, t_left))
log.info(' => Strehl: {:4.2f}'.format(SR))
#Normalization of I_s_post_0 to reflect a unit energy arriving on
......
Supports Markdown
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