njtbx-icon
Netcdf-Java Toolbox
previous Function nj_time
Function nj_tslice Next

 
 
Function nj_time_index

PURPOSE ^

NJ_TIME_INDEX - Get indices for time coordinate variable

SYNOPSIS ^

function [start,stop]=nj_time_index(uri,var,start_time,stop_time)

DESCRIPTION ^

NJ_TIME_INDEX - Get indices for time coordinate variable.

 Usage:
   [start,stop]=nj_time_index(uri,var,start_time,[stop_time])
 where,
   uri - CF-compliant NetCDF, OpenDAP or NCML file
         var - variable whose time dimension to get indices from
         start_time - start time  %matlab datenum
         stop_time - end time     % matlab datenum
 returns,           
  start  - index for specified start_time. '-1' if no index found.
  stop   - index for specified stop_time. '-1' if no index found.     

 e.g,
 uri ='http://stellwagen.er.usgs.gov/cgi-bin/nph-dods/models/adria/roms_sed/bora_feb.nc';% NetCDF/OpenDAP/NcML file
 [start,stop]=nj_time_index(uri,'temp','11-Feb-2003 12:00:00','15-Feb-2003 23:00:00')%start and stop date is UTC/GMT

previous Function nj_time
Function nj_tslice Next
© 2006-2009   Mississippi State University   • License Terms   • Credits