Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)
[out, lat, lon] = getnc2_atl(filin, varn, lims, lev, tim);
[out, lat, lon] = getnc2_atl(filin, varn, lims, lev, tim); This function invokes getnc2 twice, once for either side of the prime meridian. Then it puts the two fields together so you don't have to. Please only use this to output one variable, and lat and lon (don't try to do anything fancy like multiple variables - I just don't have time).
This function calls | |
---|---|
function [out, lat, lon] = getnc2_atl(filin, varn, lims, lev, tim); if ~(lims(1) < 0 & lims(2) > 0); error('Please input minlon and maxlon so they straddle O deg') end lims1 = [lims(1)+360 360 lims(3:4)]; lims2 = [0 lims(2) lims(3:4)]; [out1, lat1, lon1] = getnc2(filin, varn, lims1, lev, tim); [out2, lat2, lon2] = getnc2(filin, varn, lims2, lev, tim); if ndims(out1) == 4; out = shiftdim([shiftdim(out1, 3); shiftdim(out2, 3)], 1); elseif ndims(out1) == 3; out = shiftdim([shiftdim(out1, 2); shiftdim(out2, 2)], 1); elseif ndims(out1) == 2; out = [out1 out2]; end lat = lat1; lon = [lon1-360; lon2];