% ***********************************************************************
% cellulose.m
% ***********************************************************************
%
% Data description:
% specific absorption coefficient of cellulose+lignin (400-2500nm), 
% with a resolution of 5nm
%
% Prepared by: Gladimir V. G. Baranoski on November 2010
%
% ***********************************************************************
%
% Original data source:
% 
% S. Jacquemoud, S.L. Ustin, J. Verdebout, G. Schmuck, G. Andreoli
% and B. Hosgood, "Estimating leaf biochemistry using PROSPECT leaf 
% optical properties model", Remote Sensing of Environment, V. 56, 
% N. 3, pp. 194-202, June 1996.
%
% ***********************************************************************%


clear all;


p(1)=4.38;
w(1)=400;
for i=2:80
    p(i)=4.38;
    w(i)=w(i-1)+5;
end

%from 800nm to 2500nm


data=[
4.51 
4.37 
4.36 
4.3 
4.22 
4.3 
4.2 
4.08 
4.22 
4.16 
3.85 
3.95 
3.98 
4.01 
4.02 
  4 
3.95 
3.96 
3.92 
3.91 
3.89 
3.85 
3.83 
3.84 
3.85 
3.77 
3.76 
3.8 
3.82 
3.85 
3.85 
3.84 
3.88 
3.86 
3.89 
3.89 
3.9 
3.89 
3.86 
3.83 
3.81 
3.79 
3.75 
3.78 
3.73 
3.69 
3.64 
3.58 
3.62 
3.63 
3.55 
3.51 
3.49 
3.44 
3.5 
3.46 
3.39 
3.41 
3.43 
3.49 
3.46 
3.43 
3.36 
3.4 
3.43 
3.44 
3.47 
3.54 
3.53 
3.54 
3.64 
3.71 
3.77 
3.87 
3.91 
4.07 
4.24 
4.36 
4.48 
4.48 
4.47 
4.54 
4.58 
4.57 
4.53 
4.15 
4.09 
3.99 
3.93 
3.87 
3.82 
3.82 
3.8 
3.8 
3.76 
3.72 
3.71 
3.63 
3.53 
3.52 
3.51 
3.47 
3.47 
3.43 
3.44 
3.44 
3.41 
3.5 
3.6 
3.69 
3.89 
4.06 
4.21 
4.35 
4.7 
4.74 
4.79 
4.83 
4.96 
5.01 
5.22 
5.44 
6.04 
6.74 
7.76 
8.85 
9.74 
10.53 
10.95 
11.3 
11.33 
11.47 
11.61 
11.62 
11.6 
11.69 
11.62 
11.67 
11.69 
11.59 
11.49 
11.21 
 11 
10.79 
10.56 
10.34 
10.19 
10.11 
10.06 
10.07 
10.03 
9.92 
9.83 
9.8 
9.75 
9.76 
9.72 
9.51 
9.4 
9.16 
8.9 
8.73 
8.51 
8.32 
8.14 
7.96 
7.87 
7.75 
7.82 
7.65 
7.86 
  8 
8.13 
8.5 
8.66 
8.81 
9.17 
9.47 
9.79 
10.09 
10.38 
10.75 
11.09 
11.32 
11.71 
11.92 
11.87 
11.37 
10.87 
10.73 
10.68 
10.66 
10.79 
10.67 
10.5 
10.24 
10.07 
9.97 
9.92 
9.88 
9.84 
9.67 
9.73 
9.64 
9.55 
9.47 
9.27 
9.2 
8.96 
8.83 
8.62 
8.61 
8.39 
8.36 
8.23 
8.2 
8.22 
8.19 
8.22 
8.29 
8.71 
8.93 
9.04 
9.19 
9.09 
8.91 
8.67 
8.25 
7.93 
7.72 
7.65 
7.57 
7.65 
7.79 
8.03 
8.14 
8.3 
8.53 
8.82 
9.16 
9.71 
10.41 
11.31 
12.44 
13.74 
15.37 
16.99 
18.73 
20.62 
22.35 
24.12 
25.73 
27.07 
28.39 
29.48 
30.48 
31.2 
31.75 
32.21 
32.73 
33.1 
33.21 
33.26 
33.27 
33.16 
32.96 
32.62 
32.16 
31.72 
31.07 
30.36 
29.66 
28.94 
28.21 
27.57 
27.1 
26.63 
26.14 
25.71 
25.24 
24.84 
24.79 
24.58 
24.63 
24.6 
25.24 
26.15 
27.54 
29.45 
31.81 
34.32 
36.53 
38.29 
40.09 
41.25 
 42 
42.59 
43.12 
43.73 
44.5 
46.03 
47.31 
48.01 
47.88 
47.88 
47.82 
47.77 
48.23 
48.65 
48.27 
47.98 
47.65 
47.36 
45.9 
45.51 
45.19 
45.21 
45.08 
44.07 
43.96 
42.98 
43.83 
43.8 
43.86 
44.48 
46.27 
46.57 
48.58 
49.63 
52.52 
55.55 
57.69 
59.09 
62.39 
64.37 
67.35 
66.18 
67.9 
70.75 
68.61 
68.2 
];
  
j=1;
for i=81:421
    p(i)=data(j);
    j=j+1;
    w(i)=w(i-1)+5;
end
    

fid=fopen('cellulose400-2500.txt','wb');

for i=1:1:421
    fprintf(fid,'%d %3.4g \n',w(i),p(i));
end

fclose(fid);

plot(w,p,'b-','linewidth',3);
axis([400 2500 0 100]);
set(gca,'FontSize', 14);
grid on
title('Cellulose + Lignin','fontsize',14)
ylabel('s.a.c. (cm^2 g^{-1}{})','fontsize',14);
xlabel('wavelength (nm)','fontsize',14);
set(gcf,'PaperUnits','inches','PaperPosition',[0 0 6 5]);
pause
print('-dpng', '-r100','cellulose.png');
close 
