Skip to content

Commit 624dd99

Browse files
committed
add missing argofunctions
1 parent 68c832b commit 624dd99

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

utils/ra_mat2argostruct.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function [argo_floats, argo_profiles] = ra_mat2argostruct(argofloatprofileid)
2+
% Function converts argo profile id and float id to confirm OneArgo toolbox
3+
% NOTE: matrix must have dimension of Mx2 where M number of profiles. 1st
4+
% column must be float ids, and second column must be corresponding profile
5+
% id.
6+
% This function is designed for collocation of eddies and argo profile
7+
8+
[argo_floats, ~, ic ]= unique(argofloatprofileid(:, 1), 'stable');
9+
argo_profiles = accumarray(ic, argofloatprofileid(:, 2), [], @(x) {x});

utils/ra_saveinargostruct.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function [argo_floats, argo_profiles, match_eddies] = ra_saveinargostruct(collocatedfloatprofileid, collocatededdyindex)
2+
% Function converts argo profile id, float id and collocated eddy index to confirm OneArgo toolbox
3+
% NOTE: matrix must have dimension of Mx2 where M number of profiles. 1st
4+
% column must be float ids, and second column must be corresponding profile
5+
% id.
6+
% INPUT:
7+
% collocatedfloatprofileid must be Mx2 as explained above
8+
% collocatededdyindex column matrix
9+
% OUTPUT:
10+
% argo_floats as column
11+
% argo_profiles as a struct array to be used with oneargo
12+
% match_eddies to keep eddies in the same as profiles
13+
14+
15+
[argo_floats, ~, ic ]= unique(collocatedfloatprofileid(:, 1), 'stable');
16+
argo_profiles = accumarray(ic, collocatedfloatprofileid(:, 2), [], @(x) {x});
17+
match_eddies = accumarray(ic, collocatededdyindex, [], @(x) {x});

0 commit comments

Comments
 (0)