%% get_spatial : to fetch spatial data for mission for combination 
%% with ctd data
%%  depth is used to compute pressure for salinity and oxygen computations
%%  lat and lon are pre-mission GPS fixes, constant after mission start
%%  roll, pitch and yaw are extracted for 3-D mission visualization
function [depth,ztime,lat,lon,gpstime,roll,pitch,yaw,navtime] = get_spatial(mission)

eval(['load ' mission '/dataGPS']);
 rawlat = gps(:,latitude); rawlon = gps(:,longitude);
 lat = floor(rawlat/100) + (rawlat-floor(rawlat/100)*100)/60;
 lon = -1*[floor(rawlon/100) + (rawlon-floor(rawlon/100)*100)/60];
 gpstime = gps(:,time); 

eval(['load ' mission '/dataD']);
 depth = dataDC(:,tDepth);
 ztime = dataDC(:,time);

eval(['load ' mission '/dataN']);
 roll = [dataNav(:,mPhi)*180/pi];
 pitch = [dataNav(:,mTheta)*180/pi];
 yaw = [dataNav(:,mPsi)*180/pi];
 navtime = dataNav(:,time);

return
