adding requests to conda install docs
[JPSSData.git] / comparison_cycling.m
blobff7a5d7e9dc98540308a8f6c80ac94dcd9bee37f
1 function comparison_cycling(files,comparison,bounds)
2 % Call:
3 % comparison_cycling(files,comparison,bounds) 
5 % Description:
6 % Plots a comparison of different results from make_mat.py
8 % Inputs:
9 %   files       cell of file names to compare (size available: from 1 to 3)
10 %   comparison  file with original pixel detections
11 %   bounds      array of [min_lon, max_lon, min_lat, max_lat]
13 % Developed in Matlab 9.2.0.556344 (R2017a) on MACINTOSH. 
14 % Angel Farguell (angel.farguell@gmail.com), 2019-03-21
15 %-------------------------------------------------------------------------
17 nfiles = length(files);
18 s_mark = 30;
20 figure,
22 load(comparison);
23 ax(1) = subplot(2,2,1);
24 scatter(lons,lats,s_mark,fires,'filled','o');
25 cmfire;
26 xlim([bounds(1),bounds(2)]);
27 ylim([bounds(3),bounds(4)]);
28 title('Original nodes to compare');
30 for k=2:nfiles+1 
31     [~,name{k-1},~] = fileparts(files{k-1});
32     load(files{k-1});
33     [rows,cols] = size(data);
34     geo = geotransform;
35     Xpixel=(0:cols-1)+0.5;
36     Ypixel=(0:rows-1)+0.5;
37     xx = geo(1)+Xpixel*geo(2);
38     yy = geo(4)+Ypixel*geo(6);
39     [lon,lat] = meshgrid(xx,yy);
40     mask = logical((lon > bounds(1)).*(lon < bounds(2)).*(lat > bounds(3)).*(lat < bounds(4)));
41     
42     ax(k) = subplot(2,2,k);
43     scatter(lon(mask),lat(mask),s_mark,data(mask),'filled','o'); cmfire;
44     xlim([bounds(1),bounds(2)]);
45     ylim([bounds(3),bounds(4)]);
46     title(sprintf('Fire mesh of %s',name{k-1}),'Interpreter','none');
47 end
49 linkaxes(ax,'xy');
51 end