✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
我们展示了一个跨越 Fennoscandia 的站点网络,用于对与物候监测和卫星数据校准相关的植被特性进行光学采样。该网络目前由五个站点组成,沿 NS 梯度分布在瑞典和芬兰。两个站点位于针叶林中,一个位于落叶林中,两个位于泥炭地中。该仪器由双光束传感器组成,全年以 10 分钟的间隔测量入射和反射的红光、绿光、NIR 和 PAR 通量。传感器安装在单独的桅杆上或通量塔中,以捕获从当前涡度协方差测量的通量足迹内反射的辐射。我们的计算和模型模拟证明了使用非最低点采样的有效性,并且我们展示了第一年测量的结果。计算 NDVI 并将其与 MODIS 仪器机载 Aqua 和 Terra 卫星平台进行比较。PAR 通量被划分为地面和冠层的反射和吸收分量。测量表明,该仪器提供了有关植被物候和由于积雪变化和植被发育引起的反射率变化的详细信息。获得了关于地面和冠层 PAR 吸收的有价值信息,这些信息可能与植被生产力有关。测量表明,该仪器提供了有关植被物候和由于积雪变化和植被发育引起的反射率变化的详细信息。获得了关于地面和冠层 PAR 吸收的有价值信息,这些信息可能与植被生产力有关。测量表明,该仪器提供了有关植被物候和由于积雪变化和植被发育引起的反射率变化的详细信息。获得了关于地面和冠层 PAR 吸收的有价值信息,这些信息可能与植被生产力有关。
⛄ 部分代码
%%%Copyright Hongxiao Jin 2011.05.26 geotester@hotmail.com
%%% Lund University
%%% Note the HCRF sampling from 80 to 100 azimuth is not accurate due to
%%% the matrix edge effect in the interpolation
% mcc -m Foot.m
function varargout = Foot(varargin)
% FOOT M-file for Foot.fig
% FOOT, by itself, creates a new FOOT or raises the existing
% singleton*.
%
% H = FOOT returns the handle to a new FOOT or the handle to
% the existing singleton*.
%
% FOOT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FOOT.M with the given input arguments.
%
% FOOT('Property','Value',...) creates a new FOOT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Foot_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Foot_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help Foot
% Last Modified by GUIDE v2.5 22-May-2011 22:55:38
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Foot_OpeningFcn, ...
'gui_OutputFcn', @Foot_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before Foot is made visible.
function Foot_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Foot (see VARARGIN)
% Choose default command line output for Foot
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Foot wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Foot_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit5_Callback(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit5 as text
% str2double(get(hObject,'String')) returns contents of edit5 as a double
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit6_Callback(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit6 as text
% str2double(get(hObject,'String')) returns contents of edit6 as a double
% --- Executes during object creation, after setting all properties.
function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function h=ellipse(ra,rb,ang,x0,y0,C,Nb)
% Ellipse adds ellipses to the current plot
%
% ELLIPSE(ra,rb,ang,x0,y0) adds an ellipse with semimajor axis of ra,
% a semimajor axis of radius rb, a semimajor axis of ang, centered at
% the point x0,y0.
%
% The length of ra, rb, and ang should be the same.
% If ra is a vector of length L and x0,y0 scalars, L ellipses
% are added at point x0,y0.
% If ra is a scalar and x0,y0 vectors of length M, M ellipse are with the same
% radii are added at the points x0,y0.
% If ra, x0, y0 are vectors of the same length L=M, M ellipses are added.
% If ra is a vector of length L and x0, y0 are vectors of length
% M~=L, L*M ellipses are added, at each point x0,y0, L ellipses of radius ra.
%
% ELLIPSE(ra,rb,ang,x0,y0,C)
% adds ellipses of color C. C may be a string ('r','b',...) or the RGB value.
% If no color is specified, it makes automatic use of the colors specified by
% the axes ColorOrder property. For several circles C may be a vector.
%
% ELLIPSE(ra,rb,ang,x0,y0,C,Nb), Nb specifies the number of points
% used to draw the ellipse. The default value is 300. Nb may be used
% for each ellipse individually.
%
% h=ELLIPSE(...) returns the handles to the ellipses.
%
% as a sample of how ellipse works, the following produces a red ellipse
% tipped up at a 45 deg axis from the x axis
% ellipse(1,2,pi/8,1,1,'r')
%
% note that if ra=rb, ELLIPSE plots a circle
%
% written by D.G. Long, Brigham Young University, based on the
% CIRCLES.m original
% written by Peter Blattner, Institute of Microtechnology, University of
% Neuchatel, Switzerland, blattner@imt.unine.ch
% Check the number of input arguments
if nargin<2,
ra=[];
end;
if nargin<3,
rb=[];
end;
if nargin<4,
ang=[];
end;
%if nargin==1,
% error('Not enough arguments');
%end;
if nargin<6,
x0=[];
y0=[];
end;
if nargin<7,
C=[];
end
if nargin<8,
Nb=[];
end
% set up the default values
if isempty(ra),ra=1;end;
if isempty(rb),rb=1;end;
if isempty(ang),ang=0;end;
if isempty(x0),x0=0;end;
if isempty(y0),y0=0;end;
if isempty(Nb),Nb=300;end;
if isempty(C),C=get(gca,'colororder');end;
% work on the variable sizes
x0=x0(:);
y0=y0(:);
ra=ra(:);
rb=rb(:);
ang=ang(:);
Nb=Nb(:);
if isstr(C),C=C(:);end;
if length(ra)~=length(rb),
error('length(ra)~=length(rb)');
end;
if length(x0)~=length(y0),
error('length(x0)~=length(y0)');
end;
% how many inscribed elllipses are plotted
if length(ra)~=length(x0)
maxk=length(ra)*length(x0);
else
maxk=length(ra);
end;
% drawing loop
for k=1:maxk
if length(x0)==1
xpos=x0;
ypos=y0;
radm=ra(k);
radn=rb(k);
if length(ang)==1
an=ang;
else
an=ang(k);
end;
elseif length(ra)==1
xpos=x0(k);
ypos=y0(k);
radm=ra;
radn=rb;
an=ang;
elseif length(x0)==length(ra)
xpos=x0(k);
ypos=y0(k);
radm=ra(k);
radn=rb(k);
an=ang(k)
else
rada=ra(fix((k-1)/size(x0,1))+1);
radb=rb(fix((k-1)/size(x0,1))+1);
an=ang(fix((k-1)/size(x0,1))+1);
xpos=x0(rem(k-1,size(x0,1))+1);
ypos=y0(rem(k-1,size(y0,1))+1);
end;
co=cos(an);
si=sin(an);
the=linspace(0,2*pi,Nb(rem(k-1,size(Nb,1))+1,:)+1);
% x=radm*cos(the)*co-si*radn*sin(the)+xpos;
% y=radm*cos(the)*si+co*radn*sin(the)+ypos;
h(k)=line(radm*cos(the)*co-si*radn*sin(the)+xpos,radm*cos(the)*si+co*radn*sin(the)+ypos);
set(h(k),'color',C(rem(k-1,size(C,1))+1,:));
end;
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cla(handles.axes1,'reset');
cla(handles.axes2,'reset');
str1=get(handles.edit1,'string');
str2=get(handles.edit2,'string');
str3=get(handles.edit3,'string');
if isempty(str1)||isempty(str2)||isempty(str3)
errordlg('Input is not complete!','Input Error');
return;
end
H=str2num(str1);
FOV=str2num(str2);
alpha=str2num(str3);
if FOV/2+alpha>=90|FOV/2-alpha>=90
errordlg('Too large FOV or Off-nadir angle!','Input Error');
return;
end
L=H*(tan(pi/180*(alpha+FOV/2))+tan(pi/180*(alpha-FOV/2)))/2;%sensor projection location m
OC=H*(tan(pi/180*(alpha+FOV/2))+tan(pi/180*(alpha-FOV/2))-2*tan(pi/180*alpha))/2; %Ellipse_center cone-center distance m
a=H*(tan(pi/180*(alpha+FOV/2))-tan(pi/180*(alpha-FOV/2)))/2;%major axis m
b=sqrt(((H/cos(pi/180*alpha))^2+L^2+H^2-OC^2)^2/(2*H/cos(pi/180*alpha)*cos(pi/180/2*FOV))^2-L^2-H^2); %minor axis m
Area=pi*a*b;
set(handles.edit4,'string',sprintf('%3.1f',a));
set(handles.edit5,'string',sprintf('%3.1f',b));
set(handles.edit6,'string',sprintf('%3.1f',Area));
%plot axes1
N=1e4; %sample numbers
phi=unifrnd(-180,180,N,1);
% theta=unifrnd(alpha-FOV/2,alpha+FOV/2,N,1);
tU=H/cos((alpha+FOV/2)*pi/180);
temp=unifrnd(H,tU,N,1);
theta=acos(temp./tU)*180/pi;
x=L-H*tan(pi/180*theta).*cos(pi/180*phi);
y=H*tan(pi/180*theta).*sin(pi/180*phi);
% x=L+H*(tan(pi/180*theta).*cos(pi/180*phi)-tan(pi/180*alpha))./(1+tan(pi/180*theta).*cos(pi/180*phi)*tan(pi/180*alpha));
% y=(tan(pi/180*theta).*sin(pi/180*phi))./(1+tan(pi/180*theta).*cos(pi/180*phi)*tan(pi/180*alpha))*H/cos(pi/180*alpha);
I=((x.^2/a^2+y.^2/b^2)<=1);%indicator function
axes(handles.axes1);
plot(I.*x,I.*y,'rs','markersize',4);hold on
plot(L,0,'ks','MarkerFaceColor','k','markersize',6)
plot(OC,0,'go','MarkerFaceColor','g','markersize',6)
legend('Samples','Sensor','FOV Center');
plot([0 0],[-b b],'-.','color',[0.5 0.5 0.5]);
plot([-a a],[0 0],'-.','color',[0.5 0.5 0.5]);
ellipse(a,b,0,0,0,'b');
hold off;
axis equal;
xlabel('FootPrint Major axis X (m)');
ylabel('FootPrint Minor axis Y (m)');
%plot accumulative contributin
axes(handles.axes2);
xx=x;
xx(find(I==0))=[];
[BN X]=hist(xx,100);
plot(X,100*cumsum(BN)/length(xx),'k','linewidth',2);
ylabel('Accum. points (%)');
ylim([0 100]);
MX=max(a,L);
xlim([-a, MX]);
grid on;
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton1
% --- Executes on button press in radiobutton2.
function radiobutton2_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton2
% --- Executes on button press in radiobutton3.
function radiobutton3_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton3
function edit8_Callback(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit8 as text
% str2double(get(hObject,'String')) returns contents of edit8 as a double
% --- Executes during object creation, after setting all properties.
function edit8_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit9_Callback(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit9 as text
% str2double(get(hObject,'String')) returns contents of edit9 as a double
% --- Executes during object creation, after setting all properties.
function edit9_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
load Abisko %NoTree Abisko R_S_NIR R_S_Red R_G_NIR R_G_Red
NDVI_G=(R_G_NIR-R_G_Red)./(R_G_NIR+R_G_Red);
NDVI_S=(R_S_NIR-R_S_Red)./(R_S_NIR+R_S_Red);
RedFlag=get(handles.radiobutton4,'value');
NIRFlag=get(handles.radiobutton5,'value');
NDVIFlag=get(handles.radiobutton6,'value');
if RedFlag
R=R_S_Red;
end
if NIRFlag
R=R_S_NIR;
end
if NDVIFlag
R=NDVI_S;
end
str1=get(handles.edit1,'string');
str2=get(handles.edit2,'string');
str3=get(handles.edit9,'string');
if isempty(str1)||isempty(str2)||isempty(str3)
errordlg('Input is not complete!','Input Error');
return;
end
H=str2num(str1);
FOV=str2num(str2);
HCRF_AZ=str2num(str3);
if HCRF_AZ>=360
errordlg('Relative Azimuth must be less than 360^o!','Input Error');
return;
end
if FOV>160
errordlg('Please set FOV<=160 for HCRF modelling due to FRT model limit!','Input Error');
return;
end
set(handles.pushbutton3,'enable','off');
[AZI,ZEN]=meshgrid(0:10:350,80:-1:0);
cla(handles.axes1,'reset');
cla(handles.axes2,'reset');
for alpha=0:2:(80-FOV/2);%Sensor looking direction off-Nadir deg
axes(handles.axes1);
hold off;
polar3d(R(:,[1:36,1]),-1.5*pi,0.5*pi,0,80,1,'contour');
colorbar('EastOutside');
hold on;
L=H*(tan(pi/180*(alpha+FOV/2))+tan(pi/180*(alpha-FOV/2)))/2;%sensor projection location m
OC=H*(tan(pi/180*(alpha+FOV/2))+tan(pi/180*(alpha-FOV/2))-2*tan(pi/180*alpha))/2; %Ellipse_center cone-center distance m
a=H*(tan(pi/180*(alpha+FOV/2))-tan(pi/180*(alpha-FOV/2)))/2;%major axis m
b=sqrt(((H/cos(pi/180*alpha))^2+L^2+H^2-OC^2)^2/(2*H/cos(pi/180*alpha)*cos(pi/180/2*FOV))^2-L^2-H^2); %minor axis m
SO=sqrt(L^2+H^2);
N=1e4; %sample numbers
% bivariate sampling
phi=unifrnd(-180,180,N,1);
% theta=unifrnd(alpha-FOV/2,alpha+FOV/2,N,1);
tU=H/cos((alpha+FOV/2)*pi/180);
temp=unifrnd(H,tU,N,1);
theta=acos(temp./tU)*180/pi;
x=L-H*tan(pi/180*theta).*cos(pi/180*phi);
y=H*tan(pi/180*theta).*sin(pi/180*phi);
% phi=unifrnd(0,180,N,1);
% theta=unifrnd(-FOV/2,FOV/2,N,1);
% x=L+H*(tan(pi/180*theta).*cos(pi/180*phi)-tan(pi/180*alpha))./(1+tan(pi/180*theta).*cos(pi/180*phi)*tan(pi/180*alpha));
% y=(tan(pi/180*theta).*sin(pi/180*phi))./(1+tan(pi/180*theta).*cos(pi/180*phi)*tan(pi/180*alpha))*H/cos(pi/180*alpha);
I=((x.^2/a^2+y.^2/b^2)<=1);%indicator function
x=x(find(I==1));
y=y(find(I==1));
N=length(x);
THETA=acos(H./sqrt((x-L).^2+y.^2+H^2))*180/pi; %zenith angle
tmp=atan(y./(x-L))*180/pi;
PHI=mod(180-HCRF_AZ+(270-tmp).*(y<0).*(tmp>0)+(90-tmp).*(y<0).*(tmp<0)+(90-tmp).*(y>0).*(tmp>0)+(270-tmp).*(y>0).*(tmp<0),360); %azimuth angle
PHI(isnan(PHI))=0;%for point with Zenith=0
% h=polarN(I.*PHI*pi/180,I.*THETA,'.');
h=polarN(PHI*pi/180,THETA,'.');
set( findobj(h, 'Type', 'line'),'MarkerSize',0.7,'color','k');
drawnow;
pause(0.01);
axes(handles.axes2);
COL=floor(HCRF_AZ/10);
if alpha==0
plot(80:-1:0,R(:,COL+1)','r-.');%HDRF of Specified azimuth
end
xlim([-20 80]);
ylim([min(R(:)) max(R(:))]);
hold on;
VAR=R(:,[10:-1:1, end:-1:11]);
BRDF=interp2(AZI,ZEN,VAR,PHI,THETA); %NIR Red band, since we don't have enough model resuls we use interpolation
cos_r2=H.*((x-L).^2+y.^2+H^2).^(-1.5);
try
% fxy=1./sqrt(((x-OC).*cos(alpha*pi/180)).^2+y.^2)./(1+(cos(alpha*pi/180)/H)^2*(((x-OC).*cos(alpha*pi/180)).^2+y.^2));%joint dist fxy=k.*()
fxy=1./(H^2+(x-L).^2+y.^2)./sqrt((x-L).^2+y.^2);%joint dist fxy=k.*()
Z=cos_r2./fxy; %denominate
Z_Refl=BRDF.*cos_r2./fxy; %sample of reflectance
RR(alpha+1)=nanmean(Z_Refl(5:end))/nanmean(Z(5:end));
end
plot(alpha,RR(alpha+1),'bo','MarkerSize',4);%mean refl.HCRF
legend('HDRF','HCRF','location','northwest');
xlabel('Off-Nadir angle');
ylabel('Reflectance');
if NDVIFlag
ylabel('NDVI');
end
end
set(handles.pushbutton3,'enable','on');
% --- Executes on button press in radiobutton4.
function radiobutton4_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton4
% --- Executes during object creation, after setting all properties.
function uipanel3_CreateFcn(hObject, eventdata, handles)
% hObject handle to uipanel3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% --- Executes on button press in radiobutton5.
function radiobutton5_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of radiobutton5
function ShowPointData(hObject, eventdata, handles)
global handles
p=get(gca,'currentpoint');
try
if (p(1)>=1)&(p(1)<=IM)&(p(3)>=1)&(p(3)<=IN)&(~isempty(handles.data))
str=sprintf('X:%3.2, Y: 3.2',p(1),p(3));
if(isempty(findobj('tag','htext')))
ht=text('tag','htext','string',str,'position',[p(1),p(3)],'Color','r');
else
ht = findobj('tag','htext');
set(ht,'string',str,'position',[p(1)+.1,p(3)+.1]);
end
else
ht = findobj('tag','htext');
set(ht,'string','','position',[p(1)+.1,p(3)+.1]);
end
end
function [Xout, Yout, Zout] = polar3d(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale,varargin)
%
% POLAR3D Plots a 3D polar surface.
%
% POLAR3D(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale) plots
% the profiles as a mesh plot for Zin between radii Rho_min and
% Rho_max for polar angles equally spaced between theta_min and theta_max.
%
% POLAR3D(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale,plotspec)
% plots the profiles Zin between radii Rho_min and Rho_max for
% polarN angles between theta_min and theta_max with a plot type
% specification. If plotspec = 'surf' a standard Matlab surface
% is plotted,whereas 'mesh', 'surfc' or 'meshc' will plot mesh,
% surface with countour, or mesh with contour, respectively.
% The size of the squares on the mesh or surf plots is determined
% by meshscale. The default plot is a mesh plot.
%
%
% [Xout,Yout,Zout] = POLAR3D(Zin,theta_min,theta_max,Rho_min,
% Rho_max, meshscale)returns Zout values corresponding to the
% Cartesian positions (Xout,Yout).
%
% SYNTAX polar3d(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale)
% polar3d(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale,plotspec)
% polar3d(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale,interpspec)
% polar3d(Zin,theta_min,theta_max,Rho_min,Rho_max,meshscale, plotspec,interpspec)
% [Xout,Yout,Zout] = polar3d(Zin,theta_min,theta_max,Rho_min,Rho_max,...)
%
% INPUT Zin input magnitude profiles where each column in Zin is
% assumed to represent the radial information in the
% plot i.e. each column represents the information
% along a radial line defined by theta, where theta
% varies between theta_min and theta_max.
%
% Zin is a (M x N) matrix, where M and N are not
% necessarily equal. If M is not equal to N then the
% data are interpolated to make them equal. The final
% size is determined by the larger value of (M,N).
%
% The N columns of Zin are assumed to be equally
% spaced measurements of the radial components, where
% Zin(1,1) corresponds to (theta_min,Rho_max) and
% Zin(M,1) corresponds to (theta_min,Rho_min), and so on.
% Zin(1,N) corresponds to (theta_max,Rho_max) and
% Zin(M,N) corresponds to (theta_max,Rho_min). Theta
% increases in the anticlockwise direction.
%
% theta_min the lower value in radians of the angular range
% over which the data is defined. Theta_min is a
% scalar quantity.
%
% theta_max the upper value in radians of the angular range
% over which the data is defined. Theta_max is a
% scalar quantity.
%
% Rho_min the lower value of the radial component for which
% the data is defined. Rho_min is a scalar quantity.
%
% Rho_max the upper value of the radial component for which
% the data is defined. Rho_max is a scalar quantity.
%
% meshscale a scalar that determines the size of the squares
% on the mesh or surf plots. If meshscale is 1, the
% mesh remains unchanged relative to the input grid;
% if meshscale is 2, the size of the squares is doubled,
% if 3.2, say, it is scaled accordingly. Moreover, if
% meshscale is less than 1, e.g. 0.2, the size of the
% squares is reduced into a finer mesh. The dimensions
% of Xout, Yout and Zout are reduced or enlarged by
% meshscale.
⛄ 运行结果
⛄ 参考文献
Eklundh, L., H. Jin, et al. (2011). "An Optical Sensor Network for Vegetation Phenology Monitoring and Satellite Data Calibration." Sensors 11(8): 7678-7709.
⛄ 完整代码
❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料