diff --git a/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb b/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb index 619fdf7f..13349fa1 100755 --- a/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb +++ b/tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb @@ -53,7 +53,7 @@ "from astroquery.vizier import Vizier\n", "import scipy.optimize\n", "# Make plots display in notebooks\n", - "%matplotlib inline " + "%matplotlib inline" ] }, { @@ -85,7 +85,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "This catalog has a lot of information, but for this tutorial we are going to work only with periods and magnitudes. Let's grab them using the keywords `'Period'` and `__Ksmag__`. Note that `'e__Ksmag_'` refers to the error bars in the magnitude measurements." + "This catalog has a lot of information, but for this tutorial we are going to work only with periods and magnitudes. Let's grab them using the keywords `'Period'` and ``. Note that `'e_'` refers to the error bars in the magnitude measurements." ] }, { @@ -94,10 +94,10 @@ "metadata": {}, "outputs": [], "source": [ - "period = np.array(catalog[0]['Period']) \n", + "period = np.array(catalog[0]['Period'])\n", "log_period = np.log10(period)\n", - "k_mag = np.array(catalog[0]['__Ksmag_'])\n", - "k_mag_err = np.array(catalog[0]['e__Ksmag_'])" + "k_mag = np.array(catalog[0][''])\n", + "k_mag_err = np.array(catalog[0]['e_'])" ] }, { @@ -214,7 +214,7 @@ "metadata": {}, "outputs": [], "source": [ - "fitter = fitting.LinearLSQFitter() " + "fitter = fitting.LinearLSQFitter()" ] }, { @@ -257,7 +257,7 @@ "outputs": [], "source": [ "plt.errorbar(log_period,k_mag,k_mag_err,fmt='k.')\n", - "plt.plot(log_period, best_fit(log_period), color='g', linewidth=3) \n", + "plt.plot(log_period, best_fit(log_period), color='g', linewidth=3)\n", "plt.xlabel(r'$\\log_{10}$(Period [days])')\n", "plt.ylabel('Ks')" ] @@ -318,11 +318,11 @@ "source": [ "N = 100\n", "x1 = np.linspace(0, 4, N) # Makes an array from 0 to 4 of N elements\n", - "y1 = x1**3 - 6*x1**2 + 12*x1 - 9 \n", + "y1 = x1**3 - 6*x1**2 + 12*x1 - 9\n", "# Now we add some noise to the data\n", "y1 += np.random.normal(0, 2, size=len(y1)) #One way to add random gaussian noise\n", "sigma = 1.5\n", - "y1_err = np.ones(N)*sigma " + "y1_err = np.ones(N)*sigma" ] }, { @@ -339,7 +339,7 @@ "outputs": [], "source": [ "plt.errorbar(x1, y1, yerr=y1_err,fmt='k.')\n", - "plt.xlabel('$x_1$') \n", + "plt.xlabel('$x_1$')\n", "plt.ylabel('$y_1$')" ] }, @@ -357,7 +357,7 @@ "outputs": [], "source": [ "model_poly = models.Polynomial1D(degree=3)\n", - "fitter_poly = fitting.LinearLSQFitter() \n", + "fitter_poly = fitting.LinearLSQFitter()\n", "best_fit_poly = fitter_poly(model_poly, x1, y1, weights = 1.0/y1_err)" ] }, @@ -477,7 +477,7 @@ "outputs": [], "source": [ "plt.errorbar(x1, y1, yerr=y1_err,fmt='k.')\n", - "plt.plot(x1, best_fit_poly(x1), color='r', linewidth=3, label='LinearLSQFitter()') \n", + "plt.plot(x1, best_fit_poly(x1), color='r', linewidth=3, label='LinearLSQFitter()')\n", "plt.plot(x1, best_fit_poly_2(x1), color='g', linewidth=3, label='SimplexLSQFitter()')\n", "plt.xlabel(r'$\\log_{10}$(Period [days])')\n", "plt.ylabel('Ks')\n", @@ -753,7 +753,7 @@ "y3 = 5.0 * np.sin(2 * np.pi * x3)\n", "y3 = np.array([y_point + np.random.normal(0, 1) for y_point in y3])\n", "sigma = 1.5\n", - "y3_err = np.ones(N)*sigma " + "y3_err = np.ones(N)*sigma" ] }, {