forked from jfaghm/OceanEddies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
track_mha.m
24 lines (21 loc) · 931 Bytes
/
track_mha.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function track_mha(srcdir, srcpattern, lookahead, load_data, destmat)
%TRACK_MHA Track eddies using Multiple Hypothesis Assignment
% srdir: Directory in which to find saved eddy frames
% srcpattern: Filename pattern used for eddies (ex. anticyc_ for
% anticyc_19921014.mat)
% lookahead: Boolean value to run the scan with lookahead enabled [0 or 1]
% load data: Path to pre-generated data. Use 0 to load no data.
% destmat: Path to saved mat-file. (should NOT end in .mat)
if isa(load_data, 'numeric')
load_data = '0';
end
mha_path = mfilename('fullpath');
sep = strfind(mha_path, filesep());
mha_path = [mha_path(1:sep(end)) 'track_mha.py'];
cmd = sprintf('python "%s" "%s" "%s" %d "%s" "%s"', mha_path, ...
srcdir, srcpattern, lookahead, load_data, destmat);
status = system(cmd, '-echo');
if status
error('Failed to run MHA');
end
end