function [ Bmap2D ] = read2Dfieldmap( filespath )
%read2fieldmaps read fieldmaps from the files and stack them at a distance
%   filespath is the directory containing the scans

thresh = 0.01; % field threshold fraction (for locating the edge of the und)

Bmap2D = [];

filenames = {'001gap+000.000x-01.00y+00.00',
'002gap+000.000x-00.80y+00.00',
'003gap+000.000x-00.60y+00.00',
'004gap+000.000x-00.40y+00.00',
'005gap+000.000x-00.20y+00.00',
'006gap+000.000x-00.00y+00.00',
'007gap+000.000x+00.20y+00.00',
'008gap+000.000x+00.40y+00.00',
'009gap+000.000x+00.60y+00.00',
'010gap+000.000x+00.80y+00.00',
'011gap+000.000x+01.00y+00.00'};

xs = linspace(-1,1,11);

for i = 1:11
    Bm = readfieldmap( [filespath '/' filenames{i}], 47 );
%      Bm(:, 4) = Bm(:,3); % rearrange
%      Bm(:, 3) = Bm(:,2); % to
%      Bm(:, 2) = ys(i); % fit y in
    Bm(:, 4) = xs(i); % fit y in
    Bmap2D = [Bmap2D; Bm];
end


end

