Skip to content

Change name of column and some whitespace fixes #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tutorials/Models-Quick-Fit/Models-Quick-Fit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"from astroquery.vizier import Vizier\n",
"import scipy.optimize\n",
"# Make plots display in notebooks\n",
"%matplotlib inline "
"%matplotlib inline"
]
},
{
Expand Down Expand Up @@ -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 `<Ksmag>`. Note that `'e_<Ksmag>'` refers to the error bars in the magnitude measurements."
]
},
{
Expand All @@ -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]['<Ksmag>'])\n",
"k_mag_err = np.array(catalog[0]['e_<Ksmag>'])"
]
},
{
Expand Down Expand Up @@ -214,7 +214,7 @@
"metadata": {},
"outputs": [],
"source": [
"fitter = fitting.LinearLSQFitter() "
"fitter = fitting.LinearLSQFitter()"
]
},
{
Expand Down Expand Up @@ -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')"
]
Expand Down Expand Up @@ -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"
]
},
{
Expand All @@ -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$')"
]
},
Expand All @@ -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)"
]
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
},
{
Expand Down
Loading