Revision: 4456
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4456&view=rev
Author: jswhit
Date: 2007-11-26 11:21:23 -0800 (Mon, 26 Nov 2007)
Log Message:
-----------
add docstring.
Modified Paths:
--------------
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
===================================================================
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
2007-11-26 19:14:29 UTC (rev 4455)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/pupynere.py
2007-11-26 19:21:23 UTC (rev 4456)
@@ -52,10 +52,13 @@
_typecodes = dict([[_v,_k] for _k,_v in typemap.items()])
def NetCDFFile(file):
+ """NetCDF File reader. API is the same as Scientific.IO.NetCDF.
+ if 'file' is a URL that starts with 'http', the pydap client is
+ is used to read the data over http."""
if file.startswith('http'):
- return RemoteFile(file)
+ return _RemoteFile(file)
else:
- return LocalFile(file)
+ return _LocalFile(file)
def _maskandscale(var,datout):
if hasattr(var, 'missing_value') and (datout == var.missing_value).any():
@@ -68,7 +71,7 @@
pass
return datout
-class RemoteFile(object):
+class _RemoteFile(object):
"""A NetCDF file reader. API is the same as Scientific.IO.NetCDF."""
def __init__(self, file):
@@ -108,13 +111,13 @@
for k,d in self._buffer.iteritems():
if isinstance(d, GridType) or isinstance(d, ArrayType):
name = k
- self.variables[name] = RemoteVariable(d)
+ self.variables[name] = _RemoveVariable(d)
def close(self):
self._buffer.close()
-class RemoteVariable(object):
+class _RemoveVariable(object):
def __init__(self, var):
self._var = var
self.dtype = var.type
@@ -134,7 +137,7 @@
return _typecodes[self.dtype]
-class LocalFile(object):
+class _LocalFile(object):
"""A NetCDF file reader. API is the same as Scientific.IO.NetCDF."""
def __init__(self, file):
@@ -266,7 +269,7 @@
# Read offset.
begin = [self._unpack_int, self._unpack_int64][self.version_byte-1]()
- return LocalVariable(self._buffer.fileno(), nc_type, vsize, begin,
shape, dimensions, attributes, isrec, self._recsize)
+ return _LocalVariable(self._buffer.fileno(), nc_type, vsize, begin,
shape, dimensions, attributes, isrec, self._recsize)
def _read_values(self, n, nc_type):
bytes = [1, 1, 2, 4, 4, 8]
@@ -305,7 +308,7 @@
self._buffer.close()
-class LocalVariable(object):
+class _LocalVariable(object):
def __init__(self, fileno, nc_type, vsize, begin, shape, dimensions,
attributes, isrec=False, recsize=0):
self._nc_type = nc_type
self._vsize = vsize
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins