function objects = LEM_flights2objects(flights);
% LEM_flights2objects - convert flight data to input for the radar function
% On input:
%     flights (flights struct): flight info
% On output:
%     objects (objects struct):
%       .x (float): x location of object
%       .y (float): y location of object
%       .z (float): z location of object
%       .dx (float): x direction of motion of object
%       .dy (float): y direction of motion of object
%       .dz (float): z direction of motion of object
%       .speed (float): speed in direction of motion of object
%       .diameter (float): diameter of object
% Call:
%     objs = LEM_flights2objects(flights);
% Author:
%     T. Henderson
%     UU
%     Fall 2020
%

num_flights = length(flights);
if num_flights<1
    objects = [];
    return
end

for f = 1:num_flights
    telem = flights(f).telemetry;
    objects(f).x = telem(end,1);
    objects(f).y = telem(end,2);
    objects(f).z = telem(end,3);
    objects(f).dx = telem(end,4);
    objects(f).dy = telem(end,5);
    objects(f).dz = telem(end,6);
    objects(f).speed = telem(end,7);
    objects(f).diam = 1;
end
