wrf-fire /other/Matlab/detection/like1.m

Language MATLAB Lines 34
MD5 Hash b383fe20dc67fbdad0bd525771bb4588
Repository git://github.com/jbeezley/wrf-fire.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function [v0,v1]=like1(dw,t,stretch)
% [v0,v1]=like1(dw,t,stretch)
% dw > 0 if fire detected, <0 if not, 0 if cloud
% t = time since fire arrival (days)
Tmin=stretch(1);Tmax=stretch(2);Tneg=stretch(3);Tpos=stretch(4);


tneg = (t-Tmin)./Tneg;
tpos = (t-Tmax)./Tpos;
v0y = -tneg.*tneg.*(t<Tmin)-tpos.*tpos.*(t>Tmax);

g0 = @(x) -0.25.*x.*x.*x+0.75*x-0.5;
% v0n1 = (t<Tmin-2*Tneg);
v0n2 = g0(-tneg-1).*(Tmin-2*Tneg<=t & t<=Tmin);
v0n3 =  - (Tmin < t & t<Tmax);
v0n4 = g0(tpos-1).*(Tmax <= t & t <= Tmax+2*Tpos);
% v0n5 = (t>Tmax+2*Tpos);
% v0n = v0n1 + v0n2 + v0n3 + v0n4 + v0n5;
v0n =  v0n2 + v0n3 + v0n4 ;
v0 = -dw.*(dw<0).*v0n + dw.*(dw>0).*v0y;

v1y = -2.*tneg.*(t<Tmin)-2.*tpos.*(t>Tmax);

g1 = @(x) -1.5*x.*x+1.5;
v1n = - g1(-tneg-1).*(Tmin-2*Tneg<=t & t<=Tmin) ...
    + g1(tpos-1).*(Tmax <= t & t <= Tmax+2*Tpos);
v1 = -dw.*(dw<0).*v1n + dw.*(dw>0).*v1y;

end        

    
    
    
Back to Top