% Create Path file and obtain towyop concentrations

!rm -rf movframes
!rm -rf mf.bak
!mkdir mf.bak
!mkdir movframes

load vpr;

if max(b(:,1))<137
  instrument=1;
else
  instrument=2;
end
conc=volts2conc(b(:,9),b(:,5),instrument);

% Parse towyos, some divide by 0 errors are expected.

a=towyo_parse(b(:,1),b(:,2),-b(:,3),b(:,4),conc);

% Write mfiles

% ydstart=input('enter yearday forecast run started:\n');
% drnge(1)=input('enter yearday of first drifter of interest:\n');
% drnge(2)=input('enter yearday of last drifter of interest:\n');
% ydviz=input('enter yearday to start visualization:\n');

ydstart = 127.0;
drnge(1) = 135.79
drnge(2) = 136.85
ydviz = 135.0;

% project_obs('DRIFTERS.pth',a.sum,ydstart,ydviz,drnge);
project_obs('DRIFTERS.pth',a.max,ydstart,ydviz,drnge);

!./makeflc
