1 function plot_cycling(file,varargin)
4 % plot_cycling(file,bounds)
5 % plot_cycling(file,bounds,comparison)
8 % Plots a granule from make_mat.py, input file for cycling
11 % file matlab file output of make_mat.py
12 % bounds optional: array of [min_lon, max_lon, min_lat, max_lat]
13 % comparison file with original pixel detections
15 % Developed in Matlab 9.2.0.556344 (R2017a) on MACINTOSH.
16 % Angel Farguell (angel.farguell@gmail.com), 2019-03-20
17 %-------------------------------------------------------------------------
19 [~,name,~] = fileparts(file);
24 [rows,cols] = size(data);
26 Xpixel=(0:cols-1)+0.5;
27 Ypixel=(0:rows-1)+0.5;
28 xx = geo(1)+Xpixel*geo(2);
29 yy = geo(4)+Ypixel*geo(6);
30 [lon,lat] = meshgrid(xx,yy);
32 figure, h=pcolor(lon,lat,data);
34 set(h,'EdgeColor','None');
35 title(sprintf('Whole granule of %s',name),'Interpreter','none');
39 mask = logical((lon > bounds(1)).*(lon < bounds(2)).*(lat > bounds(3)).*(lat < bounds(4)));
40 figure, scatter(lon(mask),lat(mask),s_mark,data(mask),'filled','s');
42 xlim([bounds(1),bounds(2)]);
43 ylim([bounds(3),bounds(4)]);
44 title(sprintf('Fire mesh of %s',name),'Interpreter','none');
46 compare = varargin{2};
49 scatter(lons,lats,s_mark,fires,'filled','o');
51 xlim([bounds(1),bounds(2)]);
52 ylim([bounds(3),bounds(4)]);
53 title('Original nodes to compare');