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 [Nlat,Nlon] = size(data);
25 xx = linspace(geotransform(1),geotransform(1)+geotransform(2)*(Nlon-1),Nlon);
26 yy = linspace(geotransform(4)-geotransform(6)*(Nlat-1),geotransform(4),Nlat);
27 [lon,lat] = meshgrid(xx,yy);
29 figure, h=pcolor(lon,lat,data);
31 set(h,'EdgeColor','None');
32 title(sprintf('Whole granule of %s',name),'Interpreter','none');
36 mask = logical((lon > bounds(1)).*(lon < bounds(2)).*(lat > bounds(3)).*(lat < bounds(4)));
37 figure, scatter(lon(mask),lat(mask),s_mark,data(mask),'filled','s');
39 xlim([bounds(1),bounds(2)]);
40 ylim([bounds(3),bounds(4)]);
41 title(sprintf('Fire mesh of %s',name),'Interpreter','none');
43 compare = varargin{2};
46 scatter(lons,lats,s_mark,fires,'filled','o');
48 xlim([bounds(1),bounds(2)]);
49 ylim([bounds(3),bounds(4)]);
50 title('Original nodes to compare');