-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultibandimg.m
98 lines (85 loc) · 3.4 KB
/
multibandimg.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
% Script to display images from multiple subbands as a matrix.
% Based on genfftimage.m
% pep/22Nov12
function multibandimg (ntslices)
sband0 = '~/WORK/AARTFAAC/Reobs/11Jul12/LBA_OUTER_BAND_SPREAD/full_conv/SB000_LBA_OUTER_SPREAD_1ch_1_convcal.bin';
sband1 = '~/WORK/AARTFAAC/Reobs/11Jul12/LBA_OUTER_BAND_SPREAD/full_conv/SB001_LBA_OUTER_SPREAD_1ch_1_convcal.bin';
sband2 = '~/WORK/AARTFAAC/Reobs/11Jul12/LBA_OUTER_BAND_SPREAD/full_conv/SB002_LBA_OUTER_SPREAD_1ch_1_convcal.bin';
sband3 = '~/WORK/AARTFAAC/Reobs/11Jul12/LBA_OUTER_BAND_SPREAD/full_conv/SB003_LBA_OUTER_SPREAD_1ch_1_convcal.bin';
sband4 = '~/WORK/AARTFAAC/Reobs/11Jul12/LBA_OUTER_BAND_SPREAD/full_conv/SB004_LBA_OUTER_SPREAD_1ch_1_convcal.bin';
fids = zeros (1,5);
fids(1) = fopen (sband0, 'rb');
fids(2) = fopen (sband1, 'rb');
fids(3) = fopen (sband2, 'rb');
fids(4) = fopen (sband3, 'rb');
fids(5) = fopen (sband4, 'rb');
radec = 0;
duv = 2.5; % Default, reassigned from freq. of obs. to
% image just the full Fov (-1<l<1)
Nuv = 500; %1000 % size of gridded visibility matrix
uvpad = 512; %1024 % specifies if any padding needs to be added
hdl = figure;
fid = zeros (1, 5);
for ind = 1:5
% Obtain image parameters from visibility file.
[acc, t_obs, fr] = readms2float (fids(ind), -1, -1, 288);
freq(ind) = fr;
lambda(ind) = 299792458/freq(ind); % in m.
duv(ind) = lambda(ind)/2;
% dimensionless, in dir. cos. units
dl(ind) = (299792458/(freq(ind) * uvpad * duv(ind)));
end
station = 0;
% For imaging from a single station
% acc_tmp = acc;
% acc = zeros (48, 48);
% acc = acc_tmp (1:48, 1:48);
% acc = acc_tmp (49:96, 49:96);
% acc = acc_tmp (97:144, 97:144);
% NOTE: Total imaged Field of View is determined by the visibility
% grid-spacing, duv.
lmax = dl * uvpad / 2;
% l = [-lmax:dl:lmax-1e-3];
% m = l; % Identical resolution and extent along m-axis
% Local horizon based coordinates of array in ITRF
load ('poslocal.mat', 'posITRF', 'poslocal');
% load 3CR catalog
load ('srclist3CR.mat');
% Generate uv coordinates in local horizon coord. system, needed for imaging
uloc = meshgrid (poslocal(:,1)) - meshgrid (poslocal (:,1)).';
vloc = meshgrid (poslocal(:,2)) - meshgrid (poslocal (:,2)).';
% for ts = 1:ntslices
for ind = 1:5
[acc, t_obs, fr] = readms2float (fids(ind), -1, -1, 288);
if (isempty (acc) == false)
disp (['Time/Freq: ' num2str(t_obs) ' ' num2str(freq)]);
% Image current timeslice.
[radecmap, calmap, calvis, l, m] = ...
fft_imager_sjw_radec (acc(:), uloc(:), vloc(:), ...
duv(ind), Nuv, uvpad, t_obs, fr, radec);
subplot (2,3,ind)
image (l,m,abs(calmap));
% imagesc(l, m, calmap);
% if isempty (caxisrng) == 0
% caxis (caxisrng);
% end;
% [sel, sel_l, sel_m] = overplotcat (t_obs, srclist3CR, 20, hdl,true);
% set(gca, 'FontSize', 16);
title(['Time: ' num2str(t_obs) ', Freq: ' num2str(freq(ind))]);
axis equal
axis tight
xlabel('South \leftarrow m \rightarrow North');
ylabel('East \leftarrow l \rightarrow West');
set(colorbar, 'FontSize', 16);
end
% % Read in next visibility set.
% [acc, t_obs, freq] = readms2float (fin, -1, -1);
% if (isempty (acc))
% disp ('End of file reached!');
% break;
% end;
% pause (0.01);
% else
% disp ('File end reached!');
% end;
end;