Book Image

Mastering SciPy

By : Francisco Javier Blanco-Silva, Francisco Javier B Silva
Book Image

Mastering SciPy

By: Francisco Javier Blanco-Silva, Francisco Javier B Silva

Overview of this book

Table of Contents (16 chapters)
Mastering SciPy
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Motivation


Consider a meteorological experiment that measures the temperature of a set of buoys located on a rectangular grid at sea. We can emulate such an experiment by indicating the longitude and latitude of the buoys on a grid of 16 × 16 locations, and random temperatures on them between say 36ºF and 46ºF:

In [1]: import numpy as np, matplotlib.pyplot as plt, \
   ...: matplotlib.cm as cm; \
   ...: from mpl_toolkits.basemap import Basemap
In [2]: map1 = Basemap(projection='ortho', lat_0=20, lon_0=-60, \
   ...:                resolution='l', area_thresh=1000.0); \
   ...: map2 = Basemap(projection='merc', lat_0=20, lon_0=-60, \
   ...:                resolution='l', area_thresh=1000.0, \
   ...:                llcrnrlat=0,  urcrnrlat=45, \
   ...:                llcrnrlon=-75, urcrnrlon=-15)
In [3]: longitudes = np.linspace(-60, -30, 16); \
   ...: latitudes = np.linspace(15, 30, 16); \
   ...: lons, lats = np.meshgrid(longitudes, latitudes); \
   ...: temperatures = 10. * np.random...