Commit 06d64df5 authored by Alexis Carlotti's avatar Alexis Carlotti
Browse files

Modification of fits saving of no masked images: from single slices to cubes

parent 09d954aa
......@@ -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_2'
APODIZER = 'SP_1'
#disp(['Observation time will be: ' num2str(Delta_HA) 'h'])
#disp(['Observation starts ' num2str(HA_offset) 'h before meridian'])
......@@ -82,7 +82,7 @@ Mid_HA = 0.2 #%0%30/60;
### !!! DO NOT CHANGE THAT FOR THE MOMENT !!! ################################
#Total observation time [hours] ; must be 2h to correctly use dsp data
T_obs = 2 #;%1/60;%30/60;%1/60
T_obs = 2#2 #;%1/60;%30/60;%1/60
#Exposure time of individual exposures [hours]
T_exp = 1/60
......@@ -91,7 +91,7 @@ T_exp = 1/60
N_exp = np.int(T_obs/T_exp)# %60 exposures per hour = 1 per minute
##############################################################################
BAND = 'H' # %Choose between the bands defined hereafter (use a valid string)
BAND = 'TEST_H' # %Choose between the bands defined hereafter (use a valid string)
### Bands ###
......@@ -631,6 +631,7 @@ for i in range(len(HA_vect)):
Wind_Angle = Wind_Angle_vect[i]
I_temp = np.zeros([N_LD, N_im, N_im])
I_temp_nomask = np.zeros([N_LD, N_im, N_im])
shift_value = np.zeros(N_LD)
dsp = dsp_array[i]
......@@ -719,7 +720,7 @@ for i in range(len(HA_vect)):
#disp(['5 sigma static Contrast at 200 mas - NO HALO: ' num2str(5*std(I_stat_nohalo(REG_200==1)))])
#disp(['Static Contrast -- std -- w/ E2E model: ' num2str(5*std(I_stat(REG==1)))])
fits.writeto(path_directory + 'PSF_HALO_ON_Nexp{0:03d}_Nlbd{1:04d}.fits'.format(i, k), I_s_post_0)
#fits.writeto(path_directory + 'PSF_HALO_ON_Nexp{0:03d}_Nlbd{1:04d}.fits'.format(i, k), I_s_post_0)
# I1D = I_s_post_0[:, 107]
# I1D = I1D/sum(I1D)
......@@ -728,6 +729,7 @@ for i in range(len(HA_vect)):
# shift_value[k] = alpha_shift/(x_mask[1]-x_mask[0])
I_temp[k, :, :] = I_s_post_0
I_temp_nomask[k, :, :] = I_s_post_0
# if exhaustive_writing_flag==1:
# fits.writeto(path_directory + 'PSF_HALO_OFF_Nexp{0}_Nlbd{1}.fits'.format(i, k), I_0)
......@@ -778,6 +780,7 @@ for i in range(len(HA_vect)):
I_temp[k,:,:] = shift(I_temp[k,:,:], [shift_value,0], output=None, order=1, mode='constant', cval=0.0, prefilter=True)
image_filename = path_directory + 'PSF_HALO_ON_masked_centered_Nexp{0:04d}.fits'.format(i)
image_filename_nomask = path_directory + 'PSF_HALO_ON_notmasked_centered_Nexp{0:04d}.fits'.format(i)
fits.writeto(image_filename, I_temp)
fits.setval(image_filename, 'ORIGIN', value='ESO-ARMAZONES')
......@@ -789,6 +792,17 @@ for i in range(len(HA_vect)):
fits.setval(image_filename, 'DISPELEM', value=BAND)
fits.setval(image_filename, 'APODIZER', value=APODIZER)
fits.setval(image_filename, 'FPM', value=FPM)
fits.writeto(image_filename_nomask, I_temp_nomask)
fits.setval(image_filename_nomask, 'ORIGIN', value='ESO-ARMAZONES')
fits.setval(image_filename_nomask, 'TELESCOP', value='ESO-ELT')
fits.setval(image_filename_nomask, 'INSTRUME', value='HARMONI')
fits.setval(image_filename_nomask, 'EXPTIME', value='{:.3f}'.format(T_exp*3600))
fits.setval(image_filename_nomask, 'AIRMASS', value='{:.3f}'.format(1/np.cos(np.pi/180*(90-ELEVATION(DEC*1.0,HA_0)))))
fits.setval(image_filename_nomask, 'PI-COI', value='NIRANJAN')
fits.setval(image_filename_nomask, 'DISPELEM', value=BAND)
fits.setval(image_filename_nomask, 'APODIZER', value=APODIZER)
fits.setval(image_filename_nomask, 'FPM', value=FPM)
log.info('Total time: {0:.2f} min'.format((time.time()-start_time)/60))
......
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