adding requests to conda install docs
[JPSSData.git] / plot_cycling.m
blobc3001ec2513787513af1378b8b76a4c243180581
1 function plot_cycling(file,varargin)
2 % Call:
3 % plot_cycling(file) 
4 % plot_cycling(file,bounds)
5 % plot_cycling(file,bounds,comparison)
7 % Description:
8 % Plots a granule from make_mat.py, input file for cycling
10 % Inputs:
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);
20 s_mark = 50;
22 load(file);
24 [rows,cols] = size(data);
25 geo = geotransform;
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); 
33 cmfire;
34 set(h,'EdgeColor','None'); 
35 title(sprintf('Whole granule of %s',name),'Interpreter','none');
37 if nargin > 1
38     bounds = varargin{1};
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'); 
41     cmfire;
42     xlim([bounds(1),bounds(2)]);
43     ylim([bounds(3),bounds(4)]);
44     title(sprintf('Fire mesh of %s',name),'Interpreter','none');
45     if nargin > 2
46         compare = varargin{2};
47         load(compare)
48         figure, 
49         scatter(lons,lats,s_mark,fires,'filled','o');
50         cmfire;
51         xlim([bounds(1),bounds(2)]);
52         ylim([bounds(3),bounds(4)]);
53         title('Original nodes to compare');
54     end
55 end
57 end