%% missiondata.m provides the basic navigation information for each AUV mission.
%%  One missiondata.m file should be edited for each mission and kept in the
%%  mission directory, e.g. 2000.238.12 (YYYY.DDD.##).
%%  Longitude west in shipstart and shipend should be POSITIVE for
%%  calculations in the program bearing.m.
%%  startrng and endrng variables are: [ship heading, AUV bearing, AUV range (m)]

missionID='2000.238.01';
shipstart=[36 59 122 15.097]; startrng =[100 90 220];          
shipend=[36 58.2 122 14]; endrng=[120 113 220];

%% Calculate AUV position or use ship location if insufficient data for
%% AUV position calculation.

%% Start
if all(finite(startrng));
 disp(['   Recorded starting navigation information complete; calculating AUV position.']);
 ep([1 3])=bearing(shipstart,startrng);
else
 disp(['   Recorded starting navigation information incomplete; using ship position.']);
 ep([1 3])=[shipstart(1)+shipstart(2)/60 -shipstart(3)-shipstart(4)/60];
end

%% End 
if all(finite(endrng));
 disp(['   Recorded ending navigation information complete; calculating AUV position.']);
 ep([2 4])=bearing(shipend,endrng);
else
 disp(['   Recorded ending navigation information incomplete; using ship position.']);
 ep([2 4])=[shipend(1)+shipend(2)/60 -shipend(3)-shipend(4)/60];
end
