1 function e = detection_ellipse(g,r)
2 %function e = detection_ellipse(g)
3 % function returns eigenvectors for ellipse containg fire detections
5 % g struct, detection structure from subset_detections
6 % r struct, fire data from subset_domain
8 % e struct with eigenvectors for ellipse contining detections
10 d = detection_list(g,r);
12 fires = zeros(length(fire_idx),2);
13 fire_lons = r.fxlong(fire_idx);
14 fire_lats = r.fxlat(fire_idx);
15 fires(:,1) = fire_lons;
16 fires(:,2) = fire_lats;
18 %[sat_in,sat_on] = inpolygon(r.fxlong(:),r.fxlat(:),fire_lons,fire_lats);
19 fire_area = length(fire_idx);
20 %fprintf('satellite area ~= %d \n',fire_area);
22 %scatter plot the detections
23 % figure,scatter(fire_lons,fire_lats)
26 % k = boundary(fire_lons,fire_lats,shrink);
27 % plot(fire_lons(k),fire_lats(k));
29 e = ellipse_fit(fires,1.96);
31 e.ellipse_area = det(e.d);