1 function [ pix_prob ] = compute_pixel_probability(pixel_x,pixel_y,heats,sig, weight, detection_probabilities )
\r
2 %[ pix_prob ] = compute_pixel_probability(pixel_x,pixel,_y,heats,radius )
\r
3 % computes the probability of detection at a specific fire pixel.
\r
5 % pixel_x, pixel_y : location of fire pixel
\r
6 % heats : array with simulated heat output
\r
7 % sig : standard deviation of gaussian
\r
8 % pixel_probabilities:matrix of probabilities of detection
\r
10 % pix_prob : probability of detection at the pixel given by satellite
\r
14 [m,n] = size(heats);
\r
16 %since gaussian decays fast, no need to integrate over the whole domain.
\r
17 %compute how much we need to look at here
\r
18 %radius = round(sig*sqrt(32*log(10)))+1;
\r
19 %const = 1/(2*pi*sig^2); % not needed for discrete
\r
26 for iii = pixel_x-radius+1:pixel_x+radius % this can fail if detections too close to the domain boundary, fix it
\r
27 for jjj = pixel_y-radius+1:pixel_y+radius
\r
28 detect_prob = detection_probabilities(iii,jjj);
\r
29 %dp = detection_probability(heats(iii,jjj)); % matrix of heat
\r
31 gp = gauss_part(pixel_x,pixel_y,iii,jjj,sig);
\r
32 total = total + detect_prob*gp*weight;
\r
37 % doing integral formal instead...
\r
38 % for iii = pixel_x-radius:pixel_x+radius % this can fail if detections too close to the domain boundary, fix it
\r
39 % for jjj = pixel_y-radius:pixel_y+radius
\r
40 % gp = const*gauss_part(pixel_x,pixel_y,iii,jjj,sig);
\r
41 % total = total + detection_probabilities(iii,jjj)*gp;
\r
46 % for iii = border:m-border
\r
47 % for jjj = border:n-border
\r
48 % %gp is just the exponential part of gaussian
\r
49 % gp = gauss_part(pixel_x,pixel_y,iii,jjj,sig);
\r
50 % total = total + detection_probabilities(iii,jjj)*gp*dx*dy;
\r