1 function v=readmod14(prefix,file,silent)
3 % read modis data and return v.lon v.lat v.data
8 [v.time,v.timestr]=rsac2time(file);
9 if ~exist('silent','var'),
10 fprintf('file name w/prefix %s\n',pfile);
11 fprintf('file name %s\n',file);
12 fprintf('image time %s\n',datestr(v.time));
14 [rows,cols]=size(v.data);
16 Xpixel=[0:cols-1]+0.5;
17 Ypixel=[0:rows-1]+0.5;
18 v.lon = geo(1)+Xpixel*geo(2);
19 v.lat = geo(4)+Ypixel*geo(6); %subtraction for camp
21 if any(v.data(:)<0 | v.data(:)>9),
22 warning('Value out of range 0 to 9 for MODIS14 data')
25 count(i+1)=sum(v.data(:)==i);
29 v.pixels.unknown= count(1)+count(2)+count(3)+count(7);
30 v.pixels.water = count(4);
31 v.pixels.cloud = count(5);
32 v.pixels.land = count(6);
33 v.pixels.fire = count(8:10);
36 if ~exist('silent','var'),
38 fprintf('rows %i\n',rows)
39 fprintf('cols %i\n',cols)
40 fprintf('top left X %19.15f\n',geo(1))
41 fprintf('W-E pixel resolution %19.15f\n',geo(2))
42 fprintf('rotation, 0=North up %19.15f\n',geo(3))
43 fprintf('top left Y %19.15f\n',geo(4))
44 fprintf('rotation, 0=North up %19.15f\n',geo(5))
45 fprintf('N-S pixel resolution %19.15f\n',geo(6))
46 fprintf('unprocessed/unknown %i\n',v.pixels.unknown)
47 fprintf('water %i\n',v.pixels.water)
48 fprintf('land %i\n',v.pixels.land)
49 fprintf('cloud %i\n',v.pixels.cloud)
50 fprintf('low-confidence fire %i\n',v.pixels.fire(1))
51 fprintf('nominal-confid fire %i\n',v.pixels.fire(2))
52 fprintf('high-confidence fire %i\n',v.pixels.fire(3))
54 if geo(3)~=0 | geo(5)~=0,
55 error('rotation not supported')