Commit 407f131f authored by Arthur Vigan's avatar Arthur Vigan
Browse files

Save chromatic shift in fits file, fixed file name

parent 24fb2a33
......@@ -575,6 +575,7 @@ df = np.abs(f1D[1]-f1D[0])*fudge_df
# |_____/|_____|_| |_|\____/|______/_/ \_\_| |_____|_| \_|\_____| |______/_/ \_\_| \____/|_____/ \____/|_| \_\______|_____/
#
SR = np.zeros((len(HA_vect), N_LD))
CHROMATIC_SHIFT = np.zeros((len(HA_vect), N_LD))
log.info('Computing the different exposures...')
for i in range(len(HA_vect)):
......@@ -767,9 +768,7 @@ for i in range(len(HA_vect)):
#MASK_temp = MASK
MASK_temp = shift(MASK, [-shift_pix_FPM, 0], output=None, order=1, mode='constant', cval=0.0, prefilter=True)
for k in range(N_LD):
if ADC_flag == 1:
shift_value = 1000*DISPER_ADC(lambda_vect[0]*1e6, lambda_vect[k]*1e6, 90-ELEVATION(DEC, HA_0), z_min, z_max)
shift_value /= MASperPIXEL
......@@ -779,13 +778,11 @@ for i in range(len(HA_vect)):
#print(shift_value*MASperPIXEL)
I_temp[k, :, :] = I_temp[k, :, :]*np.flipud(MASK_temp)
I_temp[k, :, :] = shift(I_temp[k, :, :], [shift_value, 0], output=None, order=1, mode='constant', cval=0.0, prefilter=True)
CHROMATIC_SHIFT[i, k] = shift_value
I_temp[k] = I_temp[k, :, :]*np.flipud(MASK_temp)
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')
fits.setval(image_filename, 'TELESCOP', value='ESO-ELT')
......@@ -797,6 +794,7 @@ for i in range(len(HA_vect)):
fits.setval(image_filename, 'APODIZER', value=APODIZER)
fits.setval(image_filename, 'FPM', value=FPM)
image_filename_nomask = path_directory + 'PSF_HALO_ON_notmasked_notcentered_Nexp{0:04d}.fits'.format(i)
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')
......@@ -808,8 +806,12 @@ for i in range(len(HA_vect)):
fits.setval(image_filename_nomask, 'APODIZER', value=APODIZER)
fits.setval(image_filename_nomask, 'FPM', value=FPM)
SR_filename = path_directory + 'SR.fits'.format(i)
shift_filename = path_directory + 'CHROMATIC_SHIFT.fits'
fits.writeto(shift_filename, CHROMATIC_SHIFT)
SR_filename = path_directory + 'SR.fits'
fits.writeto(SR_filename, SR)
log.info('Total time: {0:.2f} min'.format((time.time()-start_time)/60))
#save(['DATA_Aberrations_CONFIG=' CONFIG '_DEC=' num2str(DEC) 'deg_TimeBetweenExp=' num2str(TIMEBETWEENEXPOSURES) 'min_MeanTimeAfterMeridian=' num2str(HA_offset) 'h.dat'], 'DATA_AB')
......
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