4 mask = zeros(domain_size,domain_size);
5 %strip = ones(domain_size,1);
6 mask(:,domain_size/2) = 1;
8 time_start = -72; time_end = 72;
9 time_strip = linspace(time_start,time_end,domain_size);
10 ts2 = linspace(0,1,domain_size); %dummy dimension
11 [x,y] = meshgrid(time_strip,ts2);
12 times = zeros(domain_size);
14 times(i,:) = time_strip;
17 dp = detection_probability(times);
18 d_strip = dp(domain_size/2,:);
19 figure,plot(time_strip,d_strip),title('detection probability'),
20 xlabel('time since fire arrival')
21 ylabel('probability of detection')
24 % figure,plot(time_strip,log(d_strip)),title('log detection probability'),
25 % xlabel('time since fire arrival')
26 % ylabel('log probability of detection')
29 % gauss_strip = 1/(2*pi*sig^2)*exp(-time_strip.^2/(2*sig^2));
30 %gauss_strip = exp(-time_strip.^2/(2*sig^2));
32 % figure,plot(time_strip,gauss_strip),title('geolocation stuff');
33 % xlabel('time since fire arrival')
36 % log_g = log(gauss_strip);
37 % figure,plot(time_strip,log_g),title('log geolocation stuff');
38 % xlabel('time since fire arrival')
39 % ylabel('log gaussian')
41 % new = log(gauss_strip)+log(d_strip);
42 % figure,plot(time_strip,new),title('new')
48 weight = gauss_weight(radius);
49 dx = 30; %in meters, this is grid spacing, dy = dx also
51 % make distance matrix one time and then pass into the gaussin computation
52 d_squared = zeros(radius*2+1,radius*2+1);
53 [m,n] = size(d_squared);
56 d_squared(i,j) = i^2+j^2+2*(radius+1)^2-2*(radius+1)*(i+j);
58 d_squared(i,j) = 0.5*d_squared(i,j);
63 d_squared = d_squared+d_squared';
64 d_squared = dx^2*d_squared;
65 sig = 1000/3; %1000 meters at sig 3
66 %figure,mesh(exp(-d_squared/(2*pi*sig^2)));
69 for i=radius+1:domain_size-radius
71 temp_prob = dp(domain_size/2-radius:domain_size/2+radius,i-radius:i+radius);
72 %l = compute_pixel_probability(500,i,heat,radius, weight, detection_probs );
73 gauss = exp(-d_squared/(2*sig^2));
74 prob = gauss.*temp_prob;
75 l = log(sum(prob(:))/(2*pi*sig^2));
80 short_time = time_strip(1,radius+1:end-radius);
81 l2 = like-max(like(:))+max(like(:))/1000;
82 figure,plot(short_time,l2),title('pixel log likelihood')
83 xlabel('Hours since fire arrival')
84 ylabel('Log likelihood of detection')
85 %xlim([(round(min(short_time))-1) (round(max(short_time))+1)])
89 l2_prime = zeros(1,length(short_time));
90 h = short_time(2) - short_time(1);
91 for i = 2:length(short_time)-1
92 l2_prime(i) = (l2(i-1)-l2(i+1))/(2*h);
94 l2_prime(1) = l2_prime(2);
95 l2_prime(end)=l2_prime(end-1);
96 figure,plot(short_time,l2_prime),title('Derviative')