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

 
 
Function nj_time

PURPOSE ^

NJ_TIME - Get entire time vector (DATENUM format) for variable from any CF-compliant file

SYNOPSIS ^

function result=nj_time(ncRef,var,timeIndex)

DESCRIPTION ^

NJ_TIME - Get entire time vector for variable 'var' from any CF-compliant file
         NOTE: Time coordinate variable should be CF-compliant.

 Usage:
   result=nj_time(ncRef,var);   - all times
   result=nj_time(ncRef,var,timeIndex); - time for particular timestep
 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 name
   timeindex - time step
 Returns,
   result - vector of times in DATENUM format

 e.g,
  Gridded dataset:
       uri='http://coast-enviro.er.usgs.gov/cgi-bin/nph-dods/models/test/bora_feb.nc';
       var='temp';
  Non-Gridded dataset: (But has CF-compliant time coordinate variable)
       uri='http://www.gri.msstate.edu/rsearch_data/nopp/non-gridded/adcirc/adc.050913.fort.64.nc';
       var='ubar';

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.
  • getVar mDataset/getVar - Retrieves a matlab variable object.
  • getTimes mGridCoordinates/getTimes - Get time(s) in DATENUM format
  • getTimes mVar/getTimes - Get time(s) in DATENUM format

See demos using function nj_time:


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