From af6f4330c79436c347ddd76bf2a384f3e88491e9 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Wed, 15 Jun 2016 15:49:50 -0400 Subject: [PATCH 1/3] Some minor fixes --- source/installation/python_install.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 From 24ae27109cae73aa5066b8092f8ae69fdcd254e8 Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Wed, 15 Jun 2016 15:51:56 -0400 Subject: [PATCH 2/3] Fix np missing problem --- source/core/numpy_scipy.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] From 9c1d9338ba34b0347a4999575e2e18fc2ee350ec Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Wed, 15 Jun 2016 15:54:35 -0400 Subject: [PATCH 3/3] Fix #28 --- source/intro/quick-tour.rst | 2 +- source/plotting/matplotlib.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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),