-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbox_basic_corr.m
More file actions
60 lines (51 loc) · 1.84 KB
/
Copy pathbox_basic_corr.m
File metadata and controls
60 lines (51 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function [output,output_label,ind2, badsamples, badprofiles]=box_basic_corr(rdb_path,box,outpath)
%rdb_path='\\win.bsh.de\root$\Standard\Hamburg\Homes\Homes00\bm2286\Datenbanken\Downloaded\IFREMER\CTD_for_DMQC_2019V01\';
%box=7603;
%outpath='\\win.bsh.de\root$\Standard\Hamburg\Homes\Homes00\bm2286\CTD-RDB-DMQC\2020\';
if ~exist(outpath, 'dir')
mkdir(outpath)
end
if isfile([rdb_path 'ctd_' num2str(box) '.mat'])
disp('.')
disp('.')
%0. Make copy
box_copy(rdb_path,box,outpath)
% 1. Clean samples
[badsamples,output1]=box_cleansamples(outpath,box,outpath);
% 2. Remove profiles
[ind2, output2]=box_cleanprofiles(outpath,box,outpath);
% 3. If none or more than 10000 profiles
filename=['ctd_' num2str(box)];
load([outpath filename],'dates')
n=numel(dates);
disp(['Box has ' num2str(n) ' profiles'])
if n==0 % if box is empty, remove it
delete([outpath filename])
disp('Empty box was deleted')
end
% if has too many profiles
if n>10000
ind2{4,1}=find(dates<19950000000000);
box_excl(outpath,box,ind2{4},outpath)
disp(['Older ' num2str(numel(ind2{4})) ' profiles excluded, since the box had ' ...
'more than 10000 profiles'])
output3=[n numel(ind2{4})];
else
ind2{4,1}=[];
output3=[n 0];
end
output=[output1 output2 output3];
else
disp('.')
disp('.')
disp(['Box ' num2str(box) ' does not exist'])
output=nan(1,11);
ind2=cell(4,1);
badsamples.outsal=[];badsamples.outtemp=[];
badsamples.incomplete=[];
end
badprofiles.extraprof=ind2{4};
badprofiles.outbox=ind2{1};
badprofiles.shallow=ind2{2};
badprofiles.nmip=ind2{3};
output_label={'initial n','out T','out S','incompl. samples','incompl. prof','out box','shallow','NMIP','excl. prof','total n','extra rem'};