Merge branch 'fixf'
[wrf-fire-matlab.git] / detection / fire_pixels3d.m
blobd585b4fc59360689cfd0c9d6b38be7b381479b2b
1 function fire_pixels3d(obs,base_time)
2 % fire_pixels(obs,base_time)
3 % fire_pixels(obs,base_time,dim)
4 % in
5 %   obs         structure array of observations
6 %   base_time   the start of simulations
10 for i=1:length(obs)
11     x=obs(i);
12     kk=find(x.data(:)>=7);
13     if ~isempty(kk),
14         rlon=0.5*abs(x.lon(end)-x.lon(1))/(length(x.lon)-1);
15         rlat=0.5*abs(x.lat(end)-x.lat(1))/(length(x.lat)-1);
16         lon1=x.xlon(kk)-rlon;
17         lon2=x.xlon(kk)+rlon;
18         lat1=x.xlat(kk)-rlat;
19         lat2=x.xlat(kk)+rlat;
20         X=[lon1,lon2,lon2,lon1]';
21         Y=[lat1,lat1,lat2,lat2]';
22         Z=ones(size(X))*(x.time-base_time);
23         cmap=cmapmod14;
24         C=cmap(x.data(kk)'+1,:);
25         C=reshape(C,length(kk),1,3);
26         patch(X,Y,Z,C);
27         hold on
28     end
29 end
30 hold off
33 % work with L2 data
34 % if obs(1).file(end) == 'z'
35 %     fprintf('Skipping plot of detection pixels in 3d \n')
36 %     hold on
37 %     for i = 1:length(obs)
38 %         t = obs(i).time-base_time;
39 %         mask = obs(i).data >6;
40 %         t1 = t*ones(size(obs(i).data));
41 %         scatter3(obs(i).lon(mask),obs(i).lat(mask),t1(mask),'r*')
42 %     end
43 %     hold off
44 %         
45 % end %working with L2 data
47 end