Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
version 1.0.2 (not yet released)
* change default land-sea mask (now 2.5 minute resolution).
* add etopo method (similar to bluemarble, but plots etopo
relief image from www.ngdc.noaa.gov/mgg/global as a map background).
* add shadedrelief method (similar to bluemarble, but plots shaded
relief image from naturalearthdata.com as a map background).
* replace pyshapelib with pure python shapelib.py from
pyshp.googlecode.com. Allows full python 3 compatibility.
* fix doc/conf.py to use inheritance_diagram from Sphinx, not
matplotlib.
* fix drawlsmask so cylindrical projections work correctly when
longitude range outside of -180 to 180.
* python 3 compatibility.
* added lic_demo.py to examples (line integral convolution,
requires scikit.vectorplot).
Expand Down
481 changes: 0 additions & 481 deletions LICENSE_pyshapelib

This file was deleted.

14 changes: 4 additions & 10 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include FAQ
include README
include MANIFEST.in
include LICENSE_proj4
include LICENSE_pyshapelib
include LICENSE_data
include API_CHANGES
include KNOWN_BUGS
Expand All @@ -12,6 +11,7 @@ include setup.cfg
include setupegg.py
include nad2bin.c
include src/*
include examples/makelsmask.py
include examples/allskymap.py
include examples/allskymap_cr_example.py
include examples/plothighsandlows.py
Expand Down Expand Up @@ -86,14 +86,10 @@ include lib/mpl_toolkits/__init__.py
include lib/mpl_toolkits/basemap/__init__.py
include lib/mpl_toolkits/basemap/proj.py
include lib/mpl_toolkits/basemap/pyproj.py
include lib/mpl_toolkits/basemap/shapefile.py
include lib/mpl_toolkits/basemap/cm.py
include lib/mpl_toolkits/basemap/netcdf.py
include lib/mpl_toolkits/basemap/pupynere.py
include lib/mpl_toolkits/basemap/netcdftime.py
include pyshapelib/README pyshapelib/COPYING pyshapelib/ChangeLog pyshapelib/NEWS
include pyshapelib/*.i pyshapelib/*.c pyshapelib/*.py pyshapelib/*.h
include pyshapelib/*.shp pyshapelib/*.shx pyshapelib/*.dbf
include pyshapelib/shapelib/*.c pyshapelib/shapelib/*.h
include lib/mpl_toolkits/basemap/solar.py
include lib/mpl_toolkits/basemap/test.py
include doc/users/figures/*py
include doc/users/*rst
include doc/api/*rst
Expand All @@ -102,6 +98,4 @@ include doc/make.py
include doc/conf.py
include doc/index.rst
recursive-include geos-3.2.0 *
recursive-include lib/dbflib *
recursive-include lib/shapelib *
recursive-include lib/mpl_toolkits/basemap/data *
10 changes: 0 additions & 10 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ source code for the GEOS library is
included in the 'geos-3.1.1' directory under the terms given in
LICENSE_geos.

pyshapelib by Bernhard Herzog is included in the 'pyshapelib' directory
under the terms given in LICENSE_pyshapelib.

the coastline, lake, river and political boundary data are extracted
from datasets provided with the Generic Mapping Tools
(http://gmt.soest.hawaii.edu)
Expand Down Expand Up @@ -105,13 +102,6 @@ run the usual 'python setup.py install'. Check your installation
by running "from mpl_toolkits.basemap import Basemap" at the python
prompt.

Basemap includes three auxilliary packages, pydap (http://pydap.org, just
the client is included), httplib2 and pyshapelib. By default, setup.py checks to
see if these are already installed, and if so does not try to overwrite
them. If you get import errors related to either of these two packages,
edit setup.cfg and set pydap, httplib2 and/or pyshapelib to True to force
installation of the included versions.

4) To test, cd to the examples directory and run 'python simpletest.py'.
To run all the examples (except those that have extra dependencies
or require an internet connection), execute 'python run_all.py'.
Expand Down
31 changes: 0 additions & 31 deletions README-devel

This file was deleted.

6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table',
extensions = ['matplotlib.sphinxext.mathmpl',
'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
'matplotlib.sphinxext.plot_directive', 'inheritance_diagram',
'gen_rst',
'matplotlib.sphinxext.plot_directive',
'sphinx.ext.inheritance_diagram',
'matplotlib.sphinxext.ipython_console_highlighting']

# Add any paths that contain templates here, relative to this directory.
Expand Down
25 changes: 1 addition & 24 deletions doc/users/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,6 @@ numpy 1.2.1 (or later)
`PROJ4 <http://trac.osgeo.org/proj/>`__ Cartographic Projections Library.
Patched version automatically built into basemap.

`pyshapelib <http://intevation.de/pipermail/thuban-devel/2004-May/000184.html>`__
C library with python interface for reading ESRI shapefiles.
If not present, will be installed with basemap.

`pupynere <http://pypi.python.org/pypi/pupynere/>`__
Pure python `netCDF <http://www.unidata.ucar.edu/software/netcdf/>`__
reader. Patched version automatically installed with basemap.

`pydap <http://code.google.com/p/pydap>`__
Pure python `OPeNDAP <http://opendap.org>`__ implementation.
If not present, client (not server) will be installed with basemap.

`httplib2 <http://code.google.com/p/httplib2>`__ (needed for pydap client).
If not present, will be installed with basemap.


**Optional libraries**

PIL
Expand All @@ -58,7 +42,7 @@ Installation
============

Windows binary installers are available for
`download <http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=142792/&abmode=1>`__.
`download <http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/`__.

For other platforms, download the source release and follow these steps:

Expand Down Expand Up @@ -87,13 +71,6 @@ For other platforms, download the source release and follow these steps:
by running ``from mpl_toolkits.basemap import Basemap`` at the python
prompt.

Basemap includes three auxilliary packages, pydap, pyshapelib and httplib2.
By default, setup.py checks to
see if these are already installed, and if so does not try to overwrite
them. If you get import errors related to any of these packages,
edit setup.cfg and set the appropriate entry to True to force
installation of the included versions.

* To test, cd to the examples directory and run ``python simpletest.py``.
To run all the examples (except those that have extra dependencies
or require an internet connection), execute ``python run_all.py``.
9 changes: 2 additions & 7 deletions doc/users/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ datasets (from `Generic Mapping Tools <http://gmt.soest.hawaii.edu/>`_)
are provided, along with methods for plotting them. The `GEOS library
<http://geos.refractions.net>`_ is used internally to clip the coastline and polticial boundary features to the desired map projection region.

Basemap provides facilities for reading data in `netCDF
<http://www.unidata.ucar.edu/software/netcdf/>`_ and `Shapefile
<http://en.wikipedia.org/wiki/Shapefile>`_ formats, as well as
directly over http using `OPeNDAP <http://en.wikipedia.org/wiki/OPeNDAP>`_.
This functionality is provided through the `PyDAP <http://pydap.org/>`_
client, and a python interface to the `Shapefile C library
<http://shapelib.maptools.org/>`_.
Basemap provides facilities for reading `shapefiles
<http://en.wikipedia.org/wiki/Shapefile>`_.

Basemap is geared toward the needs of earth scientists, particular
oceanographers and meteorologists. I originally wrote Basemap to help in my
Expand Down
2 changes: 2 additions & 0 deletions examples/README
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ ploticos.py demonstrates plotting on unstructured grids.

lic_demo.py shows how to use vectorplot scikit to visualize vector fields with
Line Integral Convolutions (LIC).

makelsmask.py use is_land method to generate land-sea mask from built-in GSSH coastline data,then plot mask with drawlsmask.
28 changes: 28 additions & 0 deletions examples/makelsmask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np
# make land-sea-lake mask from built-in coastline dataset using is_land method.
# this is very slow!
minutes = 150
resolution = 'c'

delon = minutes/60.
nlons = int(360./delon); nlons = nlons + 1
nlats = int(180./delon); nlats = nlats + 1
print minutes,nlons,nlats,resolution
lons = np.linspace(-180,180,nlons)
lats = np.linspace(-90,90,nlats)
lsmask = np.zeros((len(lats),len(lons)),dtype=np.uint8)
print lsmask.shape, lsmask.dtype

m =\
Basemap(llcrnrlon=-180,llcrnrlat=-90,urcrnrlon=180,urcrnrlat=90,resolution=resolution,projection='cyl')
for j,lat in enumerate(lats):
#print j
for i,lon in enumerate(lons):
lsmask[j,i] = m.is_land(lon,lat)
m.drawlsmask(land_color='coral',ocean_color='aqua',lsmask=lsmask,lsmask_lons=lons,lsmask_lats=lats,lakes=True)
plt.title('%s minute degree land-sea mask' % minutes)
#lsmask.tofile('%sminlsmask_gshhs_%s.dat' % (minutes, resolution))

plt.show()
4 changes: 2 additions & 2 deletions examples/maskoceans.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# interpolate land/sea mask to topo grid, mask ocean values.
# output may look 'blocky' near coastlines, since data is at much
# lower resolution than land/sea mask.
topo = maskoceans(lons, lats, topoin, inlands=False)
topo = maskoceans(lons, lats, topoin)
# make contour plot (ocean values will be masked)
CS=m.contourf(x,y,topo,np.arange(-300,3001,50),cmap=plt.cm.jet,extend='both')
#im=m.pcolormesh(x,y,topo,cmap=plt.cm.jet,vmin=-300,vmax=3000)
Expand All @@ -39,7 +39,7 @@
x, y = m(lons, lats)
topo = interp(topoin,lons1,lats1,lons,lats,order=1)
# interpolate land/sea mask to topo grid, mask ocean values.
topo = maskoceans(lons, lats, topo, inlands=False)
topo = maskoceans(lons, lats, topo)
# make contour plot (ocean values will be masked)
CS=m.contourf(x,y,topo,np.arange(-300,3001,50),cmap=plt.cm.jet,extend='both')
#im=m.pcolormesh(x,y,topo,cmap=plt.cm.jet,vmin=-300,vmax=3000)
Expand Down
51 changes: 49 additions & 2 deletions examples/wiki_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@
x, y = map(lons*180./np.pi, lats*180./np.pi)
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
plt.title('filled continent background')

# as above, but use land-sea mask image as map background.
fig = plt.figure()
map.drawmapboundary()
map.drawmeridians(np.arange(0,360,30))
map.drawparallels(np.arange(-90,90,30))
# plot filled circles at the locations of the cities.
map.plot(xc,yc,'wo')
# plot the names of five cities.
for name,xpt,ypt in zip(cities,xc,yc):
plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w')
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
plt.title('land-sea mask background')
map.drawlsmask(ocean_color='aqua',land_color='coral')

# as above, but use blue marble image as map background.
fig = plt.figure()
Expand All @@ -49,6 +65,37 @@
plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w')
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
# draw blue marble image in background.
map.bluemarble(scale=0.5)
plt.title('blue marble background')
map.bluemarble()

# as above, but use shaded relief image as map background.
fig = plt.figure()
map.drawmapboundary()
map.drawmeridians(np.arange(0,360,30))
map.drawparallels(np.arange(-90,90,30))
# plot filled circles at the locations of the cities.
map.plot(xc,yc,'wo')
# plot the names of five cities.
for name,xpt,ypt in zip(cities,xc,yc):
plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w')
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
plt.title('shaded relief background')
map.shadedrelief()

# as above, but use etopo image as map background.
fig = plt.figure()
map.drawmapboundary()
map.drawmeridians(np.arange(0,360,30))
map.drawparallels(np.arange(-90,90,30))
# plot filled circles at the locations of the cities.
map.plot(xc,yc,'wo')
# plot the names of five cities.
for name,xpt,ypt in zip(cities,xc,yc):
plt.text(xpt+50000,ypt+50000,name,fontsize=9,color='w')
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
plt.title('etopo background')
map.etopo()

plt.show()
1 change: 0 additions & 1 deletion lib/dbflib/__init__.py

This file was deleted.

76 changes: 0 additions & 76 deletions lib/dbflib/dbflib.py

This file was deleted.

Loading