1 % testing whether the new likelihood works to find ignition point
\r
9 true_tign = make_times(ignition_x,ignition_y,ignition_time,domain_size);
\r
14 mask = zeros(domain_size,domain_size);
\r
15 centers = [187 751;128 653;106 539;639 126;842 301;783 219];
\r
16 [m n] = size(centers);
\r
19 for ii = centers(ic,1)-pixel_size:centers(ic,1)+pixel_size
\r
20 for jj = centers(ic,2)-pixel_size:centers(ic,2)+pixel_size
\r
31 % set up "simlulation grid"
\r
32 dx = 100; x_steps = 9;
\r
33 dy = 100; y_steps = 9;
\r
34 dt = 100; time_steps = 3;
\r
39 data_spec = 'data_%d_%d_%d';
\r
40 file_spec = 'data_%d_%d_%d.mat';
\r
41 save_spec = 'C:\cygwin64\home\paulc\wrf-fire\other\Matlab\detect_ignition\new_likelihood\data\data_%d_%d_%d.mat';
\r
46 % %create and save data for "simulations"
\r
47 % for ig_time = 0:time_steps
\r
48 % ignition_time = ig_time*dt+100;
\r
49 % for ig_x = 1:x_steps
\r
50 % ignition_x = ig_x*dx;
\r
51 % for ig_y = 1:y_steps
\r
52 % ignition_y = ig_y*dy;
\r
53 % counter = counter + 1;
\r
55 % tign = make_times(ignition_x,ignition_y,ignition_time,domain_size);
\r
57 % name = sprintf(data_spec,ignition_time,ignition_x,ignition_y);
\r
59 % file = sprintf(file_spec,ignition_time,ignition_x,ignition_y);
\r
60 % files{counter} = file;
\r
61 % %save_str = sprintf(save_spec,ignition_time,ignition_x,ignition_y);
\r
79 %compute likelihoods
\r
83 weight = gauss_weight(radius);
\r
86 [mm nn] = size(files);
\r
87 like_list = zeros(nn,1);
\r
95 heat = make_heats(data.tign,t_now);
\r
96 like = compute_likelihood(heat,mask,radius,weight)
\r
98 like_list(i) = like;
\r
107 % contour(reshape(like_list(1:81,1),[9 9]))
\r
109 % contour(reshape(like_list(82:2*81,1),[9 9]))
\r
111 % contour(reshape(like_list(163:3*81,1),[9 9]))
\r
113 g_points = x_steps*y_steps;
\r
114 for figs =1:time_steps+1
\r
116 contour(reshape(like_list((figs-1)*g_points+1:figs*g_points,1),[x_steps y_steps]))
\r
119 for figs =1:time_steps+1
\r
121 mesh(reshape(like_list((figs-1)*g_points+1:figs*g_points,1),[x_steps y_steps]))
\r