Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran it through "2to3 -w" for Python3. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file modified MANIFEST
100755 → 100644
Empty file.
18 changes: 9 additions & 9 deletions README
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ pip install --user -e git+https://github.com/brorfred/projmap.git#egg=projmap

= Define a project in one of the following files: =

./region_maps.cfg
~/.region_maps.cfg
./map_regions.cfg
~/.map_regions.cfg

An example project can look like this:

Expand All @@ -25,24 +25,24 @@ base.llcrnrlon: -70 # All keywords can be used
base.llcrnrlat: -60 # Read more at
base.urcrnrlat: -20 # http://matplotlib.org/basemap/users/mapsetup.html
base.urcrnrlon: 30 #
base.lat_0: -40 # Remember to begin all keyworrds with 'base.'
base.lat_0: -40 # Remember to begin all keywords with 'base.'
base.lon_0: 0 #
base.resolution: i #
base.resolution: i #
proj.merid: [-60, -40, -20, 0, 20, 40] # Where to draw meridians
proj.paral: [-60, -50, -40, -30] # Where to drar parallels
proj.paral: [-60, -50, -40, -30] # Where to draw parallels


Example of usage:

>>> import projmap
>>> import projmap
>>>
>>> #list all available regions
>>> projmap.list()
>>> projmap.list()
>>> #lists all settings for a region
>>> projmap.list(' #handle')
>>> projmap.list(' #handle')
>>>
>>> #Create a map instance
>>> mp = projmap.Projmap('handle')
>>>
>>> #Make a nice looking map
>>> mp.nice()
>>> mp.nice()
2 changes: 1 addition & 1 deletion projmap/__init__.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import print_function

"""A wrapper for the mpl_toolkit Basemap class

Projmap helps with setting up projections and domains for areas
Expand Down
10 changes: 5 additions & 5 deletions projmap/basemap.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import print_function

""" Add presets to matplotlib/basemap

Projmap is a wrapper to matplotlib's Basemap module to make the usage
Expand Down Expand Up @@ -52,14 +52,14 @@ def openfile(fname):
def splitkey(key, val):
if "base." in key:
basekey = key[5:]
if basekey in self.inkwargs.keys():
if basekey in list(self.inkwargs.keys()):
self.base_kwargs[basekey] = self.inkwargs[basekey]
del self.inkwargs[basekey]
else:
self.base_kwargs[basekey] = val
elif "proj." in key:
selfkey = key[5:]
if selfkey in self.inkwargs.keys():
if selfkey in list(self.inkwargs.keys()):
self.__dict__[selfkey] = self.inkwargs[selfkey]
del self.inkwargs[selfkey]
else:
Expand All @@ -78,7 +78,7 @@ def splitkey(key, val):
def nice(self,latlabels=True,lonlabels=True):
""" Draw land, parallells and meridians on a map"""
def alpha(lH):
for l in lH.items():
for l in list(lH.items()):
l[1][0][0].set_alpha(0.5)
if hasattr(self, "latlabels"):
latlabels = self.latlabels
Expand Down Expand Up @@ -149,7 +149,7 @@ def line(lons, lats):
line([lon2]*step, np.linspace(lat2,lat1,step))
line(np.linspace(lon2,lon1,step), [lat2]*step)
if shading:
p = pl.Polygon(zip(pos.x, pos.y),facecolor=shading, edgecolor=c,
p = pl.Polygon(list(zip(pos.x, pos.y)),facecolor=shading, edgecolor=c,
alpha=0.5,linewidth=1)
pl.gca().add_patch(p)

Expand Down
Empty file modified projmap/data/pf.txt
100755 → 100644
Empty file.
Empty file modified projmap/data/saccf.txt
100755 → 100644
Empty file.
Empty file modified projmap/data/saf.txt
100755 → 100644
Empty file.
Empty file modified projmap/data/sbdy.txt
100755 → 100644
Empty file.
Empty file modified projmap/data/stf.txt
100755 → 100644
Empty file.
10 changes: 5 additions & 5 deletions projmap/hitta.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def projfig(label='',figno=[],lev=0,dpi=100):
stack = traceback.extract_stack()
parfun = stack[-2][2]
namefun = stack[-2][0][:-3]
print parfun, namefun
print "---"
print stack[-2]
print "---"
print(parfun, namefun)
print("---")
print(stack[-2])
print("---")

figno = pl.gcf().number
figdir = os.getcwd() + '/figs/' + namefun + "/" + parfun + '/'
Expand All @@ -20,7 +20,7 @@ def projfig(label='',figno=[],lev=0,dpi=100):
except OSError:
pass
file = '%s/fig_%02i_%s.png' % (figdir, figno, label)
print file
print(file)
pl.savefig(file, dpi=dpi)

def WRY():
Expand Down
Empty file modified projmap/map_region.py
100755 → 100644
Empty file.
Empty file modified projmap/map_regions.cfg
100755 → 100644
Empty file.
Empty file modified setup.py
100755 → 100644
Empty file.