forked from gpw8/MT_inversion_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreategrdrotxR.m
106 lines (86 loc) · 3.01 KB
/
creategrdrotxR.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
99
100
101
102
103
104
105
106
% gather results from grid searches
clear, close all
for band=4%[1:3,5]%:5;
if band==1
load('/Users/gpwaite/Data/Guate/Fuego2009/LuneGrid/rotxr/Full_lune_output_400_60_PWS_2016_04_17_02_23_02.mat')
% now grid the data
sorted=sortrows([gamma,delta,E2min]);
[x,y]=meshgrid(-30:1:30,0:1.5:90);
int=griddata(gamma,delta,E2min,x,y,'linear');
figure;imagesc(x(1,:),y(:,1),int);axis image
colorbar
axis xy
tittxt=sprintf('BP%d-%d PWS',1/LC,1/HC);
lunefname=sprintf('LunePlotBP%d-%d_PWS_.ps',1/LC,1/HC);
title(tittxt)
% print('-dpsc',lunefname)
% create grdfile
outfile=sprintf('lune_%03d_%02d_int1_E2_grid.grd',1/LC,1/HC);
grdwrite2(x(1,:),y(:,1),int,outfile)
elseif band==2
% LC=1/400;
% HC=1/10;
% now grid the data
sorted=sortrows([gamma,delta,E2min]);
[x,y]=meshgrid(-30:1:30,0:1.5:90);
int=griddata(gamma,delta,E2min,x,y,'linear');
figure;imagesc(x(1,:),y(:,1),int);axis image
colorbar
axis xy
tittxt=sprintf('BP%d-%d PWS',1/LC,1/HC);
lunefname=sprintf('LunePlotBP%d-%d_PWS_.ps',1/LC,1/HC);
title(tittxt)
%print('-dpsc',lunefname)
% create grdfile
outfile=sprintf('lune_%03d_%02d_int1_E2_grid.grd',1/LC,1/HC);
grdwrite2(x(1,:),y(:,1),int,outfile)
elseif band==3
load('Full_lune_output_120_10_PWS_2016_04_17_02_00_22.mat')
% now grid the data
sorted=sortrows([gamma,delta,E2min]);
[x,y]=meshgrid(-30:1:30,0:1.5:90);
int=griddata(gamma,delta,E2min,x,y,'linear');
figure;imagesc(x(1,:),y(:,1),int);axis image
colorbar
axis xy
tittxt=sprintf('BP%d-%d PWS',1/LC,1/HC);
lunefname=sprintf('LunePlotBP%d-%d_PWS_.ps',1/LC,1/HC);
title(tittxt)
%print('-dpsc',lunefname)
% create grdfile
outfile=sprintf('lune_%03d_%02d_int1_E2_grid.grd',1/LC,1/HC);
grdwrite2(x(1,:),y(:,1),int,outfile)
elseif band==4
load('Full_lune_output_60_10_PWS_2016_04_17_02_47_32.mat')
% now grid the data
sorted=sortrows([gamma,delta,E2min]);
[x,y]=meshgrid(-30:1:30,0:1.5:90);
int=griddata(gamma,delta,E2min,x,y,'linear');
figure;imagesc(x(1,:),y(:,1),int);axis image
colorbar
axis xy
tittxt=sprintf('BP%d-%d PWS',1/LC,1/HC);
lunefname=sprintf('LunePlotBP%d-%d_PWS_.ps',1/LC,1/HC);
title(tittxt)
%print('-dpsc',lunefname)
% create grdfile
outfile=sprintf('lune_%03d_%02d_int1_E2_grid.grd',1/LC,1/HC);
grdwrite2(x(1,:),y(:,1),int,outfile)
elseif band==5
load('Full_lune_output_30_10_PWS_2016_04_17_02_46_38.mat')
% now grid the data
sorted=sortrows([gamma,delta,E2min]);
[x,y]=meshgrid(-30:1:30,0:1.5:90);
int=griddata(gamma,delta,E2min,x,y,'linear');
figure;imagesc(x(1,:),y(:,1),int);axis image
colorbar
axis xy
tittxt=sprintf('BP%d-%d PWS',1/LC,1/HC);
lunefname=sprintf('LunePlotBP%d-%d_PWS_.ps',1/LC,1/HC);
title(tittxt)
%print('-dpsc',lunefname)
% create grdfile
outfile=sprintf('lune_%03d_%02d_int1_E2_grid.grd',1/LC,1/HC);
grdwrite2(x(1,:),y(:,1),int,outfile)
end
end