1 function r = subset_small(red,n,m,full_set)
2 %interpolates onto smaller grid
3 % red = subset_domain(w)
4 % n,m new size of matrices
6 % d_lat = (red.max_lat-red.min_lat)/m;
7 % d_lon = (red.max_lon-red.min_lon)/n;
8 % lat = linspace(r.min_lat-d_lat,r.max_lat+d_lat,m+2);
9 % lon = linspace(r.min_lon-d_lon,r.max_lon+d_lon,n+2);
10 lon = linspace(r.min_lon,r.max_lon,n);
11 lat = linspace(r.min_lat,r.max_lat,m);
12 [r.fxlat,r.fxlong]=meshgrid(lat,lon);
14 %interpolate dta to smaller grid
15 F = scatteredInterpolant(red.fxlat(:),red.fxlong(:),red.tign_g(:));
16 r.tign_g = F(r.fxlat,r.fxlong);
18 F = scatteredInterpolant(red.fxlat(:),red.fxlong(:),red.tign(:));
19 r.tign = F(r.fxlat,r.fxlong);
21 if ~exist('full_set','var')
22 full_set = input_num('Interpolate full set of values? Yes = 1',0,1);
25 F = scatteredInterpolant(red.fxlat(:),red.fxlong(:),red.nfuel_cat(:),'nearest');
26 r.nfuel_cat = F(r.fxlat,r.fxlong);
28 F = scatteredInterpolant(red.fxlat(:),red.fxlong(:),red.fmc_g (:),'nearest');
29 r.fmc_g = F(r.fxlat,r.fxlong);
31 F = scatteredInterpolant(red.fxlat(:),red.fxlong(:),red.fhgt(:));
32 r.fhgt = F(r.fxlat,r.fxlong);
34 F = scatteredInterpolant(red.fxlat(:),red.fxlong(:),red.ros(:));
35 r.ros = F(r.fxlat,r.fxlong);