-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayManager.m
More file actions
63 lines (51 loc) · 1.9 KB
/
ArrayManager.m
File metadata and controls
63 lines (51 loc) · 1.9 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
function [] = ArrayManager(SurveyName,maxSites,HZ)
% Usage: [] = ArrayManager(SurveyName,maxSites,HZ)
%
% SurveyName gives the path (relative to MTdata, which should be set
% as an environment variable before calling) of the specfic survey
% being processed (e.g., "Yellowstone"). This is the directory
% which contains subdirectories data, XML, original, MT, FC, tmp, etc.
% If not specified, you get to choose the directory.
% maxSites is an optional variable that is passed to dataTimes;
% this is used to control how many sites are
% HZ is an optional variable that defines the default options files
% in dataTimes / ComputeTF
if nargin == 0
[Survey,SurveyName] = startUpSurvey;
else
Survey = startUpSurvey(SurveyName);
end
if nargin <= 1
maxSites = Inf;
end
if nargin <= 2
HZ = 1;
end
dataHome = Survey.home;
setenv('dataHome',dataHome);
if ~exist(Survey.tmp,'dir'); mkdir(Survey.tmp); end
if ~exist(Survey.SP, 'dir'); mkdir(Survey.SP); end
if ~exist(Survey.FC, 'dir'); mkdir(Survey.FC); end
if ~exist(Survey.MT, 'dir'); mkdir(Survey.MT); end
if ~exist(Survey.MMT,'dir'); mkdir(Survey.MMT); end
if ~exist(Survey.data,'dir'); mkdir(Survey.data); end
XMLdir = Survey.metadata;
DataFiles = listFromXML(XMLdir,'update');
nFiles = length(DataFiles);
updateSP(SurveyName,DataFiles);
updateFC(SurveyName,DataFiles);
for k = 1:nFiles
DataFiles{k}.surveyName = SurveyName;
end
[NIMSinfo] = mkNIMSinfo(SurveyName,DataFiles);
[Sites] = uniqueSites(DataFiles);
eval(['cd ''' dataHome '''' 'data']);
% tUnits gives initial units for time axis for TSplot
% choices are 'Seconds','Hours','Minutes','Days'
tUnits = 'Hours';
% nTunits is number of Hours (more generally, tUnits) to plot on one page
nTunits = 24;
% decFac is decimation factor to apply to time series before plotting
decFac = 1;
plotStart = plotSetup(tUnits,nTunits,decFac);
dataTimes(DataFiles,NIMSinfo,Sites,plotStart,maxSites,HZ);