Skip to content

Commit

Permalink
add function to get cycle numbers from argo data
Browse files Browse the repository at this point in the history
  • Loading branch information
rampatels committed Mar 19, 2024
1 parent 624dd99 commit bb442d1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/ra_getcyclenumbers.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function cycle_nums = ra_getcyclenumbers(float_ids, Data)
% creating a cycle number in addition to float_profs to trace the individual
% profile in the floatdata while retaining the original float_profs index

nfloats = length(float_ids);
cycle_nums = cell(nfloats, 1);
%
for f = 1:nfloats
str_floatnum = ['F', num2str(float_ids(f))];
% selecting only profiles that needs
cycle_nums{f} = Data.(str_floatnum).CYCLE_NUMBER(1,:);
end%endfor
end%end get_cycle_numbers
12 changes: 12 additions & 0 deletions utils/ra_getfloatidncycnums.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function [floats, cycnums] = ra_getfloatidncycnums(Data_struct)
% ra_getflaotidncycnums.m extracts floats WMO and cycle numbers for the
% given floats. This function is uses output of qc_filter.m for further
% study
% AUTHOR: Ramkrushn Patel

% get cyclenumbers and write them in cell corresponding to float
cycnums = struct2cell(structfun(@(x) x.CYCLE_NUMBER, Data_struct, 'UniformOutput', false));

% get floats list
names = fieldnames(Data_struct);
floats = str2double(cellfun(@(x) x(2:end), names, 'UniformOutput', false));

0 comments on commit bb442d1

Please sign in to comment.