debugging
[wrf-fire-matlab.git] / cycling / plot_paths2d.m
blob9f5e5180b7c6c742049c2ac3106f760650bbbe1e
1 function plot_paths2d(path_struct)
2 %plots paths in 2d setting
3 % input: path_struct - structure with graph, paths, red, etc...
4 %        path_struct = graph_dets(w,cull)
5 r = path_struct.red;
7 % draw filled contour of fuels
8 fuel_map = r.nfuel_cat;
9 %fuel_map = simp_fuels(fuel_map);
10 figure,contourf(r.fxlong,r.fxlat,fuel_map,'LineWidth',0.5);
11 colormap summer;
13 %draw paths on figure
14 paths = path_struct.paths;
15 pts = path_struct.points;
16 hold on
17 for i = 1:length(paths)
18     p = paths(i).p;
19     plot(pts(p,2),pts(p,1),'r','LineWidth',2);
20 end %for i
21 hold off
23 %plot elevation data and paths
25 % draw filled contour of fuels
26 elev = r.fhgt;
27 %fuel_map = simp_fuels(fuel_map);
28 figure,contour(r.fxlong,r.fxlat,elev,'k','LineWidth',0.5,'ShowText','on');
30 %draw paths on figure
31 paths = path_struct.paths;
32 pts = path_struct.points;
33 hold on
34 for i = 1:length(paths)
35     p = paths(i).p;
36     plot(pts(p,2),pts(p,1),'r','LineWidth',2);
37 end %for i
38 hold off
40 %plot paths with gradient of surface
41 %smooth surface first
42 r.tign = imgaussfilt(r.tign,1/2)
43 [dx,dy]= fire_gradients(r.fxlong,r.fxlat,r.tign,1);
45 figure,contour(r.fxlong,r.fxlat,r.tign)
46 hold on
47 quiver(r.fxlong,r.fxlat,dy,dx)
48 for i = 1:length(paths)
49     p = paths(i).p;
50     plot(pts(p,2),pts(p,1),'r','LineWidth',1);
51 end %for i
52 hold off
55 end %function