-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add function to get cycle numbers from argo data
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |