1 function v=read_fire_kml(filename)
2 % v=read_fire_kml(filename)
3 % Read fire detection kml file from FireMapper
5 % Input: filename first gunzip the kmz file to get kml
10 % v.tim detection time (days, use datestr to convert to a string)
13 disp(['reading fire KML file ',filename])
16 error(['could not find file ',filename])
30 f=strfind(fline,'Fire Detection Centroid ');
35 error('missing next line'),
38 flat=parse(dline,'<b>Latitude: </b>','<br/>');
39 flon=parse(dline,'<b>Longitude: </b>','<br/>');
40 fdate=parse(dline,'<b>Detection Date: </b>','<br/>');
41 ftime=parse(dline,'<b>Detection Time: </b>','<br/>');
42 sensor=parse(dline,'<b>Sensor: </b>','<br/>');
43 v.lat(k)=str2num(flat);
44 v.lon(k)=str2num(flon);
45 timestr=[fdate,' ',ftime];
47 v.tim(k)=datenum(timestr,'dd mmm yyyy HH:MM');
51 case {'Terra MODIS','Aqua MODIS'}
54 error(['unknown sensor ',sensor])