sfregosi / agate

agate: Acoustic Glider Analysis Tools and Environment. MATLAB-based tools for working with passive acoustic underwater gliders.
https://sfregosi.github.io/agate/
GNU General Public License v3.0
2 stars 2 forks source link

Add example workflow of extracting positional data for NCEI (see `workflow_processPositions_allUxSMHI.m` in `glider-MHI` repo #58

Closed sfregosi closed 3 months ago

sfregosi commented 4 months ago
%% save positional data for packaging for NCEI

% gps surface table
if ~exist('gpsSurfT', 'var')
    load(fullfile(CONFIG.path.mission, 'profiles', ...
        [CONFIG.glider, '_', CONFIG.mission, '_gpsSurfaceTable.mat']));
end
keepCols = {'dive', 'startDateTime', 'startLatitude', 'startLongitude', ...
    'endDateTime', 'endLatitude', 'endLongitude'};
gpsSurfSimp = gpsSurfT(:,keepCols);
newNames = {'DiveNumber', 'StartDateTime_UTC', 'StartLatitude', 'StartLongitude', ...
    'EndDateTime_UTC', 'EndLatitude', 'EndLongitude'};
gpsSurfSimp.Properties.VariableNames = newNames;
writetable(gpsSurfSimp, fullfile(CONFIG.path.mission, 'profiles', ...
    [CONFIG.glider, '_', CONFIG.mission, '_GPSSurfaceTableSimple.csv']))

% location table
if ~exist('locCalcT', 'var')
    load(fullfile(CONFIG.path.mission, 'profiles', ...
        [CONFIG.glider, '_', CONFIG.mission, '_locCalcT.mat']))
end
keepCols = {'dateTime', 'latitude', 'longitude', 'depth', 'dive'};
locCalcSimp = locCalcT(:,keepCols);
newNames = {'DateTime_UTC', 'Latitude', 'Longitude', 'Depth_m', 'DiveNumber'};
locCalcSimp.Properties.VariableNames = newNames;
writetable(locCalcSimp, fullfile(CONFIG.path.mission, 'profiles', ...
    [CONFIG.glider, '_', CONFIG.mission, '_CalculatedLocationTableSimple.csv']))

% environmental data
if ~exist('locCalcT', 'var')
    load(fullfile(CONFIG.path.mission, 'profiles', ...
        [CONFIG.glider, '_', CONFIG.mission, '_locCalcT.mat']))
end
keepCols = {'dive', 'dateTime', 'latitude', 'longitude', 'depth', ...
    'temperature', 'salinity', 'soundVelocity', 'density'};
locCalcEnv = locCalcT(:,keepCols);
newNames = {'DiveNumber', 'DateTime_UTC', 'Latitude', 'Longitude', 'Depth_m', ...
    'Temperature_C', 'Salinity_PSU', 'SoundSpeed_m_s', 'Density_kg_m3', };
locCalcEnv.Properties.VariableNames = newNames;
writetable(locCalcEnv, fullfile(CONFIG.path.mission, 'profiles', ...
    [CONFIG.glider, '_', CONFIG.mission, '_CTD.csv']))
sfregosi commented 3 months ago

included this in workflow_processPositionalData