Repository navigation
Expand file tree
/
Copy pathMoveMidv3.m
More file actions
96 lines (91 loc) · 3.21 KB
/
Copy pathMoveMidv3.m
File metadata and controls
96 lines (91 loc) · 3.21 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
% Code to move Mid files from SNOWMAN
%JAH 11-2020
% too much variablity in name . some hacking is needed!!
%if seeking 'mid' files get them from SNOWMAN and move to LTSA disk
% use PowerShell to create drive mapping berfore using this command:
% PS prompt> net use Z: \\SNOWMAN\Atlantic_Region_Decimated_1
% to remove: net use z: /delete
warning off
clear variables
close all
% p holds var that come from getWindParams
% PARAMS read from the LTSAs
global p
for Dep = [7]
drivelet = 'Z'; Proj = 'Arctic'; Site = 'C2'; ProjC = 'Arctic';
if Dep <10
Depl = ['0',num2str(Dep)];
else
Depl = num2str(Dep);
end
% aAdd extra on Depl
% Depl = [Depl,'_D_C4'];
% Depl = [Depl,'-CORC02'];
FoldIn = '\\frosty\Arctic_Region_Decimated_1\Arctic';
forma = 'old'; %Proj,Depl,Site
% forma = 'new'; % Proj_Site_Depl
% forma = 'new'; %Proj_SiteDepl
% forma = 'junk';
for ix = 1:2
if isequal (ix,1)
type ='low';
pat2 = 'df100';
else
type ='mid';
pat2 = 'df20';
end
% p = getWindParams(drivelet,Proj,Site,Depl); % paramter file
FoldOut = '\\frosty\LTSA\Arctic\C2' ;
%
% if strcmp(type,'mid') && ~strcmp(Depl(end-1:end),'C4')
% pat2 = 'df20';
% elseif strcmp(type,'mid') && strcmp(Depl(end-1:end),'C4')
% pat2 = 'df10';
% elseif strcmp(type,'low') && ~strcmp(Depl(end-1:end),'C4')
% pat2 = 'df100';
% elseif strcmp(type,'low') && strcmp(Depl(end-1:end),'C4')
% pat2 = 'df50';
% end
%
if strcmp(forma,'new')
pat1 = [Proj,'_',Site,'_',Depl];
elseif strcmp(forma,'new1')
pat1 = [Proj,'_',Site,Depl];
elseif strcmp(forma,'old')
pat1 = [ProjC,Depl,Site];
% pat1 = [Proj,Site,Depl];
elseif strcmp(forma,'old1')
pat1 = [Proj,Depl];
end
pat3 = 'ltsa';
% p.infolder = fullfile(FoldIn,[Proj,' ',Site],pat1);
% p.infolder = fullfile(FoldIn,[Proj,Depl,Site]);
p.infolder = fullfile(FoldIn,pat1);
% p.infolder = '\\snowman\GofMX_Decimated_4\GOM_HH_05';
% p.infolder = fullfile(FoldIn,Proj,pat1);
outfolder = fullfile(FoldOut,pat2);
% outfolder = fullfile(FoldOut,Site,pat2,...
% [Proj,'_',Site,'_',Depl,'_',pat2]);
%
% if strcmp(Depl(end-1:end),'C4')
% pat2l = [pat2,'_CH1.ltsa'];
% else
% pat2l = [pat2,'.ltsa'];
% end
[filesfound1,inpath1,infile1,count1] = SelectTimeSitesX(pat1,pat2,pat3);
filesfound1 = filesfound1(~any(cellfun('isempty', filesfound1), 2), :);
inpath1 = inpath1(~any(cellfun('isempty', inpath1), 2), :);
infile1 = infile1(~any(cellfun('isempty', infile1), 2), :);
%
if ~exist(outfolder)
disp([' Create new Folder: ',outfolder])
mkdir(outfolder);
end
numfiles = length(infile1);
for nf = 1 : numfiles
Myfile = fullfile(inpath1{nf,1},infile1{nf,1});
disp(Myfile)
copyfile(Myfile,outfolder)
end
end
end