function [ Bmap1D ] = read2fieldmaps( filename1, filename2 )
%read2fieldmaps read fieldmaps from the files and stack them at a distance
%   Detailed explanation goes here

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

Bm1 = readfieldmap( filename1 );
Bm2 = readfieldmap( filename2 );

maxB1 = max(abs(Bm1(:,3)));
maxB2 = max(abs(Bm2(:,3)));

%  Bm1iend = 1:numel(Bm1(:,3));
%  Bm1iend = max(Bm1iend(abs(Bm1(:,3)) / maxB1 > thresh));
%  Bm2istart = 1:numel(Bm2(:,3));
%  Bm2istart = min(Bm2istart(abs(Bm2(:,3)) / maxB2 > thresh));
%  
%  Bm1 = Bm1(1:Bm1iend,:);
%  Bm2 = Bm2(Bm2istart:end,:);
%  Bm2(:,1) = Bm2(:,1) - Bm2(1,1) + Bm1(end,1) + distance;
%  
%  Bx = interp1(zs, Bm1, z, 'spline', 0);
%  By = interp1(zs, Bys, z, 'spline', 0);

Bmap1D = [Bm1; Bm2]; % looks like the separation if we stack them is 0.36 which is roughly 0.4

end

