Commit 00162a0f authored by Alexis Carlotti's avatar Alexis Carlotti
Browse files

Added reflectivity errors on M1 & corrected FPM files

parent e0cd6bd2
No preview for this file type
......@@ -28,6 +28,12 @@ rot_flag = 1
#Flag for missing segments (1 = missing segments ; 0 = no missing segments)
miss_flag = 1
# Configuration of M1 amplitude errors: 1 & 2 refer to two different missing segment configurations
# A & B refer to two different reflectivity errors configurations
# In both cases there is a uniform distribution of reflectivity for each segment that ranges between 100% and 95%.
# This 95% value comes from paper "Towards a Stray Light Analysis of the ELT" from R. Holzlöhner at ESO
# Reflectivity errors are randomly distributed over M1, i.e., I have not assumed any specific recoating strategy (spiral, etc.)
ELT_amplitude_errors = 'CONFIG_1A'
#Flag for E-ELT M1 phase aberrations
eeltphase_flag = 1
......@@ -62,7 +68,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 +97,7 @@ T_exp = 1/60
N_exp = np.int(T_obs/T_exp)# %60 exposures per hour = 1 per minute
##############################################################################
BAND = 'TEST_K' # %Choose between the bands defined hereafter (use a valid string)
BAND = 'TEST_H' # %Choose between the bands defined hereafter (use a valid string)
### Bands ###
......@@ -153,7 +159,7 @@ elif BAND=='TEST_K':
MASK = fits.getdata(COM_DIR + 'FPM_K_SP2_NoADC.fits')
else:
MASK = fits.getdata(COM_DIR + 'FPM_K_SP2_ADC.fits')
MASK_OFFSET = 0 #mas
MASK_OFFSET = -2#0 #mas
FPM = 'FPM_3'
elif BAND=='HK':
N_LD=round((HK_band[2]-HK_band[0])/(HK_band[1]/HK_band[3]))
......@@ -334,7 +340,7 @@ Wind_Angle_vect = PARANG(DEC, HA_vect)
# ___ _ __ __| | ___ | |_ _ __ __ _ _ __ __ _ _ __ ___ ___| |_ ___ _ __ ___ ___| | ___ ___| |_ _ ___ _ __
# / _ \ '_ \ / _` | / _ \| _| | '_ \ / _` | '__/ _` | '_ ` _ \ / _ \ __/ _ \ '__| / __|/ _ \ |/ _ \/ __| __| |/ _ \| '_ \
# | __/ | | | (_| | | (_) | | | |_) | (_| | | | (_| | | | | | | __/ || __/ | \__ \ __/ | __/ (__| |_| | (_) | | | |
# \___|_| |_|\__, _| \___/|_| | .__/ \__, _|_| \__, _|_| |_| |_|\___|\__\___|_| |___/\___|_|\___|\___|\__|_|\___/|_| |_|
# \___|_| |_|\__,_| \___/|_| | .__/ \__,_|_| \__, _|_||_| |_|\___|\__\___|_| |___/\___|_|\___|\___|\__|_|\___/|_| |_|
# | |
# |_|
......@@ -371,14 +377,14 @@ else:
log.info('Rotation: NO')
if (miss_flag == 1):
log.info('Missing Segments: YES')
log.info('M1 Amplitude errors: YES')
else:
log.info('Missing Segments: NO')
log.info('M1 Amplitude errors: NO')
if (eeltphase_flag == 1):
log.info('EELT phase: YES')
log.info('M1 phase errors: YES')
else:
log.info('EELT phase: NO')
log.info('M1 phase errors: NO')
if (ADC_flag == 1):
log.info('Fixed ADC: YES')
......@@ -423,7 +429,7 @@ N_im = 215
FOV = N_im * MASperPIXEL
# Focal Plane Mask transmission & detector geometry
MASK = 1-((1-MASK)*(1-1e-4))
#MASK = 1-((1-MASK)*(1-1e-4)) #not necessary anymore (hardcoded in FPM)
x_mask, X_mask, Y_mask, R_mask, T_mask = VECT(len(MASK), FOV)
MASK[np.abs(Y_mask) > 610/2] = 0
......@@ -432,7 +438,7 @@ fits.writeto(path_directory + 'FOCAL_PLANE_MASK.fits', MASK)
start_dir = os.getcwd()
#os.chdir(path_directory)
Ideal_PSF = PSF(ft(SP, 1, 1132/1024, 1132/1024, MAS2LD(FOV, 38.542, 1650e-9), MAS2LD(FOV, 38.542, 1650e-9), 1, N_im, N_im))
fits.writeto(path_directory + '_Ideal_PSF.fits', Ideal_PSF, overwrite=True)
fits.writeto(path_directory + 'Ideal_PSF.fits', Ideal_PSF, overwrite=True)
#os.chdir(start_dir)
respix = 0.0376387
......@@ -450,12 +456,19 @@ M1pupil1132_1024 = fits.getdata(COM_DIR + 'PUPIL_1132_1024D38.542.fits')
PUP_NORM_INTENSITY = np.sum(M1pupil1132_1024**2*(1132/1024/1132)*(1132/1024/1132))
MISSSEG = fits.getdata(COM_DIR + 'MissingSegments_1132.fits')
MISSSEG = miss_flag*MISSSEG
if ELT_amplitude_errors == 'CONFIG_1A':
MISSSEG = fits.getdata(COM_DIR + 'ELT_1a_MS=7_RE=5.fits')
elif ELT_amplitude_errors == 'CONFIG_1B':
MISSSEG = fits.getdata(COM_DIR + 'ELT_1b_MS=7_RE=5.fits')
elif ELT_amplitude_errors == 'CONFIG_2A':
MISSSEG = fits.getdata(COM_DIR + 'ELT_2a_MS=7_RE=5.fits')
elif ELT_amplitude_errors == 'CONFIG_2B':
MISSSEG = fits.getdata(COM_DIR + 'ELT_2b_MS=7_RE=5.fits')
MISSSEG = np.sqrt(MISSSEG)
ORIGINAL_PUPIL = M1pupil1132_1024
M1pupil1132_1024 = M1pupil1132_1024*(1-MISSSEG)
M1pupil1132_1024 = M1pupil1132_1024*MISSSEG
P_M4 = EELTNLS(1024, 100, 100, 110) ### EELTNLS not written yet!!! ###
P_M4 = np.pad(P_M4, [54, 54], 'constant', constant_values=(0, 0))
......@@ -609,7 +622,7 @@ for i in range(len(HA_vect)):
#PUPILLE_0 = minterp2d(x, x, np.transpose(P_M4), x, x+pix_shift_0)
EELT_phase_0 = shift(1.0*EELT_phase, pix_shift_diff_0, output=None, order=1, mode='constant', cval=0.0, prefilter=True)
MISSSEG_0 = shift(1.0*MISSSEG, pix_shift_diff_0, output=None, order=1, mode='constant', cval=0.0, prefilter=True)
#MISSSEG_0 = shift(1.0*MISSSEG, pix_shift_diff_0, output=None, order=1, mode='constant', cval=0.0, prefilter=True)
PUPILLE_0 = shift(1.0*np.transpose(P_M4), pix_shift_diff_0, output=None, order=1, mode='constant', cval=0.0, prefilter=True)
log.info('Computing the wavefront correction by M4...')
......@@ -671,7 +684,7 @@ for i in range(len(HA_vect)):
#log.info('Differential dispersion angle with 2.45um: {0}'.format(alpha_disp_0))
x, X, Y, R, T = VECT(len(SP), 1132/1024)
E_0 = ft(np.transpose(SP)*(1-MISSSEG)*np.exp(2*1j*pi*WF_0/lambda_vect[k])*np.exp(-2*1j*pi*alpha_disp_0*Y), 1, BigD/D, BigD/D, 2*OWA, 2*OWA, 1, N_im, N_im)
E_0 = ft(np.transpose(SP)*MISSSEG*np.exp(2*1j*pi*WF_0/lambda_vect[k])*np.exp(-2*1j*pi*alpha_disp_0*Y), 1, BigD/D, BigD/D, 2*OWA, 2*OWA, 1, N_im, N_im)
#Commented to save time ; halo only
I_0=np.abs(E_0)**2
......@@ -698,7 +711,7 @@ for i in range(len(HA_vect)):
t_iter = 0
t_left = (N_LD*len(HA_vect)-(i*N_LD + k))*t_iter
I_s_0 = np.abs(ft(np.transpose(SP)*(1-MISSSEG)*np.exp(2*1j*pi*WF_0/lambda_vect[k])*np.exp(2*1j*pi*alpha_disp_0*Y), 1, BigD/D, BigD/D, 2*OWA, 2*OWA, 1, len(dsp), len(dsp)))**2
I_s_0 = np.abs(ft(np.transpose(SP)*MISSSEG*np.exp(2*1j*pi*WF_0/lambda_vect[k])*np.exp(2*1j*pi*alpha_disp_0*Y), 1, BigD/D, BigD/D, 2*OWA, 2*OWA, 1, len(dsp), len(dsp)))**2
FTO_tel_0 = ft(I_s_0, 1, 2*OWA, 2*OWA, DiamFTO, DiamFTO, 1, len(dsp), len(dsp))
I_s_post_0 = np.abs(ft(FTO_tel_0*FTO_atm, 1, DiamFTO, DiamFTO, 2*OWA, 2*OWA, 1, N_im, N_im))
......
......@@ -716,6 +716,8 @@ def AZAV_STAT(I,OWA,PhotAp,fraction):
def MAKE_ELT(WORKPATH,N,D,n_miss,ref_err):
#Problem of coherence between ESO pupil and this one
#D = D *1.021
C = fits.getdata(WORKPATH + 'Coord_ELT.fits')
#
N=N+N%2
......@@ -748,7 +750,7 @@ def MAKE_ELT(WORKPATH,N,D,n_miss,ref_err):
hexa = referr * hexa
#
return (hexa,color,MS)
return (hexa,color,MS,referr)
def EELTNLS(N,a1,a2,a3):
D=1
......
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