-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpscr_convertdidsondata.m
executable file
·158 lines (133 loc) · 8.78 KB
/
cpscr_convertdidsondata.m
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
%% Create avi from Didson data relative to each "passing"
clear
close all
%% Create time stamp data
clear
rootDataDir = '\\callisto\collpen\AustevollExp\data';
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block0\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block1\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block2\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block3\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block4\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block5\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block6\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block7\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block8\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block9\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block10\didson'),'T')
%cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block13\didson'),'T')
%cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block14\didson'),'T')
%cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block15\didson'),'T')
%cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block16\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block17\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block18\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block19\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block20\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block21\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block22\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block23\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block24\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block25\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block26\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block27\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block28\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block29\didson'),'T')
%
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block30\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block31\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block32\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block33\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block34\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block35\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block36\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block37\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block38\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block39\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block40\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block41\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block42\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block43\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block44\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block45\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block46\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block47\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block48\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block49\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block50\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block51\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block52\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block53\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block54\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block55\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block56\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block57\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block58\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block59\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block60\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block61\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block62\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block63\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block64\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block65\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block66\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block67\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block68\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block69\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block70\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block71\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block72\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block73\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block74\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block75\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block76\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block77\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block78\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block79\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block80\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block81\didson'),'T')
% cp_ConvertDidsonToMat(fullfile(rootDataDir, 'HERRINGexp\block82\didson'),'T')
%% The HERRINGexp - creating the avi per treatment
clear
clc
close all
% Data directory
%par.datadir = 'G:\collpen\AustevollExp\data\HERRINGexp';
par.datadir = '\\callisto\collpen\AustevollExp\data\HERRINGexp';
par.parfile ='\\callisto\collpen\AustevollExp\data\HERRINGexp\CollPenAustevollLog.xls';
% used by plotting function
par.didson.preTrialTime = 8/(24*3600) ;% time in days to plot data before and after the trial
% Parameters and metadata
block = cp_GetExpPar(par.parfile);
%17:36
% Functions to convert Didson data to mat and avi files
for i=1:82
try
cp_ProcessDidsondata(block(i).b_block,block,par);
disp(['Block ',num2str(i),' ok'])
end
end
% Calculate school parameters (This generates the NULL and TREATMENT for vessel, orca and w/b net)
clear
close all
% Data directory
par.datadir = '\\callisto\collpen\AustevollExp\data\HERRINGexp';
par.parfile ='\\callisto\collpen\AustevollExp\data\HERRINGexp\CollPenAustevollLog.xls';
% Parameters and metadata
block = cp_GetExpPar(par.parfile);
%par.didson.preTrialTime = 8/(24*3600) ;% time in days to plot data before and after the trial
% The time lag before during/exposure for VA data
par.preRefTimeVA = ([-152 -88]+21)/(24*3600);% time in seconds to define the reference window for vessel avoidance (adjusted for the difference bewtween start time and max pressure, i.e +21s)
par.passTimeVA = ([-3 3]+21)/(24*3600);% time in seconds to define the reference window for VA pb
par.preRefTimeKW = ([-152 -88])/(24*3600);% time in seconds to define the reference window for killer whale pb
par.passTimeKW = ([0 60])/(24*3600);% time in seconds to define the reference window for killer whale pb
par.preRefTimeWB = ([0 30])/(24*3600);% time in seconds to define the reference window for the 2013 experiment. Note that this is different from the 2012 experiment
% Functions to extract school parameters
for i=20:82
try
cp_ProcessDidsonSchoolParameters(block(i).b_block,block,par);
end
end
%% The HERRINGcort
%% Covnert the Salmondata to mat and avi files
rootDataDir = '\\callisto\collpen\AustevollExp\data\HERRINGexp\';
cp_ConvertDidsonToMat(fullfile(rootDataDir, 'salmondata','A'))