1) make_mat.py: new implementation interpolating only on fire mesh, and printing...
[JPSSData.git] / plot_cycling.m
blob0820ccea505aa32ce0932e55f832300ebd6c8b45
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 [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); 
30 cmfire;
31 set(h,'EdgeColor','None'); 
32 title(sprintf('Whole granule of %s',name),'Interpreter','none');
34 if nargin > 1
35     bounds = varargin{1};
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'); 
38     cmfire;
39     xlim([bounds(1),bounds(2)]);
40     ylim([bounds(3),bounds(4)]);
41     title(sprintf('Fire mesh of %s',name),'Interpreter','none');
42     if nargin > 2
43         compare = varargin{2};
44         load(compare)
45         figure, 
46         scatter(lons,lats,s_mark,fires,'filled','o');
47         cmfire;
48         xlim([bounds(1),bounds(2)]);
49         ylim([bounds(3),bounds(4)]);
50         title('Original nodes to compare');
51     end
52 end
54 end