%function data=read()
load MODTRANtrans
data=RES;
clear RES
ind=find(data.lambda>9.436&data.lambda<9.440);
Tr=squeeze(mean(data.Tr(:,:,ind),3));
m=airmass(data.el);
PW=data.PW;
m=reshape(m,1,[]);
PW=reshape(PW,1,[]);
Tr=reshape(Tr,1,[]);
Tray=exp(-m.*rayleigh(1000*mean(data.lambda(ind)),1013));
Tr=Tr./Tray;

a0=0.5;
b0=0.5;
A=fminsearch('funmin',[a0,b0],[],m,PW,Tr)