NCINTERP is the jOceans module of jLab.

 NCINTERP  One-line interpolation from 3D lat/lon/time field in NetCDF file.
    from the NetCDF file FILENAME onto positions given by date numbers NUM,
    latitudes LAT, and longitudes LON, and returns the results in X.
    The interpolation is linear interpolation performed with INTERP3.
    Longitude boundaries and near-polar latitudes are both accommodated.
    The field VARNAME must have three dimensions, latitude, longitude, and 
    time.  By default, the dimension order is expected to be (1) latitude,
    (2) longitude, and (3) time.  NCINTERP(...,'transpose') specifies that
    the order is instead (1) longitude, (2) latitude, and (3) time.
    The NetCDF fil must also have variables named 'lat', 'lon', and 'num'
    which give the values along the dimensions.  Both lat and lon are 
    oriented in order of increasing values (i.e. lon cannot be 
    discontinuous), while the time NUM is given in Matlab's DATENUM format.   
    NCINTERP detects if longitude in FILENAME spans 360 degrees, and if so,
    interpolation across the longitudinal boundaries is correctly handled.
    Note that longitudes can be specified as [-180,180] or [0,360].
    NUM, LAT, and LON are all arrays of the same size, or else cell arrays
    of numeric arrays.  In the latter case, X will also be a cell array.
    with multiple variable names input, also works, for example:
    FILENAME should specify a file on the Matlab search path, or should
    include the full pathname, e.g. FILENAME='/Volumes/Data/'.  
    Failures in the interpolation, for example, if the data falls outside 
    the region covered by the NetCDF file, are set to values of INF.
    NCINTERP has two different approaches to reading the data.  The default
    behavior is to load in time chunks such that each double-precision 
    variable read in is smaller than a specified size, chosen as 16 GB.
    NCINTERP(...,M) instead uses M gigabytes as the cutoff for the chunk. 
    This method tends to be relatively fast.
    NCINTERP(...,'loop') alternatively reads each time slice invididually
    This method is very slow and is recommended only for testing purposes.
    Handling domain edges
    If the NetCDF file spans 360 degrees of longitude, the first and last
    longitude are periodically wrapped to provide continuous interpolation.
    To prevent the interpolation from failing very near the poles, the
    first and last latitudes are also repeated, provided the last latitude
    is within one latitude spacing interval of the pole. 
    Usage: x=ncinterp(filename,num,lat,lon,varname);
    This is part of JLAB --- type 'help jlab' for more information
    (C) 2016--2021 J.M. Lilly --- type 'help jlab_license' for details

contents | allhelp | index