forked from uafgeotools/capuaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_capbin_mt.m
32 lines (30 loc) · 1020 Bytes
/
read_capbin_mt.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
function[mrr, mtt, mpp, mrt, mrp, mtp, mag, misfit_wf, misfit_fmp] = read_capbin_mt(inputfile, nrows);
% This script reads data output by CAP and loads it in MATLAB
% CAP output files are binary, the file name includes number of solutions (nrows)
%
% capout_grid_bb_000100000.bin
% capout_rand_mt_000100000.bin
%
% USAGE
%
% load data generated by CAP in GRID search
% [mrr, mtt, mpp, mrt, mrp, mtp, mag, misfit_wf, misfit_fmp] = read_capbin_mt('capout_grid_mt.bin', nrows);
%
% load data generated by CAP in RANDOM search
% [mrr, mtt, mpp, mrt, mrp, mtp, mag, misfit_wf, misfit_fmp] = read_capbin_mt('capout_rand_mt.bin', nrows);
%
% 20151216 celso alvizuri - [email protected]
%----------------------------------------------------------
% read data
m = memmapfile(inputfile, 'Format', {'single', [9 nrows] 'floats'});
m.data(1).floats(1:16);
a = m.data(1).floats()';
mrr = a(:,1);
mtt = a(:,2);
mpp = a(:,3);
mrt = a(:,4);
mrp = a(:,5);
mtp = a(:,6);
mag = a(:,7);
misfit_wf = a(:,8);
misfit_fmp = a(:,9);