Skip to content

Commit 976579e

Browse files
committed
change name of column and some whitespace fixes
1 parent e53bdf0 commit 976579e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"from astroquery.vizier import Vizier\n",
5454
"import scipy.optimize\n",
5555
"# Make plots display in notebooks\n",
56-
"%matplotlib inline "
56+
"%matplotlib inline"
5757
]
5858
},
5959
{
@@ -85,7 +85,7 @@
8585
"cell_type": "markdown",
8686
"metadata": {},
8787
"source": [
88-
"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."
88+
"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."
8989
]
9090
},
9191
{
@@ -94,10 +94,10 @@
9494
"metadata": {},
9595
"outputs": [],
9696
"source": [
97-
"period = np.array(catalog[0]['Period']) \n",
97+
"period = np.array(catalog[0]['Period'])\n",
9898
"log_period = np.log10(period)\n",
99-
"k_mag = np.array(catalog[0]['__Ksmag_'])\n",
100-
"k_mag_err = np.array(catalog[0]['e__Ksmag_'])"
99+
"k_mag = np.array(catalog[0]['<Ksmag>'])\n",
100+
"k_mag_err = np.array(catalog[0]['e_<Ksmag>'])"
101101
]
102102
},
103103
{
@@ -214,7 +214,7 @@
214214
"metadata": {},
215215
"outputs": [],
216216
"source": [
217-
"fitter = fitting.LinearLSQFitter() "
217+
"fitter = fitting.LinearLSQFitter()"
218218
]
219219
},
220220
{
@@ -257,7 +257,7 @@
257257
"outputs": [],
258258
"source": [
259259
"plt.errorbar(log_period,k_mag,k_mag_err,fmt='k.')\n",
260-
"plt.plot(log_period, best_fit(log_period), color='g', linewidth=3) \n",
260+
"plt.plot(log_period, best_fit(log_period), color='g', linewidth=3)\n",
261261
"plt.xlabel(r'$\\log_{10}$(Period [days])')\n",
262262
"plt.ylabel('Ks')"
263263
]
@@ -318,11 +318,11 @@
318318
"source": [
319319
"N = 100\n",
320320
"x1 = np.linspace(0, 4, N) # Makes an array from 0 to 4 of N elements\n",
321-
"y1 = x1**3 - 6*x1**2 + 12*x1 - 9 \n",
321+
"y1 = x1**3 - 6*x1**2 + 12*x1 - 9\n",
322322
"# Now we add some noise to the data\n",
323323
"y1 += np.random.normal(0, 2, size=len(y1)) #One way to add random gaussian noise\n",
324324
"sigma = 1.5\n",
325-
"y1_err = np.ones(N)*sigma "
325+
"y1_err = np.ones(N)*sigma"
326326
]
327327
},
328328
{
@@ -339,7 +339,7 @@
339339
"outputs": [],
340340
"source": [
341341
"plt.errorbar(x1, y1, yerr=y1_err,fmt='k.')\n",
342-
"plt.xlabel('$x_1$') \n",
342+
"plt.xlabel('$x_1$')\n",
343343
"plt.ylabel('$y_1$')"
344344
]
345345
},
@@ -357,7 +357,7 @@
357357
"outputs": [],
358358
"source": [
359359
"model_poly = models.Polynomial1D(degree=3)\n",
360-
"fitter_poly = fitting.LinearLSQFitter() \n",
360+
"fitter_poly = fitting.LinearLSQFitter()\n",
361361
"best_fit_poly = fitter_poly(model_poly, x1, y1, weights = 1.0/y1_err)"
362362
]
363363
},
@@ -477,7 +477,7 @@
477477
"outputs": [],
478478
"source": [
479479
"plt.errorbar(x1, y1, yerr=y1_err,fmt='k.')\n",
480-
"plt.plot(x1, best_fit_poly(x1), color='r', linewidth=3, label='LinearLSQFitter()') \n",
480+
"plt.plot(x1, best_fit_poly(x1), color='r', linewidth=3, label='LinearLSQFitter()')\n",
481481
"plt.plot(x1, best_fit_poly_2(x1), color='g', linewidth=3, label='SimplexLSQFitter()')\n",
482482
"plt.xlabel(r'$\\log_{10}$(Period [days])')\n",
483483
"plt.ylabel('Ks')\n",
@@ -753,7 +753,7 @@
753753
"y3 = 5.0 * np.sin(2 * np.pi * x3)\n",
754754
"y3 = np.array([y_point + np.random.normal(0, 1) for y_point in y3])\n",
755755
"sigma = 1.5\n",
756-
"y3_err = np.ones(N)*sigma "
756+
"y3_err = np.ones(N)*sigma"
757757
]
758758
},
759759
{

0 commit comments

Comments
 (0)