clear all
close all

n = 6;
m = 26;
t = 0;

% runid = 'chan';
% trimfile = ['trim-',runid,'.dat'];
% TRIM     = vs_use(trimfile,'quiet');
% x        = vs_get(TRIM,'map-const','XCOR',{n,m},'quiet'); 
% dps      = vs_get(TRIM,'map-sed-series',{t},'DPS',{n,m},'quiet');  
% mud      = vs_get(TRIM,'map-series',{t},'R1',{n,m,1,1},'quiet'); 
% x   = x(1:end-2);

runid = 'chan_fluff1';
trimfile = ['trim-',runid,'.dat'];
TRIM      = vs_use(trimfile,'quiet');
mfluff1   = vs_get(TRIM,'map-sed-series',{t},'MFLUFF',{n,m,1},'quiet'); 
% dps1      = vs_get(TRIM,'map-sed-series',{t},'DPS',{n,m},'quiet');   
% mud1      = vs_get(TRIM,'map-series',{t},'R1',{n,m,1,1},'quiet'); 
% mfluff1   = mfluff1(2:end-1);

runid = 'chan_fluff2';
trimfile = ['trim-',runid,'.dat'];
TRIM      = vs_use(trimfile,'quiet');
mfluff2   = vs_get(TRIM,'map-sed-series',{t},'MFLUFF',{n,m,1},'quiet'); 
% dps2      = vs_get(TRIM,'map-sed-series',{t},'DPS',{n,m},'quiet');    
% mud2      = vs_get(TRIM,'map-series',{t},'R1',{n,m,1,1},'quiet');  
% mfluff2   = mfluff2(2:end-1);

% d1 = dps1-dps;
% d2 = dps2-dps;
% d1 = d1(2:end-1);
% d2 = d2(2:end-1);
% 
% dm1 = mud1-mud;
% dm2 = mud2-mud;
% dm1 = dm1(2:end-1);
% dm2 = dm2(2:end-1);

dm1=[mfluff1{2:end}]-[mfluff1{1:end-1}];
dm2=[mfluff2{2:end}]-[mfluff2{1:end-1}];

m1 = [mfluff1{1:end}];
m2 = [mfluff2{1:end}];

% figure(1)
% hold on
% grid on
% plot(x,d1,'b')
% plot(x,d2,'r')
% title('depth difference')

figure(2)
hold on
grid on
plot(m1,'b')
plot(m2,'r')
title('mass in fluff layer')
% 
% figure(3)
% hold on
% grid on
% plot(x,d1./mfluff1,'b')
% plot(x,d2./mfluff2,'r')
% title('depth difference / mass in fluff layer')

figure(4)
hold on
grid on
plot(dm1,'b')
plot(dm2,'r')
title('mass difference')



