diff --git a/source/core/numpy_scipy.rst b/source/core/numpy_scipy.rst index 8f35455..95ad5d2 100644 --- a/source/core/numpy_scipy.rst +++ b/source/core/numpy_scipy.rst @@ -458,7 +458,7 @@ image. import scipy.signal img_sm = scipy.signal.medfilt(img, 5) - sigma = median(err) + sigma = np.median(err) bad = np.abs(img - img_sm) / sigma > 8.0 img_cr = img.copy() img_cr[bad] = img_sm[bad] diff --git a/source/installation/python_install.rst b/source/installation/python_install.rst index 34d3acd..9b43e45 100644 --- a/source/installation/python_install.rst +++ b/source/installation/python_install.rst @@ -19,11 +19,12 @@ You may need to choose between 32-bit and 64-bit installations. Generally speaking you should choose 64-bit, but read `64 versus 32 bit`_ for some caveats or if you aren't sure if your CPU is 64-bit. -For this workshop you can use either Python 2.6, 2.7 or Python 3 (version >= -3.3). On the general question of whether to use Python 2 or Python 3, at this -point the major package support for both is quite similar, and (as of -early 2015) it appears that in the overall community Python 3 usage is -becoming substantial. +For most of this workshop you can use either Python 2.7 or Python 3 (version >= +3.3). The exception is the Sherpa fitting tutorial which can only be done with +Python 2.7. On the general question of whether to use Python 2 or Python 3, at +this point the major package support for both is quite similar, and (as of +early 2015) it appears that in the overall community Python 3 usage is becoming +substantial. .. _`anaconda_option`: @@ -113,6 +114,7 @@ core scientific Python installation, do the following and check version numbers: import numpy import scipy import scipy.linalg + import matplotlib import matplotlib.pyplot as plt print(numpy.__version__) @@ -120,7 +122,7 @@ core scientific Python installation, do the following and check version numbers: print(matplotlib.__version__) x = numpy.linspace(0, 20, 100) - plt.plot(x, sin(x)) + plt.plot(x, numpy.sin(x)) print(scipy.linalg.eig([[1,2],[3,4]])) The commands above should succeed with no errors. The version numbers should diff --git a/source/intro/quick-tour.rst b/source/intro/quick-tour.rst index f1a0480..dd48bf0 100644 --- a/source/intro/quick-tour.rst +++ b/source/intro/quick-tour.rst @@ -182,7 +182,7 @@ including convolution with a Gaussian filter and the addition of noise. image += random.normal(3., 0.01, image.shape) # Write out to FITS image - pits.writeto('cluster.fits', image, clobber=True) + fits.writeto('cluster.fits', image, clobber=True) The simulated cluster image is below: diff --git a/source/plotting/matplotlib.rst b/source/plotting/matplotlib.rst index 5b04eee..69c458b 100644 --- a/source/plotting/matplotlib.rst +++ b/source/plotting/matplotlib.rst @@ -704,7 +704,7 @@ these arguments are ``(x,y)`` tuples:: plt.clf() t = np.arange(0.0, 5.0, 0.01) - s = np.cos(2*pi*t) + s = np.cos(2*np.pi*t) lines = plt.plot(t, s, lw=2) plt.annotate('local max', xy=(2, 1), xytext=(3, 1.5),