Skip to content

Commit bb442d1

Browse files
committed
add function to get cycle numbers from argo data
1 parent 624dd99 commit bb442d1

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

utils/ra_getcyclenumbers.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function cycle_nums = ra_getcyclenumbers(float_ids, Data)
2+
% creating a cycle number in addition to float_profs to trace the individual
3+
% profile in the floatdata while retaining the original float_profs index
4+
5+
nfloats = length(float_ids);
6+
cycle_nums = cell(nfloats, 1);
7+
%
8+
for f = 1:nfloats
9+
str_floatnum = ['F', num2str(float_ids(f))];
10+
% selecting only profiles that needs
11+
cycle_nums{f} = Data.(str_floatnum).CYCLE_NUMBER(1,:);
12+
end%endfor
13+
end%end get_cycle_numbers

utils/ra_getfloatidncycnums.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function [floats, cycnums] = ra_getfloatidncycnums(Data_struct)
2+
% ra_getflaotidncycnums.m extracts floats WMO and cycle numbers for the
3+
% given floats. This function is uses output of qc_filter.m for further
4+
% study
5+
% AUTHOR: Ramkrushn Patel
6+
7+
% get cyclenumbers and write them in cell corresponding to float
8+
cycnums = struct2cell(structfun(@(x) x.CYCLE_NUMBER, Data_struct, 'UniformOutput', false));
9+
10+
% get floats list
11+
names = fieldnames(Data_struct);
12+
floats = str2double(cellfun(@(x) x(2:end), names, 'UniformOutput', false));

0 commit comments

Comments
 (0)