-
Notifications
You must be signed in to change notification settings - Fork 0
/
process_reverse.m
47 lines (33 loc) · 1.33 KB
/
process_reverse.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function process_reverse(fname, Progress)
name = fname(1:end-5);
path = sprintf('./simu_reverse/%s/', name);
mkdir('simu_reverse');
mkdir('simu_reverse', name);
[A,hdr] = readfits(fname);
waitbar(0.1, Progress, 'R�cup�ration delyotamplitude complexe');
% TF -> PSF Coronographique
waitbar(0.2, Progress, 'TF 1');
A = fftshift(fft2(fftshift(A)));
writefits(sprintf('%sReverse-1a-TFLyot.fits',path),A);
writefits(sprintf('%sReverse-1b-TFLyot.fits',path),abs(A).^2);
% TF-1
waitbar(0.4, Progress, 'TF 2');
A = fftshift(ifft2(fftshift(A)));
writefits(sprintf('%sReverse-2b-TFMasque2.fits',path), A);
writefits(sprintf('%sReverse-2b-TFMasque2.fits',path), abs(A).^2);
% Cr�ation du masque
[N,N2]=size(A);
waitbar(0.6, Progress, 'G�n�ration du masque');
M = FQPM(N, N/2, N/2);
writefits(sprintf("%sReverse-3-Masque.fits",path), M);
% Application du masque
waitbar(0.8, Progress, 'Application du masque');
A = A .* M;
writefits(sprintf('%sReverse-4a-TFMasque.fits',path), A);
writefits(sprintf('%sReverse-4a-TFMasque.fits',path), abs(A).^2);
% Pupille: TF -> PSF
waitbar(1.0, Progress, 'TF 1');
A = fftshift(fft2(fftshift(A)));
writefits(sprintf('%sReverse-5a-TFPupille.fits',path), A);
writefits(sprintf('%sReverse-5b-TFPupille.fits',path),abs(A).^2);
endfunction