<commit_before>import pylab as P
from matplotlib.toolkits.basemap import Basemap
from matplotlib.numerix import ma
from matplotlib.image import pil_to_array
from PIL import Image

# shows how to warp an image from one map projection to another.
# image from http://www.space-graphics.com/earth_topo-bathy.htm, 
# from the readme.txt that comes with the image:
# e_topo-bathy - Global Earth planet imagery (c)2004
# Usage License
# This image is distributed as FREEWARE for Personal use only
# NO Commercial use or Commercial redistribution allowed in any form

# read in jpeg image to rgba array of normalized floats.
pilImage = Image.open('e_topo_bathy_4k.jpg')
rgba = pil_to_array(pilImage)
rgba = rgba[::-1,:,:]
# define lat/lon grid that image spans (projection='cyl').
nlons = rgba.shape[1]; nlats = rgba.shape[0]
delta = 360./float(nlons)
lons = P.arange(-180.+0.5*delta,180.,delta)
lats = P.arange(-90.+0.5*delta,90.,delta)
<commit_msg>fixes for PIL<commit_after>import pylab as P
from matplotlib.toolkits.basemap import Basemap
from matplotlib.numerix import ma
from matplotlib.image import pil_to_array
from PIL import Image

# shows how to warp an image from one map projection to another.
# image from http://www.space-graphics.com/earth_topo-bathy.htm, 
# from the readme.txt that comes with the image:
# e_topo-bathy - Global Earth planet imagery (c)2004
# Usage License
# This image is distributed as FREEWARE for Personal use only
# NO Commercial use or Commercial redistribution allowed in any form

# read in jpeg image to rgba array of normalized floats.
try:
    pilImage = Image.open('e_topo_bathy_4k.jpg')
except:
    raise IOError, 'please grab image from http://www.space-graphics.com/earth_topo-bathy.htm'
rgba = pil_to_array(pilImage)
rgba = rgba.astype(P.Float32)/255. # convert to normalized floats.

# define lat/lon grid that image spans (projection='cyl').
nlons = rgba.shape[1]; nlats = rgba.shape[0]
delta = 360./float(nlons)
lons = P.arange(-180.+0.5*delta,180.,delta)
lats = P.arange(-90.+0.5*delta,90.,delta)

{'fraction_non_alphanumeric': 0.10322896281800391, 'fraction_numerical': 0.026418786692759294, 'mean_word_length': 4.680555555555555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1164300', 'n_tokens_mistral': 757, 'n_tokens_neox': 680, 'n_words': 223}