1 function sp = hot_spots(p_gran,red)
2 %function lookts at satellie data between perimeter observations and
3 %clusters data into back fire , fire froint
5 %p_gran - struct with perimeters in the format of l2 active fire granules
6 %red = red = subset_domain(w)
9 %display and chose which perimeters to work with
12 fprintf('%d :%s %s \n',i,p_gran(i).file,datestr(p_gran(i).time))
14 pt = input_num('Which two perimeters to use as time points? Enter in time order.',[1 2])
15 t1 = p_gran(pt(1)).time;
16 t2 = p_gran(pt(2)).time;
17 fprintf('Start date: %s\n',datestr(t1))
18 fprintf('End date: %s\n',datestr(t2))
19 %subset detection data
20 [~,~,prefix,perim] = fire_choice();
22 time_bounds(1) = t1-time_cushion;
23 time_bounds(2) = t2+time_cushion;
27 p = sort_rsac_files(prefix);
30 if ~exist(g_str,'file')
32 g = subset_l2_detections(prefix,p,red,time_bounds,fig);
33 save(g_str, 'g', '-v7.3');
36 reload_dets = input_num('Reload detections? 1 = yes',0);
38 g = subset_l2_detections(prefix,p,red,time_bounds,fig);
39 save(g_str, 'g', '-v7.3');
44 %allow for ealier and later data
48 if (sum(g(i).det(3:5)) >0) && (g(i).time > t1-time_cushion) && (g(i).time < t2+time_cushion)
49 fprintf('reading satellite data')
50 fires = g(i).conf >= min_con;
51 lons = g(i).lon(fires);
52 lats = g(i).lat(fires);
53 times = g(i).time*ones(size(lons));
54 confs = double(g(i).conf(fires));
55 frps = g(i).power(fires);
56 gran = i*ones(size(lons));
57 pts = [pts;[lats',lons',times',confs',frps',gran']];
59 fprintf('No Fires, or fires outside of time boundary. Time = %s\n',datestr(g(i).time))
62 %plot perims and the detection data
63 figure,scatter(p_gran(pt(1)).lon,p_gran(pt(1)).lat,'k')
65 scatter(p_gran(pt(2)).lon,p_gran(pt(2)).lat,'b')
66 scatter(lons,lats,'*r')
67 legend('Perimeter 1','Perimeter 2','Fire Detections')