njtbx-icon
Netcdf-Java Toolbox
previous Function nj_time_index
Function nj_varget Next

 
 
Function nj_tslice

PURPOSE ^

NJ_TSLICE - Get data and coordinates from a CF-compliant file at a specific time step and level

SYNOPSIS ^

function [data,grd]=nj_tslice(ncRef,var,iTime, level)

DESCRIPTION ^

NJ_TSLICE - Get data and coordinates from a CF-compliant file at a specific time step and level

 Usage:
   [data,grd]=nj_tslice(ncRef,var,[iTime], [level]);
 where,
   ncRef - Reference to netcdf file. It can be either of two
           a. local file name or a URL  or
           b. An 'mDataset' matlab object, which is the reference to already
              open netcdf file.
              [ncRef=mDataset(uri)]
   var - variable to slice
   iTime - time step to extract data. Specify 'inf' for max value of timestep. 
   level - vertical level (if not supplied, volume data is retrieved.)
           Specify 'inf' for max value of level.
 returns,          
   data - data  - matlab array       
          grd   - structure containing lon,lat,z,jdmat (Matlab datenum)         
 e.g.,
   uri ='http://coast-enviro.er.usgs.gov/cgi-bin/nph-dods/models/adria/roms_sed/bora_feb.nc';% NetCDF/OpenDAP/NcML file
   [data,grd]=nj_tslice(uri,'temp',2, 14) - Retrieve data from level 14 at time step 2
   [data,grd]=nj_tslice(uri,'temp', inf) - Retrieve 3D data for last time step. 
   [data,grd]=nj_tslice(uri,'h') - Retrieve 2D non time dependent array 

CROSS-REFERENCE INFORMATION ^

This function makes following njTBX API calls:
  • mDataset mDataset class constructor - opens a netcdf file and creates a grid or netcdf mDataset object.
  • getGeoGridVar mDataset/getGeoGridVar - Get variable into a GeoGrid if it has a Georeferencing coordinate system.
  • getCoordSys mGeoGridVar/getCoordSys - Get the Grid Coordinate System associated with the referenced GeoGrid
  • getData mGeoGridVar/getData - get the 3D volume data
  • getTimes mGridCoordinates/getTimes - Get time(s) in DATENUM format
  • getVerticalAxis mGridCoordinates/getVerticalAxis - get vertical coordinate data
  • getData mVar/getData - Read data from variable.
  • getTimes mVar/getTimes - Get time(s) in DATENUM format

See demos using function nj_tslice:


previous Function nj_time_index
Function nj_varget Next
© 2006-2009   Mississippi State University   • License Terms   • Credits