mirror of
https://github.com/AllenDowney/AstronomicalData.git
synced 2026-03-12 21:22:57 -07:00
Updating notebooks
This commit is contained in:
@@ -1,46 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Basic queries\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"questions:\n",
|
||||
"- \"How can we select and download the data we want from the Gaia server?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"- \"Compose a basic query in ADQL/SQL.\"\n",
|
||||
"- \"Use queries to explore a database and its tables.\"\n",
|
||||
"- \"Use queries to download data.\"\n",
|
||||
"- \"Develop, test, and debug a query incrementally.\"\n",
|
||||
"keypoints:\n",
|
||||
"- \"If you can't download an entire dataset (or it's not practical) use queries to select the data you need.\"\n",
|
||||
"\n",
|
||||
"- \"Read the metadata and the documentation to make sure you understand the tables, their columns, and what they mean.\"\n",
|
||||
"\n",
|
||||
"- \"Develop queries incrementally: start with something simple, test it, and add a little bit at a time.\"\n",
|
||||
"\n",
|
||||
"- \"Use ADQL features like `TOP` and `COUNT` to test before you run a query that might return a lot of data.\"\n",
|
||||
"\n",
|
||||
"- \"If you know your query will return fewer than 3000 rows, you can \n",
|
||||
"run it synchronously, which might complete faster (but it doesn't seem to make much difference). If it might return more than 3000 rows, you should run it asynchronously.\"\n",
|
||||
"\n",
|
||||
"- \"ADQL and SQL are not case-sensitive, so you don't have to \n",
|
||||
"capitalize the keywords, but you should.\"\n",
|
||||
"\n",
|
||||
"- \"ADQL and SQL don't require you to break a query into multiple \n",
|
||||
"lines, but you should.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
@@ -1,42 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Coordinate Transformations\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"questions:\n",
|
||||
"\n",
|
||||
"- \"How do we transform celestial coordinates from one frame to another and save results in files?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"\n",
|
||||
"- \"Use Python string formatting to compose more complex ADQL queries.\"\n",
|
||||
"\n",
|
||||
"- \"Work with coordinates and other quantities that have units.\"\n",
|
||||
"\n",
|
||||
"- \"Download the results of a query and store them in a file.\"\n",
|
||||
"\n",
|
||||
"keypoints:\n",
|
||||
"\n",
|
||||
"- \"For measurements with units, use `Quantity` objects that represent units explicitly and check for errors.\"\n",
|
||||
"\n",
|
||||
"- \"Use the `format` function to compose queries; it is often faster and less error-prone.\"\n",
|
||||
"\n",
|
||||
"- \"Develop queries incrementally: start with something simple, test it, and add a little bit at a time.\"\n",
|
||||
"\n",
|
||||
"- \"Once you have a query working, save the data in a local file. If you shut down the notebook and come back to it later, you can reload the file; you don't have to run the query again.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
@@ -1,47 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Plotting and Pandas\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"\n",
|
||||
"questions:\n",
|
||||
"\n",
|
||||
"- \"How do we make scatter plots in Matplotlib? How do we store data in a Pandas `DataFrame`?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"\n",
|
||||
"- \"Select rows and columns from an Astropy `Table`.\"\n",
|
||||
"\n",
|
||||
"- \"Use Matplotlib to make a scatter plot.\"\n",
|
||||
"\n",
|
||||
"- \"Use Gala to transform coordinates.\"\n",
|
||||
"\n",
|
||||
"- \"Make a Pandas `DataFrame` and use a Boolean `Series` to select rows.\"\n",
|
||||
"\n",
|
||||
"- \"Save a `DataFrame` in an HDF5 file.\"\n",
|
||||
"\n",
|
||||
"keypoints:\n",
|
||||
"\n",
|
||||
"- \"When you make a scatter plot, adjust the size of the markers and their transparency so the figure is not overplotted; otherwise it can misrepresent the data badly.\"\n",
|
||||
"\n",
|
||||
"- \"For simple scatter plots in Matplotlib, `plot` is faster than `scatter`.\"\n",
|
||||
"\n",
|
||||
"- \"An Astropy `Table` and a Pandas `DataFrame` are similar in many ways and they provide many of the same functions. They have pros and cons, but for many projects, either one would be a reasonable choice.\"\n",
|
||||
"\n",
|
||||
"- \"To store data from a Pandas `DataFrame`, a good option is an HDF file, which can contain multiple Datasets.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
@@ -1,42 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Transform and Select\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"questions:\n",
|
||||
"\n",
|
||||
"- \"How do we move the computation to the data?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"\n",
|
||||
"- \"Transform proper motions from one frame to another.\"\n",
|
||||
"\n",
|
||||
"- \"Compute the convex hull of a set of points.\"\n",
|
||||
"\n",
|
||||
"- \"Write an ADQL query that selects based on proper motion.\"\n",
|
||||
"\n",
|
||||
"- \"Save data in CSV format.\"\n",
|
||||
"\n",
|
||||
"keypoints:\n",
|
||||
"\n",
|
||||
"- \"When possible, 'move the computation to the data'; that is, do as much of the work as possible on the database server before downloading the data.\"\n",
|
||||
"\n",
|
||||
"- \"For most applications, saving data in FITS or HDF5 is better than CSV. FITS and HDF5 are binary formats, so the files are usually smaller, and they store metadata, so you don't lose anything when you read the file back.\"\n",
|
||||
"\n",
|
||||
"- \"On the other hand, CSV is a 'least common denominator' format; that is, it can be read by practically any application that works with data.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
@@ -1,34 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Join\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"questions:\n",
|
||||
"\n",
|
||||
"- \"How do we use `JOIN` to combine information from multiple tables?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"\n",
|
||||
"- \"Upload a table to the Gaia server.\"\n",
|
||||
"\n",
|
||||
"- \"Write ADQL queries involving `JOIN` operations.\"\n",
|
||||
"\n",
|
||||
"keypoints:\n",
|
||||
"\n",
|
||||
"- \"Use `JOIN` operations to combine data from multiple tables in a databased, using some kind of identifier to match up records from one table with records from another.\"\n",
|
||||
"\n",
|
||||
"- \"This is another example of a practice we saw in the previous notebook, moving the computation to the data.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
@@ -1,38 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Photometry\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"questions:\n",
|
||||
"\n",
|
||||
"- \"How do we use Matplotlib to select a polygon and Pandas to merge data from multiple tables?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"\n",
|
||||
"- \"Use Matplotlib to specify a polygon and determine which points fall inside it.\"\n",
|
||||
"\n",
|
||||
"- \"Use Pandas to merge data from multiple `DataFrames`, much like a database `JOIN` operation.\"\n",
|
||||
"\n",
|
||||
"keypoints:\n",
|
||||
"\n",
|
||||
"- \"Matplotlib provides operations for working with points, polygons, and other geometric entities, so it's not just for making figures.\"\n",
|
||||
"\n",
|
||||
"- \"If you want to perform something like a database `JOIN` operation with data that is in a Pandas `DataFrame`, you can use the `join` or `merge` function. In many cases, `merge` is easier to use because the arguments are more like SQL.\"\n",
|
||||
"\n",
|
||||
"- \"Use Matplotlib options to control the size and aspect ratio of figures to make them easier to interpret.\"\n",
|
||||
"\n",
|
||||
"- \"Be sure to record every element of the data analysis pipeline that would be needed to replicate the results.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
@@ -1,40 +1,5 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "raw",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"---\n",
|
||||
"title: \"Visualization\"\n",
|
||||
"teaching: 3000\n",
|
||||
"exercises: 0\n",
|
||||
"questions:\n",
|
||||
"\n",
|
||||
"- \"How do we make a compelling visualization that tells a story?\"\n",
|
||||
"\n",
|
||||
"objectives:\n",
|
||||
"\n",
|
||||
"- \"Design a figure that tells a compelling story.\"\n",
|
||||
"\n",
|
||||
"- \"Use Matplotlib features to customize the appearance of figures.\"\n",
|
||||
"\n",
|
||||
"- \"Generate a figure with multiple subplots.\"\n",
|
||||
"\n",
|
||||
"keypoints:\n",
|
||||
"\n",
|
||||
"- \"The most effective figures focus on telling a single story clearly and compellingly.\"\n",
|
||||
"\n",
|
||||
"- \"Consider using annotations to guide the readers attention to the most important elements of a figure.\"\n",
|
||||
"\n",
|
||||
"- \"The default Matplotlib style generates good quality figures, but there are several ways you can override the defaults.\"\n",
|
||||
"\n",
|
||||
"- \"If you find yourself making the same customizations on several projects, you might want to create your own style sheet.\"\n",
|
||||
"\n",
|
||||
"---\n",
|
||||
"\n",
|
||||
"{% include links.md %}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
|
||||
Reference in New Issue
Block a user