From: <js...@us...> - 2009-09-09 16:28:51
|
Revision: 7725 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7725&view=rev Author: jswhit Date: 2009-09-09 16:28:43 +0000 (Wed, 09 Sep 2009) Log Message: ----------- update date2index wrapper to be consistent with date2index in netcdftime.py Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-09-09 14:47:09 UTC (rev 7724) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-09-09 16:28:43 UTC (rev 7725) @@ -3886,7 +3886,7 @@ cdftime = netcdftime.utime(units,calendar=calendar) return cdftime.date2num(dates) -def date2index(dates, nctime, calendar='proleptic_gregorian'): +def date2index(dates, nctime, calendar='proleptic_gregorian',select='exact'): """ Return indices of a netCDF time variable corresponding to the given dates. @@ -3919,18 +3919,18 @@ If ``calendar=None``, will use ``calendar`` attribute of ``nctime`` object, and if that attribute does not exist calendar is set to ``standard``. - select The index selection method. ``exact`` wil return the + select The index selection method. ``exact`` will return the indices perfectly matching the dates given. ``before`` and ``after`` will return the indices corresponding to the dates just before or after the given dates if an exact match cannot be found. ``nearest`` will return the indices that - correspond to the closest dates. + correspond to the closest dates. Default ``exact``. ============== ==================================================== Returns an index or a sequence of indices. """ - return netcdftime.date2index(dates, nctime, calendar=None) + return netcdftime.date2index(dates, nctime, calendar=calendar, select=select) def maskoceans(lonsin,latsin,datain,inlands=False): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |