1 function r=readmod14files(file_search,ax)
2 % r=readmod14files(file_search,ax)
3 % file_search search string
4 % ax bounds [min_lon, max_lon, min_lat, max_lat]
7 d=dir(file_search);d={d.name};
8 if(isempty(d)), error(['No files found for ',file_search]),end
9 prefix=regexp(file_search,'^.*/','match'); % all up to the last /
10 if isempty(prefix), % comes as cell, convert to string
16 % order the files in time
28 v=readmod14([prefix,file]);
29 % select fire detection within the domain
30 xj=find(v.lon >= ax(1) & v.lon <= ax(2));
31 xi=find(v.lat >= ax(3) & v.lat <= ax(4));
32 if ~isempty(xi) & ~isempty(xj)
34 v.data=v.data(xi,xj); % subset data