From 7c1686bae743deb5e78703b3aa8fbd5c3094f959 Mon Sep 17 00:00:00 2001 From: Jan Mandel Date: Fri, 18 Mar 2016 01:22:58 -0600 Subject: [PATCH] rebasing internal time in detect_fit_linesearch to zero at ignition --- other/Matlab/detection/detect_fit_linesearch.m | 46 +++++++++++++++----------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/other/Matlab/detection/detect_fit_linesearch.m b/other/Matlab/detection/detect_fit_linesearch.m index cd436994..7c53d19b 100644 --- a/other/Matlab/detection/detect_fit_linesearch.m +++ b/other/Matlab/detection/detect_fit_linesearch.m @@ -102,32 +102,37 @@ disp('subset and process inputs') min_lat = display_bounds(3); max_lat = display_bounds(4); - min_tign= min(w.tign_g(:)) - - % rebase time on the largest tign_g = the time of the last frame, in days + % convert tign_g to datenum as tign + % assuming there is some place not on fire yet where tign_g = w.times + w.time=datenum(char(w.times)'); + % make tign + max_sim_time=max(w.tign_g(:)); + tign=(w.tign_g - max_sim_time)/(24*60*60) + w.time; + % w.tign_g = max_sim_time + (24*60*60)*(tign - w.time) + min_tign=min(tign(:)); + max_tign=max(tign(:)); - last_time=datenum(char(w.times)'); - max_tign_g=max(w.tign_g(:)); - - tim_all = v.tim - last_time; - tign= (w.tign_g - max_tign_g)/(24*60*60); % now tign is in days - min_tign= min(tign(:)); % initial ignition time + % rebase time on the largest tign_g = the time of the first frame with fire, in days + base_time=min_tign; + + tim_all = v.tim - base_time; + tign= tign - base_time; tign_disp=tign; - tign_disp(tign==0)=NaN; % for display + tign_disp(tign==max(tign(:)))=NaN; % for display % select fire detection within the domain and time bii=(v.lon > min_lon & v.lon < max_lon & v.lat > min_lat & v.lat < max_lat); + tol=0.01; tim_in = tim_all(bii); u_in = unique(tim_in); - fprintf('detection times from first ignition\n') + fprintf('detection times from ignition\n') for i=1:length(u_in) - detection_freq(i)=sum(tim_in==u_in(i)); - fprintf('%8.5f days %s UTC %3i %s detections\n',u_in(i)-min_tign,... - datestr(u_in(i)+last_time),detection_freq(i),detection); + detection_freq(i)=sum(tim_in>u_in(i)-tol & tim_in