From ae380beb7b9cb810f60c80d11191a1ce9ef9f82f Mon Sep 17 00:00:00 2001 From: Allen Downey Date: Tue, 17 Nov 2020 09:49:00 -0500 Subject: [PATCH] Revisions after day 1 --- 01_query.ipynb | 20 +++++++++++++++----- 02_coords.ipynb | 4 +++- 03_motion.ipynb | 15 ++++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/01_query.ipynb b/01_query.ipynb index 259a7df..c559bdb 100644 --- a/01_query.ipynb +++ b/01_query.ipynb @@ -600,7 +600,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** One of the other tables we'll use is `gaiadr2.panstarrs1_original_valid`. Use `load_table` to get the metadata for this table. How many columns are there and what are their names?" + "## Exercise\n", + "\n", + "One of the other tables we'll use is `gaiadr2.panstarrs1_original_valid`. Use `load_table` to get the metadata for this table. How many columns are there and what are their names?" ] }, { @@ -974,7 +976,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** Read [the documentation of this table](https://gea.esac.esa.int/archive/documentation/GDR2/Gaia_archive/chap_datamodel/sec_dm_main_tables/ssec_dm_gaia_source.html) and choose a column that looks interesting to you. Add the column name to the query and run it again. What are the units of the column you selected? What is its data type?" + "## Exercise\n", + "\n", + "Read [the documentation of this table](https://gea.esac.esa.int/archive/documentation/GDR2/Gaia_archive/chap_datamodel/sec_dm_main_tables/ssec_dm_gaia_source.html) and choose a column that looks interesting to you. Add the column name to the query and run it again. What are the units of the column you selected? What is its data type?" ] }, { @@ -1146,7 +1150,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** The clauses in a query have to be in the right order. Go back and change the order of the clauses in `query2` and run it again. \n", + "## Exercise\n", + "\n", + "The clauses in a query have to be in the right order. Go back and change the order of the clauses in `query2` and run it again. \n", "\n", "The query should fail, but notice that you don't get much useful debugging information. \n", "\n", @@ -1193,7 +1199,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** [Read about SQL operators here](https://www.w3schools.com/sql/sql_operators.asp) and then modify the previous query to select rows where `bp_rp` is between `-0.75` and `2`.\n", + "## Exercise\n", + "\n", + "[Read about SQL operators here](https://www.w3schools.com/sql/sql_operators.asp) and then modify the previous query to select rows where `bp_rp` is between `-0.75` and `2`.\n", "\n", "You can [read about this variable here](https://gea.esac.esa.int/archive/documentation/GDR2/Gaia_archive/chap_datamodel/sec_dm_main_tables/ssec_dm_gaia_source.html)." ] @@ -1542,7 +1550,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** This query always selects sources with `parallax` less than 1. But suppose you want to take that upper bound as an input.\n", + "## Exercise\n", + "\n", + "This query always selects sources with `parallax` less than 1. But suppose you want to take that upper bound as an input.\n", "\n", "Modify `query3_base` to replace `1` with a format specifier like `{max_parallax}`. Now, when you call `format`, add a keyword argument that assigns a value to `max_parallax`, and confirm that the format specifier gets replaced with the value you provide." ] diff --git a/02_coords.ipynb b/02_coords.ipynb index 6ea4aad..3e684b0 100644 --- a/02_coords.ipynb +++ b/02_coords.ipynb @@ -203,7 +203,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** When you are debugging queries like this, you can use `TOP` to limit the size of the results, but then you still don't know how big the results will be.\n", + "## Exercise\n", + "\n", + "When you are debugging queries like this, you can use `TOP` to limit the size of the results, but then you still don't know how big the results will be.\n", "\n", "An alternative is to use `COUNT`, which asks for the number of rows that would be selected, but it does not return them.\n", "\n", diff --git a/03_motion.ipynb b/03_motion.ipynb index 8b33467..a2089c9 100644 --- a/03_motion.ipynb +++ b/03_motion.ipynb @@ -526,9 +526,16 @@ "\n", "This scatter plot has a problem. It is \"[overplotted](https://python-graph-gallery.com/134-how-to-avoid-overplotting-with-python/)\", which means that there are so many overlapping points, we can't distinguish between high and low density areas.\n", "\n", - "To fix this, we can provide optional arguments to control the size and transparency of the points.\n", + "To fix this, we can provide optional arguments to control the size and transparency of the points." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exercise\n", "\n", - "**Exercise:** In the call to `plt.plot`, add the keyword argument `markersize=0.1` to make the markers smaller.\n", + "In the call to `plt.plot`, add the keyword argument `markersize=0.1` to make the markers smaller.\n", "\n", "Then add the argument `alpha=0.1` to make the markers nearly transparent.\n", "\n", @@ -1739,7 +1746,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "**Exercise:** We're going to need `centerline` and `selected` later as well. Write a line or two of code to add it as a second Dataset in the HDF5 file." + "## Exercise \n", + "\n", + "We're going to need `centerline` and `selected` later as well. Write a line or two of code to add it as a second Dataset in the HDF5 file." ] }, {