{ "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", "- \"Write ADQL queries involving `JOIN` operations.\"\n", "\n", "keypoints:\n", "\n", "- \"Use `JOIN` operations to combine data from multiple tables in a database, 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": {}, "source": [ "# 5. Joining Tables\n", "\n", "This is the fifth in a series of notebooks related to astronomy data.\n", "\n", "As a continuing example, we will replicate part of the analysis in a recent paper, \"[Off the beaten path: Gaia reveals GD-1 stars outside of the main stream](https://arxiv.org/abs/1805.00425)\" by Adrian M. Price-Whelan and Ana Bonaca.\n", "\n", "Picking up where we left off, the next step in the analysis is to select candidate stars based on photometry data.\n", "The following figure from the paper is a color-magnitude diagram for the stars selected based on proper motion:\n", "\n", "\n", "\n", "In red is a [stellar isochrone](https://en.wikipedia.org/wiki/Stellar_isochrone), showing where we expect the stars in GD-1 to fall based on the metallicity and age of their original globular cluster. \n", "\n", "By selecting stars in the shaded area, we can further distinguish the main sequence of GD-1 from younger background stars." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Outline\n", "\n", "Here are the steps in this notebook:\n", "\n", "1. We'll reload the candidate stars we identified in the previous notebook.\n", "\n", "2. Then we'll run a query on the Gaia server that uploads the table of candidates and uses a `JOIN` operation to select photometry data for the candidate stars.\n", "\n", "3. We'll write the results to a file for use in the next notebook.\n", "\n", "After completing this lesson, you should be able to\n", "\n", "* Upload a table to the Gaia server.\n", "\n", "* Write ADQL queries involving `JOIN` operations." ] }, { "cell_type": "markdown", "metadata": { "tags": [ "remove-cell" ] }, "source": [ "## Installing libraries\n", "\n", "If you are running this notebook on Colab, you can run the following cell to install the libraries we'll use.\n", "\n", "If you are running this notebook on your own computer, you might have to install these libraries yourself. See the instructions in the preface." ] }, { "cell_type": "code", "execution_count": 28, "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "# If we're running on Colab, install libraries\n", "\n", "import sys\n", "IN_COLAB = 'google.colab' in sys.modules\n", "\n", "if IN_COLAB:\n", " !pip install astroquery" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting photometry data\n", "\n", "The Gaia dataset contains some photometry data, including the variable `bp_rp`, which contains BP-RP color (the difference in mean flux between the BP and RP bands).\n", "We use this variable to select stars with `bp_rp` between -0.75 and 2, which excludes many class M dwarf stars.\n", "\n", "Now, to select stars with the age and metal richness we expect in GD-1, we will use `g-i` color and apparent `g`-band magnitude, which are available from the Pan-STARRS survey." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Conveniently, the Gaia server provides data from Pan-STARRS as a table in the same database we have been using, so we can access it by making ADQL queries.\n", "\n", "In general, choosing a star from the Gaia catalog and finding the corresponding star in the Pan-STARRS catalog is not easy. This kind of cross matching is not always possible, because a star might appear in one catalog and not the other. And even when both stars are present, there might not be a clear one-to-one relationship between stars in the two catalogs.\n", "\n", "Fortunately, smart people have worked on this problem, and the Gaia database includes cross-matching tables that suggest a best neighbor in the Pan-STARRS catalog for many stars in the Gaia catalog.\n", "\n", "[This document describes the cross matching process](https://gea.esac.esa.int/archive/documentation/GDR2/Catalogue_consolidation/chap_cu9val_cu9val/ssec_cu9xma/sssec_cu9xma_extcat.html). Briefly, it uses a cone search to find possible matches in approximately the right position, then uses attributes like color and magnitude to choose pairs of observations most likely to be the same star." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The best neighbor table\n", "\n", "So the hard part of cross-matching has been done for us. Using the results is a little tricky, but it gives us a chance to learn about one of the most important tools for working with databases: \"joining\" tables.\n", "\n", "In general, a \"join\" is an operation where you match up records from one table with records from another table using as a \"key\" a piece of information that is common to both tables, usually some kind of ID code.\n", "\n", "In this example:\n", "\n", "* Stars in the Gaia dataset are identified by `source_id`.\n", "\n", "* Stars in the Pan-STARRS dataset are identified by `obj_id`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For each candidate star we have selected so far, we have the `source_id`; the goal is to find the `obj_id` for the same star (we hope) in the Pan-STARRS catalog.\n", "\n", "To do that we will:\n", "\n", "1. Use the `JOIN` operator to look up each `source_id` in the `panstarrs1_best_neighbour` table, which contains the `obj_id` of the best match for each star in the Gaia catalog; then\n", "\n", "2. Use the `JOIN` operator again to look up each `obj_id` in the `panstarrs1_original_valid` table, which contains the Pan-STARRS photometry data we want.\n", "\n", "Before we get to the `JOIN` operation, let's explore these tables.\n", "Here's the metadata for `panstarrs1_best_neighbour`." ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Retrieving table 'gaiadr2.panstarrs1_best_neighbour'\n", "Parsing table 'gaiadr2.panstarrs1_best_neighbour'...\n", "Done.\n" ] } ], "source": [ "from astroquery.gaia import Gaia\n", "\n", "meta = Gaia.load_table('gaiadr2.panstarrs1_best_neighbour')" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "TAP Table name: gaiadr2.gaiadr2.panstarrs1_best_neighbour\n", "Description: Pan-STARRS1 BestNeighbour table lists each matched Gaia object with its\n", "best neighbour in the external catalogue.\n", "There are 1 327 157 objects in the filtered version of Pan-STARRS1 used\n", "to compute this cross-match that have too early epochMean.\n", "Num. columns: 7\n" ] } ], "source": [ "print(meta)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And here are the columns." ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "source_id\n", "original_ext_source_id\n", "angular_distance\n", "number_of_neighbours\n", "number_of_mates\n", "best_neighbour_multiplicity\n", "gaia_astrometric_params\n" ] } ], "source": [ "for column in meta.columns:\n", " print(column.name)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here's the [documentation for these variables](https://gea.esac.esa.int/archive/documentation/GDR2/Gaia_archive/chap_datamodel/sec_dm_crossmatches/ssec_dm_panstarrs1_best_neighbour.html) .\n", "\n", "The ones we'll use are:\n", "\n", "* `source_id`, which we will match up with `source_id` in the Gaia table.\n", "\n", "* `number_of_neighbours`, which indicates how many sources in Pan-STARRS are matched with this source in Gaia.\n", "\n", "* `number_of_mates`, which indicates the number of *other* sources in Gaia that are matched with the same source in Pan-STARRS.\n", "\n", "* `original_ext_source_id`, which we will match up with `obj_id` in the Pan-STARRS table.\n", "\n", "Ideally, `number_of_neighbours` should be 1 and `number_of_mates` should be 0; in that case, there is a one-to-one match between the source in Gaia and the corresponding source in Pan-STARRS.\n", "\n", "Here's a query that selects these columns and returns the first 5 rows." ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "query = \"\"\"SELECT \n", "TOP 5\n", "source_id, number_of_neighbours, number_of_mates, original_ext_source_id\n", "FROM gaiadr2.panstarrs1_best_neighbour\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Query finished. [astroquery.utils.tap.core]\n" ] } ], "source": [ "job = Gaia.launch_job_async(query=query)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "Table length=5\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_idnumber_of_neighboursnumber_of_matesoriginal_ext_source_id
int64int32int16int64
67459389724334807041069742925668851205
60304667889559540481069742509325691172
67564880993081696001069742879438541228
67001549947150460161069743055581721207
67570619413032527361069742856540241198
" ], "text/plain": [ "\n", " source_id number_of_neighbours number_of_mates original_ext_source_id\n", " int64 int32 int16 int64 \n", "------------------- -------------------- --------------- ----------------------\n", "6745938972433480704 1 0 69742925668851205\n", "6030466788955954048 1 0 69742509325691172\n", "6756488099308169600 1 0 69742879438541228\n", "6700154994715046016 1 0 69743055581721207\n", "6757061941303252736 1 0 69742856540241198" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The Pan-STARRS table\n", "\n", "Here's the metadata for the table that contains the Pan-STARRS data." ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Retrieving table 'gaiadr2.panstarrs1_original_valid'\n", "Parsing table 'gaiadr2.panstarrs1_original_valid'...\n", "Done.\n" ] } ], "source": [ "meta = Gaia.load_table('gaiadr2.panstarrs1_original_valid')" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "TAP Table name: gaiadr2.gaiadr2.panstarrs1_original_valid\n", "Description: The Panoramic Survey Telescope and Rapid Response System (Pan-STARRS) is\n", "a system for wide-field astronomical imaging developed and operated by\n", "the Institute for Astronomy at the University of Hawaii. Pan-STARRS1\n", "(PS1) is the first part of Pan-STARRS to be completed and is the basis\n", "for Data Release 1 (DR1). The PS1 survey used a 1.8 meter telescope and\n", "its 1.4 Gigapixel camera to image the sky in five broadband filters (g,\n", "r, i, z, y).\n", "\n", "The current table contains a filtered subsample of the 10 723 304 629\n", "entries listed in the original ObjectThin table.\n", "We used only ObjectThin and MeanObject tables to extract\n", "panstarrs1OriginalValid table, this means that objects detected only in\n", "stack images are not included here. The main reason for us to avoid the\n", "use of objects detected in stack images is that their astrometry is not\n", "as good as the mean objects astrometry: “The stack positions (raStack,\n", "decStack) have considerably larger systematic astrometric errors than\n", "the mean epoch positions (raMean, decMean).” The astrometry for the\n", "MeanObject positions uses Gaia DR1 as a reference catalog, while the\n", "stack positions use 2MASS as a reference catalog.\n", "\n", "In details, we filtered out all objects where:\n", "\n", "- nDetections = 1\n", "\n", "- no good quality data in Pan-STARRS, objInfoFlag 33554432 not set\n", "\n", "- mean astrometry could not be measured, objInfoFlag 524288 set\n", "\n", "- stack position used for mean astrometry, objInfoFlag 1048576 set\n", "\n", "- error on all magnitudes equal to 0 or to -999;\n", "\n", "- all magnitudes set to -999;\n", "\n", "- error on RA or DEC greater than 1 arcsec.\n", "\n", "The number of objects in panstarrs1OriginalValid is 2 264 263 282.\n", "\n", "The panstarrs1OriginalValid table contains only a subset of the columns\n", "available in the combined ObjectThin and MeanObject tables. A\n", "description of the original ObjectThin and MeanObjects tables can be\n", "found at:\n", "https://outerspace.stsci.edu/display/PANSTARRS/PS1+Database+object+and+detection+tables\n", "\n", "Download:\n", "http://mastweb.stsci.edu/ps1casjobs/home.aspx\n", "Documentation:\n", "https://outerspace.stsci.edu/display/PANSTARRS\n", "http://pswww.ifa.hawaii.edu/pswww/\n", "References:\n", "The Pan-STARRS1 Surveys, Chambers, K.C., et al. 2016, arXiv:1612.05560\n", "Pan-STARRS Data Processing System, Magnier, E. A., et al. 2016,\n", "arXiv:1612.05240\n", "Pan-STARRS Pixel Processing: Detrending, Warping, Stacking, Waters, C.\n", "Z., et al. 2016, arXiv:1612.05245\n", "Pan-STARRS Pixel Analysis: Source Detection and Characterization,\n", "Magnier, E. A., et al. 2016, arXiv:1612.05244\n", "Pan-STARRS Photometric and Astrometric Calibration, Magnier, E. A., et\n", "al. 2016, arXiv:1612.05242\n", "The Pan-STARRS1 Database and Data Products, Flewelling, H. A., et al.\n", "2016, arXiv:1612.05243\n", "\n", "Catalogue curator:\n", "SSDC - ASI Space Science Data Center\n", "https://www.ssdc.asi.it/\n", "Num. columns: 26\n" ] } ], "source": [ "print(meta)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And here are the columns." ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "obj_name\n", "obj_id\n", "ra\n", "dec\n", "ra_error\n", "dec_error\n", "epoch_mean\n", "g_mean_psf_mag\n", "g_mean_psf_mag_error\n", "g_flags\n", "r_mean_psf_mag\n", "r_mean_psf_mag_error\n", "r_flags\n", "i_mean_psf_mag\n", "i_mean_psf_mag_error\n", "i_flags\n", "z_mean_psf_mag\n", "z_mean_psf_mag_error\n", "z_flags\n", "y_mean_psf_mag\n", "y_mean_psf_mag_error\n", "y_flags\n", "n_detections\n", "zone_id\n", "obj_info_flag\n", "quality_flag\n" ] } ], "source": [ "for column in meta.columns:\n", " print(column.name)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here's the [documentation for these variables]() .\n", "\n", "The ones we'll use are:\n", "\n", "* `obj_id`, which we will match up with `original_ext_source_id` in the best neighbor table.\n", "\n", "* `g_mean_psf_mag`, which contains mean magnitude from the `i` filter.\n", "\n", "* `i_mean_psf_mag`, which contains mean magnitude from the `i` filter.\n", "\n", "Here's a query that selects these variables and returns the first 5 rows." ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [], "source": [ "query = \"\"\"SELECT \n", "TOP 5\n", "obj_id, g_mean_psf_mag, i_mean_psf_mag \n", "FROM gaiadr2.panstarrs1_original_valid\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Query finished. [astroquery.utils.tap.core]\n" ] } ], "source": [ "job = Gaia.launch_job_async(query=query)" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "Table length=5\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
obj_idg_mean_psf_magi_mean_psf_mag
mag
int64float64float64
67130655389101425--20.3516006469727
67553305590067819--19.779899597168
67551423248967849--19.8889007568359
67132026238911331--20.9062995910645
67553513677687787--21.2831001281738
" ], "text/plain": [ "\n", " obj_id g_mean_psf_mag i_mean_psf_mag \n", " mag \n", " int64 float64 float64 \n", "----------------- -------------- ----------------\n", "67130655389101425 -- 20.3516006469727\n", "67553305590067819 -- 19.779899597168\n", "67551423248967849 -- 19.8889007568359\n", "67132026238911331 -- 20.9062995910645\n", "67553513677687787 -- 21.2831001281738" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following figure shows how these tables are related.\n", "\n", "* The orange circles and arrows represent the first `JOIN` operation, which takes each `source_id` in the Gaia table and finds the same value of `source_id` in the best neighbor table.\n", "\n", "* The blue circles and arrows represent the second `JOIN` operation, which takes each `original_ext_source_id` in the Gaia table and finds the same value of `obj_id` in the best neighbor table.\n", "\n", "There's no guarantee that the corresponding rows of these tables are in the same order, so the `JOIN` operation involves some searching.\n", "However, ADQL/SQL databases are implemented in a way that makes this kind of source efficient.\n", "If you are curious, you can [read more about it](https://chartio.com/learn/databases/how-does-indexing-work/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Joining tables\n", "\n", "Now let's get to the details of performing a `JOIN` operation.\n", "As a starting place, let's go all the way back to the cone search from Lesson 2." ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [], "source": [ "query_cone = \"\"\"SELECT \n", "TOP 10 \n", "source_id\n", "FROM gaiadr2.gaia_source\n", "WHERE 1=CONTAINS(\n", " POINT(ra, dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And let's run it, to make sure we have a working query to build on." ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Query finished. [astroquery.utils.tap.core]\n" ] } ], "source": [ "from astroquery.gaia import Gaia\n", "\n", "job = Gaia.launch_job_async(query=query_cone)" ] }, { "cell_type": "code", "execution_count": 43, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "Table length=10\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_id
int64
3322773965056065536
3322773758899157120
3322774068134271104
3322773930696320512
3322774377374425728
3322773724537891456
3322773724537891328
3322773930696321792
3322773724537890944
3322773930696322176
" ], "text/plain": [ "\n", " source_id \n", " int64 \n", "-------------------\n", "3322773965056065536\n", "3322773758899157120\n", "3322774068134271104\n", "3322773930696320512\n", "3322774377374425728\n", "3322773724537891456\n", "3322773724537891328\n", "3322773930696321792\n", "3322773724537890944\n", "3322773930696322176" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can start adding features.\n", "First, let's replace `source_id` with a format specifier, `columns`: " ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [], "source": [ "query_base = \"\"\"SELECT \n", "{columns}\n", "FROM gaiadr2.gaia_source\n", "WHERE 1=CONTAINS(\n", " POINT(ra, dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here are the columns we want from the Gaia table, again. " ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SELECT \n", "source_id, ra, dec, pmra, pmdec\n", "FROM gaiadr2.gaia_source\n", "WHERE 1=CONTAINS(\n", " POINT(ra, dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\n" ] } ], "source": [ "columns = 'source_id, ra, dec, pmra, pmdec'\n", "\n", "query = query_base.format(columns=columns)\n", "print(query)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And let's run the query again." ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Query finished. [astroquery.utils.tap.core]\n" ] } ], "source": [ "job = Gaia.launch_job_async(query=query)" ] }, { "cell_type": "code", "execution_count": 47, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "Table length=594\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_idradecpmrapmdec
degdegmas / yrmas / yr
int64float64float64float64float64
332277396505606553688.781780201833757.3349365305831410.2980633722108194-2.5057036964736907
332277375889915712088.832270571445857.325577341429926----
332277406813427110488.82060921880337.353158142762173-1.1065462654445488-1.5260889445858044
332277393069632051288.808433392903487.3348531622999282.6074384482375215-0.9292104395445717
332277437737442572888.868061081822657.3712877312759393.9555477866915383-3.8676624830902435
332277372453789145688.813086028134347.3248857449205951.34995462741039-33.078133430952086
332277372453789132888.815703292087437.32230197723248551.93899884989518450.3110526931576576
332277393069632179288.80507367703317.3323714722065832.2640148344763111.0772755505138008
332277372453789094488.812416515405337.327864052479726-0.36003627434304625-6.393939291541333
...............
332296211898335603288.761096377229497.380564308268047----
332296352773258598488.788137017048237.4566968897595241.1363354614104264-2.46251296961979
332296177538596902488.797232158623697.3597565529065352.121021366548921-6.605711792572964
332296208462531251288.782867563138687.384598632215225-0.093507178109964871.3495903680571226
332296293932269260888.732893578186797.407688975612043-0.110029347835697041.002126813991455
332296376825076057688.75924440359617.469624531882018----
332296345901311180888.803489318428457.4386999012048710.800833828337078-3.3780655466364626
332296335593562636888.755285075860587.427795463027667----
332296328721614988888.76581649321957.4157263708865572.3743092647634034-0.5046963243400879
332296201590414387288.747408222716437.387057037713974-0.72011785332501120.5565841272341593
" ], "text/plain": [ "\n", " source_id ra ... pmdec \n", " deg ... mas / yr \n", " int64 float64 ... float64 \n", "------------------- ----------------- ... -------------------\n", "3322773965056065536 88.78178020183375 ... -2.5057036964736907\n", "3322773758899157120 88.83227057144585 ... --\n", "3322774068134271104 88.8206092188033 ... -1.5260889445858044\n", "3322773930696320512 88.80843339290348 ... -0.9292104395445717\n", "3322774377374425728 88.86806108182265 ... -3.8676624830902435\n", "3322773724537891456 88.81308602813434 ... -33.078133430952086\n", "3322773724537891328 88.81570329208743 ... 0.3110526931576576\n", "3322773930696321792 88.8050736770331 ... 1.0772755505138008\n", "3322773724537890944 88.81241651540533 ... -6.393939291541333\n", " ... ... ... ...\n", "3322962118983356032 88.76109637722949 ... --\n", "3322963527732585984 88.78813701704823 ... -2.46251296961979\n", "3322961775385969024 88.79723215862369 ... -6.605711792572964\n", "3322962084625312512 88.78286756313868 ... 1.3495903680571226\n", "3322962939322692608 88.73289357818679 ... 1.002126813991455\n", "3322963768250760576 88.7592444035961 ... --\n", "3322963459013111808 88.80348931842845 ... -3.3780655466364626\n", "3322963355935626368 88.75528507586058 ... --\n", "3322963287216149888 88.7658164932195 ... -0.5046963243400879\n", "3322962015904143872 88.74740822271643 ... 0.5565841272341593" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Adding the best neighbor table\n", "\n", "Now we're ready for the first join.\n", "The join operation requires two clauses:\n", "\n", "* `JOIN` specifies the name of the table we want to join with, and\n", "\n", "* `ON` specifies how we'll match up rows between the tables.\n", "\n", "In this example, we join with `gaiadr2.panstarrs1_best_neighbour AS best`, which means we can refer to the best neighbor table with the abbreviated name `best`.\n", "\n", "And the `ON` clause indicates that we'll match up the `source_id` column from the Gaia table with the `source_id` column from the best neighbor table. " ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "query_base = \"\"\"SELECT \n", "{columns}\n", "FROM gaiadr2.gaia_source AS gaia\n", "JOIN gaiadr2.panstarrs1_best_neighbour AS best\n", " ON gaia.source_id = best.source_id\n", "WHERE 1=CONTAINS(\n", " POINT(gaia.ra, gaia.dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**SQL detail:** In this example, the `ON` column has the same name in both tables, so we could replace the `ON` clause with a simpler [`USING` clause](https://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljusing.html):\n", "\n", "```\n", "USING(source_id)\n", "```\n", "\n", "Now that there's more than one table involved, we can't use simple column names any more; we have to use **qualified column names**.\n", "In other words, we have to specify which table each column is in.\n", "Here's the complete query, including the columns we want from the Gaia and best neighbor tables." ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SELECT \n", "gaia.source_id, gaia.ra, gaia.dec, gaia.pmra, gaia.pmdec, best.best_neighbour_multiplicity, best.number_of_mates\n", "FROM gaiadr2.gaia_source AS gaia\n", "JOIN gaiadr2.panstarrs1_best_neighbour AS best\n", " ON gaia.source_id = best.source_id\n", "WHERE 1=CONTAINS(\n", " POINT(gaia.ra, gaia.dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\n" ] } ], "source": [ "column_list = ['gaia.source_id',\n", " 'gaia.ra',\n", " 'gaia.dec',\n", " 'gaia.pmra',\n", " 'gaia.pmdec',\n", " 'best.best_neighbour_multiplicity',\n", " 'best.number_of_mates',\n", " ]\n", "columns = ', '.join(column_list)\n", "\n", "query = query_base.format(columns=columns)\n", "print(query)" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Query finished. [astroquery.utils.tap.core]\n" ] } ], "source": [ "job = Gaia.launch_job_async(query=query)" ] }, { "cell_type": "code", "execution_count": 51, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "Table length=490\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_idradecpmrapmdecbest_neighbour_multiplicitynumber_of_mates
degdegmas / yrmas / yr
int64float64float64float64float64int16int16
332277396505606553688.781780201833757.3349365305831410.2980633722108194-2.505703696473690710
332277406813427110488.82060921880337.353158142762173-1.1065462654445488-1.526088944585804410
332277393069632051288.808433392903487.3348531622999282.6074384482375215-0.929210439544571710
332277437737442572888.868061081822657.3712877312759393.9555477866915383-3.867662483090243510
332277372453789145688.813086028134347.3248857449205951.34995462741039-33.07813343095208610
332277372453789132888.815703292087437.32230197723248551.93899884989518450.311052693157657610
332277393069632179288.80507367703317.3323714722065832.2640148344763111.077275550513800810
332277372453789094488.812416515405337.327864052479726-0.36003627434304625-6.39393929154133310
332277393069632217688.801286825748247.334292036448643----10
.....................
332296235950148108888.850377229082717.4021627170535842.058216493648542-2.24925532255858410
332296239386122854488.821082349761557.4044425496203-0.916760881643629-1.111331905386144110
332295583115125491288.746203477995087.3427286191458550.1559833902071379-1.75059845595973410
332296211898335603288.761096377229497.380564308268047----10
332296352773258598488.788137017048237.4566968897595241.1363354614104264-2.4625129696197910
332296177538596902488.797232158623697.3597565529065352.121021366548921-6.60571179257296410
332296208462531251288.782867563138687.384598632215225-0.093507178109964871.349590368057122610
332296293932269260888.732893578186797.407688975612043-0.110029347835697041.00212681399145510
332296345901311180888.803489318428457.4386999012048710.800833828337078-3.378065546636462610
332296201590414387288.747408222716437.387057037713974-0.72011785332501120.556584127234159310
" ], "text/plain": [ "\n", " source_id ra ... number_of_mates\n", " deg ... \n", " int64 float64 ... int16 \n", "------------------- ----------------- ... ---------------\n", "3322773965056065536 88.78178020183375 ... 0\n", "3322774068134271104 88.8206092188033 ... 0\n", "3322773930696320512 88.80843339290348 ... 0\n", "3322774377374425728 88.86806108182265 ... 0\n", "3322773724537891456 88.81308602813434 ... 0\n", "3322773724537891328 88.81570329208743 ... 0\n", "3322773930696321792 88.8050736770331 ... 0\n", "3322773724537890944 88.81241651540533 ... 0\n", "3322773930696322176 88.80128682574824 ... 0\n", " ... ... ... ...\n", "3322962359501481088 88.85037722908271 ... 0\n", "3322962393861228544 88.82108234976155 ... 0\n", "3322955831151254912 88.74620347799508 ... 0\n", "3322962118983356032 88.76109637722949 ... 0\n", "3322963527732585984 88.78813701704823 ... 0\n", "3322961775385969024 88.79723215862369 ... 0\n", "3322962084625312512 88.78286756313868 ... 0\n", "3322962939322692608 88.73289357818679 ... 0\n", "3322963459013111808 88.80348931842845 ... 0\n", "3322962015904143872 88.74740822271643 ... 0" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Notice that this result has fewer rows than the previous result.\n", "That's because there are sources in the Gaia table with no corresponding source in the Pan-STARRS table.\n", "\n", "By default, the result of the join only includes rows where the same `source_id` appears in both tables.\n", "This default is called an \"inner\" join because the results include only the intersection of the two tables.\n", "[You can read about the other kinds of join here](https://www.geeksforgeeks.org/sql-join-set-1-inner-left-right-and-full-joins/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Adding the Pan-STARRS table\n", "\n", "### Exercise\n", "\n", "Now we're ready to bring in the Pan-STARRS table. Starting with the previous query, add a second `JOIN` clause that joins with `gaiadr2.panstarrs1_original_valid`, gives it the abbreviated name `ps`, and matches `original_ext_source_id` from the best neighbor table with `obj_id` from the Pan-STARRS table.\n", "\n", "Add `g_mean_psf_mag` and `i_mean_psf_mag` to the column list, and run the query.\n", "The result should contain 490 rows and 9 columns." ] }, { "cell_type": "code", "execution_count": 52, "metadata": { "tags": [ "hide-cell" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SELECT \n", "gaia.source_id, gaia.ra, gaia.dec, gaia.pmra, gaia.pmdec, best.best_neighbour_multiplicity, best.number_of_mates, ps.g_mean_psf_mag, ps.i_mean_psf_mag\n", "FROM gaiadr2.gaia_source as gaia\n", "JOIN gaiadr2.panstarrs1_best_neighbour as best\n", " ON gaia.source_id = best.source_id\n", "JOIN gaiadr2.panstarrs1_original_valid as ps\n", " ON best.original_ext_source_id = ps.obj_id\n", "WHERE 1=CONTAINS(\n", " POINT(gaia.ra, gaia.dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\n", "INFO: Query finished. [astroquery.utils.tap.core]\n" ] }, { "data": { "text/html": [ "Table length=490\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_idradecpmrapmdecbest_neighbour_multiplicitynumber_of_matesg_mean_psf_magi_mean_psf_mag
degdegmas / yrmas / yrmag
int64float64float64float64float64int16int16float64float64
332277396505606553688.781780201833757.3349365305831410.2980633722108194-2.50570369647369071019.943199157714817.4221992492676
332277406813427110488.82060921880337.353158142762173-1.1065462654445488-1.52608894458580441018.621200561523416.6007995605469
332277393069632051288.808433392903487.3348531622999282.6074384482375215-0.929210439544571710--20.2203998565674
332277437737442572888.868061081822657.3712877312759393.9555477866915383-3.86766248309024351018.067600250244116.9762001037598
332277372453789145688.813086028134347.3248857449205951.34995462741039-33.0781334309520861020.190700531005917.8700008392334
332277372453789132888.815703292087437.32230197723248551.93899884989518450.31105269315765761022.630800247192419.6004009246826
332277393069632179288.80507367703317.3323714722065832.2640148344763111.07727555051380081021.211999893188518.3528003692627
332277372453789094488.812416515405337.327864052479726-0.36003627434304625-6.3939392915413331020.809400558471718.1343002319336
332277393069632217688.801286825748247.334292036448643----1019.7306003570557--
...........................
332296235950148108888.850377229082717.4021627170535842.058216493648542-2.2492553225585841017.403499603271515.9040002822876
332296239386122854488.821082349761557.4044425496203-0.916760881643629-1.111331905386144110----
332295583115125491288.746203477995087.3427286191458550.1559833902071379-1.7505984559597341018.496099472045917.3892993927002
332296211898335603288.761096377229497.380564308268047----1018.064399719238316.7395000457764
332296352773258598488.788137017048237.4566968897595241.1363354614104264-2.462512969619791017.803499221801816.1214008331299
332296177538596902488.797232158623697.3597565529065352.121021366548921-6.6057117925729641018.207000732421915.9947996139526
332296208462531251288.782867563138687.384598632215225-0.093507178109964871.34959036805712261016.797899246215815.1180000305176
332296293932269260888.732893578186797.407688975612043-0.110029347835697041.0021268139914551017.1863002777116.3645992279053
332296345901311180888.803489318428457.4386999012048710.800833828337078-3.378065546636462610--16.294900894165
332296201590414387288.747408222716437.387057037713974-0.72011785332501120.55658412723415931018.470699310302716.8038005828857
" ], "text/plain": [ "\n", " source_id ra ... g_mean_psf_mag i_mean_psf_mag \n", " deg ... mag \n", " int64 float64 ... float64 float64 \n", "------------------- ----------------- ... ---------------- ----------------\n", "3322773965056065536 88.78178020183375 ... 19.9431991577148 17.4221992492676\n", "3322774068134271104 88.8206092188033 ... 18.6212005615234 16.6007995605469\n", "3322773930696320512 88.80843339290348 ... -- 20.2203998565674\n", "3322774377374425728 88.86806108182265 ... 18.0676002502441 16.9762001037598\n", "3322773724537891456 88.81308602813434 ... 20.1907005310059 17.8700008392334\n", "3322773724537891328 88.81570329208743 ... 22.6308002471924 19.6004009246826\n", "3322773930696321792 88.8050736770331 ... 21.2119998931885 18.3528003692627\n", "3322773724537890944 88.81241651540533 ... 20.8094005584717 18.1343002319336\n", "3322773930696322176 88.80128682574824 ... 19.7306003570557 --\n", " ... ... ... ... ...\n", "3322962359501481088 88.85037722908271 ... 17.4034996032715 15.9040002822876\n", "3322962393861228544 88.82108234976155 ... -- --\n", "3322955831151254912 88.74620347799508 ... 18.4960994720459 17.3892993927002\n", "3322962118983356032 88.76109637722949 ... 18.0643997192383 16.7395000457764\n", "3322963527732585984 88.78813701704823 ... 17.8034992218018 16.1214008331299\n", "3322961775385969024 88.79723215862369 ... 18.2070007324219 15.9947996139526\n", "3322962084625312512 88.78286756313868 ... 16.7978992462158 15.1180000305176\n", "3322962939322692608 88.73289357818679 ... 17.18630027771 16.3645992279053\n", "3322963459013111808 88.80348931842845 ... -- 16.294900894165\n", "3322962015904143872 88.74740822271643 ... 18.4706993103027 16.8038005828857" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Solution\n", "\n", "query_base = \"\"\"SELECT \n", "{columns}\n", "FROM gaiadr2.gaia_source as gaia\n", "JOIN gaiadr2.panstarrs1_best_neighbour as best\n", " ON gaia.source_id = best.source_id\n", "JOIN gaiadr2.panstarrs1_original_valid as ps\n", " ON best.original_ext_source_id = ps.obj_id\n", "WHERE 1=CONTAINS(\n", " POINT(gaia.ra, gaia.dec),\n", " CIRCLE(88.8, 7.4, 0.08333333))\n", "\"\"\"\n", "\n", "column_list = ['gaia.source_id',\n", " 'gaia.ra',\n", " 'gaia.dec',\n", " 'gaia.pmra',\n", " 'gaia.pmdec',\n", " 'best.best_neighbour_multiplicity',\n", " 'best.number_of_mates',\n", " 'ps.g_mean_psf_mag',\n", " 'ps.i_mean_psf_mag']\n", "\n", "columns = ', '.join(column_list)\n", "\n", "query = query_base.format(columns=columns)\n", "print(query)\n", "\n", "job = Gaia.launch_job_async(query=query)\n", "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Selecting by coordinates and proper motion\n", "\n", "Now let's bring in the `WHERE` clause from the previous lesson, which selects sources based on parallax, BP-RP color, sky coordinates, and proper motion.\n", "\n", "Here's `query6_base` from the previous lesson." ] }, { "cell_type": "code", "execution_count": 53, "metadata": {}, "outputs": [], "source": [ "query6_base = \"\"\"SELECT \n", "{columns}\n", "FROM gaiadr2.gaia_source\n", "WHERE parallax < 1\n", " AND bp_rp BETWEEN -0.75 AND 2 \n", " AND 1 = CONTAINS(POINT(ra, dec), \n", " POLYGON({point_list}))\n", " AND 1 = CONTAINS(POINT(pmra, pmdec),\n", " POLYGON({pm_point_list}))\n", "\"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's reload the Pandas `Series` that contains `point_list` and `pm_point_list`." ] }, { "cell_type": "code", "execution_count": 54, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "point_list 135.306, 8.39862, 126.51, 13.4449, 163.017, 54...\n", "pm_point_list -4.05037121,-14.75623261, -3.41981085,-14.723...\n", "dtype: object" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "\n", "filename = 'gd1_data.hdf'\n", "point_series = pd.read_hdf(filename, 'point_series')\n", "point_series" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can assemble the query." ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SELECT \n", "source_id, ra, dec, pmra, pmdec\n", "FROM gaiadr2.gaia_source\n", "WHERE parallax < 1\n", " AND bp_rp BETWEEN -0.75 AND 2 \n", " AND 1 = CONTAINS(POINT(ra, dec), \n", " POLYGON(135.306, 8.39862, 126.51, 13.4449, 163.017, 54.2424, 172.933, 46.4726, 135.306, 8.39862))\n", " AND 1 = CONTAINS(POINT(pmra, pmdec),\n", " POLYGON( -4.05037121,-14.75623261, -3.41981085,-14.72365546, -3.03521988,-14.44357135, -2.26847919,-13.7140236 , -2.61172203,-13.24797471, -2.73471401,-13.09054471, -3.19923146,-12.5942653 , -3.34082546,-12.47611926, -5.67489413,-11.16083338, -5.95159272,-11.10547884, -6.42394023,-11.05981295, -7.09631023,-11.95187806, -7.30641519,-12.24559977, -7.04016696,-12.88580702, -6.00347705,-13.75912098, -4.42442296,-14.74641176))\n", "\n" ] } ], "source": [ "columns = 'source_id, ra, dec, pmra, pmdec'\n", "\n", "query6 = query6_base.format(columns=columns,\n", " point_list=point_series['point_list'],\n", " pm_point_list=point_series['pm_point_list'])\n", "\n", "print(query6)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Again, let's run it to make sure we are starting with a working query." ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "INFO: Query finished. [astroquery.utils.tap.core]\n" ] } ], "source": [ "job = Gaia.launch_job_async(query=query6)" ] }, { "cell_type": "code", "execution_count": 57, "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/html": [ "Table length=7345\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_idradecpmrapmdec
degdegmas / yrmas / yr
int64float64float64float64float64
635559124339440000137.5867169164674519.1965441084838-3.770521900009566-12.490481778113859
635860218726658176138.518706521717319.09233926905897-5.941679495793577-11.346409129876392
635674126383965568138.842874102638619.031798198627634-3.8970011609340207-12.702779525389634
635535454774983040137.837751825543618.864006786112604-4.335040664412791-14.492308604905652
635497276810313600138.044516021375919.00947118796605-7.1729306406216615-12.291499169815987
635614168640132864139.5921974814583618.807955539071433-3.309602916796381-13.708904908478631
635821843194387840139.8809403481508619.62185456718988-6.544201177153814-12.55978220563274
635551706931167104138.0466558603819219.248909662830798-6.224595114220405-12.224246333795001
635518889086133376137.237422920783718.7428630711791-3.3186800714801046-12.710314902969365
...............
612282738058264960134.044576818923518.11915820167003-2.5972485319419127-13.651740929272187
612485911486166656134.9658276904706319.309965857307247-4.519325315774155-11.998725329569156
612386332668697600135.4570104832309318.63266345155342-5.07684899854408-12.436641304786672
612296172717818624133.8006028696066818.08186533343457-6.112792578821885-12.50750861370402
612250375480101760134.6475471246677418.122419425065015-2.8969262278467127-14.061676353845487
612394926899159168135.5199706001384418.817675531233004-3.9968965218753763-13.526821099431533
612288854091187712134.0797073348935818.15424015818678-5.96977151283562-11.162471664228455
612428870024913152134.838424285329718.758253070693225-4.0022333299353825-14.247379430659198
612256418500423168134.9075297273992418.280596648172743-6.109836304219565-12.145212331165776
612429144902815104134.7729397950954318.73628415871413-5.257085979310591-13.962312685889454
" ], "text/plain": [ "\n", " source_id ra ... pmdec \n", " deg ... mas / yr \n", " int64 float64 ... float64 \n", "------------------ ------------------ ... -------------------\n", "635559124339440000 137.58671691646745 ... -12.490481778113859\n", "635860218726658176 138.5187065217173 ... -11.346409129876392\n", "635674126383965568 138.8428741026386 ... -12.702779525389634\n", "635535454774983040 137.8377518255436 ... -14.492308604905652\n", "635497276810313600 138.0445160213759 ... -12.291499169815987\n", "635614168640132864 139.59219748145836 ... -13.708904908478631\n", "635821843194387840 139.88094034815086 ... -12.55978220563274\n", "635551706931167104 138.04665586038192 ... -12.224246333795001\n", "635518889086133376 137.2374229207837 ... -12.710314902969365\n", " ... ... ... ...\n", "612282738058264960 134.0445768189235 ... -13.651740929272187\n", "612485911486166656 134.96582769047063 ... -11.998725329569156\n", "612386332668697600 135.45701048323093 ... -12.436641304786672\n", "612296172717818624 133.80060286960668 ... -12.50750861370402\n", "612250375480101760 134.64754712466774 ... -14.061676353845487\n", "612394926899159168 135.51997060013844 ... -13.526821099431533\n", "612288854091187712 134.07970733489358 ... -11.162471664228455\n", "612428870024913152 134.8384242853297 ... -14.247379430659198\n", "612256418500423168 134.90752972739924 ... -12.145212331165776\n", "612429144902815104 134.77293979509543 ... -13.962312685889454" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise\n", "\n", "Create a new query base called `query7_base` that combines the `WHERE` clauses from the previous query with the `JOIN` clauses for the best neighbor and Pan-STARRS tables.\n", "Format the query base using the column names in `column_list`, and call the result `query7`.\n", "\n", "Hint: Make sure you use qualified column names everywhere!\n", "\n", "Run your query and download the results. The table you get should have 3725 rows and 9 columns." ] }, { "cell_type": "code", "execution_count": 58, "metadata": { "tags": [ "hide-cell" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "SELECT \n", "gaia.source_id, gaia.ra, gaia.dec, gaia.pmra, gaia.pmdec, best.best_neighbour_multiplicity, best.number_of_mates, ps.g_mean_psf_mag, ps.i_mean_psf_mag\n", "FROM gaiadr2.gaia_source as gaia\n", "JOIN gaiadr2.panstarrs1_best_neighbour as best\n", " ON gaia.source_id = best.source_id\n", "JOIN gaiadr2.panstarrs1_original_valid as ps\n", " ON best.original_ext_source_id = ps.obj_id\n", "WHERE parallax < 1\n", " AND bp_rp BETWEEN -0.75 AND 2 \n", " AND 1 = CONTAINS(POINT(gaia.ra, gaia.dec), \n", " POLYGON(135.306, 8.39862, 126.51, 13.4449, 163.017, 54.2424, 172.933, 46.4726, 135.306, 8.39862))\n", " AND 1 = CONTAINS(POINT(gaia.pmra, gaia.pmdec),\n", " POLYGON( -4.05037121,-14.75623261, -3.41981085,-14.72365546, -3.03521988,-14.44357135, -2.26847919,-13.7140236 , -2.61172203,-13.24797471, -2.73471401,-13.09054471, -3.19923146,-12.5942653 , -3.34082546,-12.47611926, -5.67489413,-11.16083338, -5.95159272,-11.10547884, -6.42394023,-11.05981295, -7.09631023,-11.95187806, -7.30641519,-12.24559977, -7.04016696,-12.88580702, -6.00347705,-13.75912098, -4.42442296,-14.74641176))\n", "\n", "INFO: Query finished. [astroquery.utils.tap.core]\n" ] }, { "data": { "text/html": [ "Table length=3725\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
source_idradecpmrapmdecbest_neighbour_multiplicitynumber_of_matesg_mean_psf_magi_mean_psf_mag
degdegmas / yrmas / yrmag
int64float64float64float64float64int16int16float64float64
635860218726658176138.518706521717319.09233926905897-5.941679495793577-11.3464091298763921017.897800445556617.5174007415771
635674126383965568138.842874102638619.031798198627634-3.8970011609340207-12.7027795253896341019.287300109863317.6781005859375
635535454774983040137.837751825543618.864006786112604-4.335040664412791-14.4923086049056521016.923799514770516.478099822998
635497276810313600138.044516021375919.00947118796605-7.1729306406216615-12.2914991698159871019.924200057983418.3339996337891
635614168640132864139.5921974814583618.807955539071433-3.309602916796381-13.7089049084786311016.151599884033214.6662998199463
635598607974369792139.2092002308950818.624132868942702-6.124445176881091-12.8338240271006111016.522399902343816.1375007629395
635737661835496576139.9332755247393419.167962454651423-7.119403303682826-12.6879474976337931014.503299713134813.9849004745483
635850945892748672139.8654288847211520.011312663154804-3.786655365804428-14.284156007182061016.517499923706116.0450000762939
635600532119713664139.2286994961681618.685939084485494-3.9742788217925122-12.3424266233842451020.450599670410219.5177001953125
...........................
612241781249124608134.375583506519418.129179169751275-2.831807894848964-13.9021185736135971020.234399795532218.6518001556396
612332147361443072134.1458472136365318.45685585044513-6.234287981021865-11.5004641956950721021.384899139404320.3076000213623
612426744016802432134.6852280506107618.77090626983678-3.7691372464459554-12.8891674931188621017.828100204467817.4281005859375
612331739340341760134.1217619690225418.42768872157865-3.9894012386388735-12.605044105074411021.865699768066419.5223007202148
612282738058264960134.044576818923518.11915820167003-2.5972485319419127-13.6517409292721871022.515199661254919.9743995666504
612386332668697600135.4570104832309318.63266345155342-5.07684899854408-12.4366413047866721019.379299163818417.9923000335693
612296172717818624133.8006028696066818.08186533343457-6.112792578821885-12.507508613704021017.494400024414116.926700592041
612250375480101760134.6475471246677418.122419425065015-2.8969262278467127-14.0616763538454871015.333000183105514.6280002593994
612394926899159168135.5199706001384418.817675531233004-3.9968965218753763-13.5268210994315331016.441400527954115.8212003707886
612256418500423168134.9075297273992418.280596648172743-6.109836304219565-12.1452123311657761020.871599197387719.9612007141113
" ], "text/plain": [ "\n", " source_id ra ... g_mean_psf_mag i_mean_psf_mag \n", " deg ... mag \n", " int64 float64 ... float64 float64 \n", "------------------ ------------------ ... ---------------- ----------------\n", "635860218726658176 138.5187065217173 ... 17.8978004455566 17.5174007415771\n", "635674126383965568 138.8428741026386 ... 19.2873001098633 17.6781005859375\n", "635535454774983040 137.8377518255436 ... 16.9237995147705 16.478099822998\n", "635497276810313600 138.0445160213759 ... 19.9242000579834 18.3339996337891\n", "635614168640132864 139.59219748145836 ... 16.1515998840332 14.6662998199463\n", "635598607974369792 139.20920023089508 ... 16.5223999023438 16.1375007629395\n", "635737661835496576 139.93327552473934 ... 14.5032997131348 13.9849004745483\n", "635850945892748672 139.86542888472115 ... 16.5174999237061 16.0450000762939\n", "635600532119713664 139.22869949616816 ... 20.4505996704102 19.5177001953125\n", " ... ... ... ... ...\n", "612241781249124608 134.3755835065194 ... 20.2343997955322 18.6518001556396\n", "612332147361443072 134.14584721363653 ... 21.3848991394043 20.3076000213623\n", "612426744016802432 134.68522805061076 ... 17.8281002044678 17.4281005859375\n", "612331739340341760 134.12176196902254 ... 21.8656997680664 19.5223007202148\n", "612282738058264960 134.0445768189235 ... 22.5151996612549 19.9743995666504\n", "612386332668697600 135.45701048323093 ... 19.3792991638184 17.9923000335693\n", "612296172717818624 133.80060286960668 ... 17.4944000244141 16.926700592041\n", "612250375480101760 134.64754712466774 ... 15.3330001831055 14.6280002593994\n", "612394926899159168 135.51997060013844 ... 16.4414005279541 15.8212003707886\n", "612256418500423168 134.90752972739924 ... 20.8715991973877 19.9612007141113" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Solution\n", "\n", "query7_base = \"\"\"\n", "SELECT \n", "{columns}\n", "FROM gaiadr2.gaia_source as gaia\n", "JOIN gaiadr2.panstarrs1_best_neighbour as best\n", " ON gaia.source_id = best.source_id\n", "JOIN gaiadr2.panstarrs1_original_valid as ps\n", " ON best.original_ext_source_id = ps.obj_id\n", "WHERE parallax < 1\n", " AND bp_rp BETWEEN -0.75 AND 2 \n", " AND 1 = CONTAINS(POINT(gaia.ra, gaia.dec), \n", " POLYGON({point_list}))\n", " AND 1 = CONTAINS(POINT(gaia.pmra, gaia.pmdec),\n", " POLYGON({pm_point_list}))\n", "\"\"\"\n", "\n", "columns = ', '.join(column_list)\n", "\n", "query7 = query7_base.format(columns=columns,\n", " point_list=point_series['point_list'],\n", " pm_point_list=point_series['pm_point_list'])\n", "print(query7)\n", "\n", "\n", "job = Gaia.launch_job_async(query=query7)\n", "results = job.get_results()\n", "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Checking the match\n", "\n", "To get more information about the matching process, we can inspect `best_neighbour_multiplicity`, which indicates for each star in Gaia how many stars in Pan-STARRS are equally likely matches." ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<MaskedColumn name='best_neighbour_multiplicity' dtype='int16' description='Number of neighbours with same probability as best neighbour' length=3725>\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
1
1
1
1
1
1
1
1
1
1
1
1
...
1
1
1
1
1
1
1
1
1
1
1
1
" ], "text/plain": [ "\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", "...\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1\n", " 1" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results['best_neighbour_multiplicity']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It looks like most of the values are `1`, which is good; that means that for each candidate star we have identified exactly one source in Pan-STARRS that is likely to be the same star.\n", "\n", "To check whether there are any values other than `1`, we can convert this column to a Pandas `Series` and use `describe`, which we saw in in Lesson 3." ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "count 3725.0\n", "mean 1.0\n", "std 0.0\n", "min 1.0\n", "25% 1.0\n", "50% 1.0\n", "75% 1.0\n", "max 1.0\n", "dtype: float64" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "\n", "multiplicity = pd.Series(results['best_neighbour_multiplicity'])\n", "multiplicity.describe()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In fact, `1` is the only value in the `Series`, so every candidate star has a single best match.\n", "\n", "Similarly, `number_of_mates` indicates the number of *other* stars in Gaia that match with the same star in Pan-STARRS." ] }, { "cell_type": "code", "execution_count": 61, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "count 3725.0\n", "mean 0.0\n", "std 0.0\n", "min 0.0\n", "25% 0.0\n", "50% 0.0\n", "75% 0.0\n", "max 0.0\n", "dtype: float64" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mates = pd.Series(results['number_of_mates'])\n", "mates.describe()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All values in this column are `0`, which means that for each match we found in Pan-STARRS, there are no other stars in Gaia that also match. \n", "\n", "**Detail:** The table also contains `number_of_neighbors` which is the number of stars in Pan-STARRS that match in terms of position, before using other criteria to choose the most likely match. But we are more interested in the final match, using both criteria." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Transforming coordinates\n", "\n", "Here's the function we've used to transform the results from ICRS to GD-1 coordinates." ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [], "source": [ "import astropy.units as u\n", "from astropy.coordinates import SkyCoord\n", "from gala.coordinates import GD1Koposov10\n", "from gala.coordinates import reflex_correct\n", "\n", "def make_dataframe(table):\n", " \"\"\"Transform coordinates from ICRS to GD-1 frame.\n", " \n", " table: Astropy Table\n", " \n", " returns: Pandas DataFrame\n", " \"\"\"\n", " skycoord = SkyCoord(\n", " ra=table['ra'], \n", " dec=table['dec'],\n", " pm_ra_cosdec=table['pmra'],\n", " pm_dec=table['pmdec'], \n", " distance=8*u.kpc, \n", " radial_velocity=0*u.km/u.s)\n", "\n", " gd1_frame = GD1Koposov10()\n", " transformed = skycoord.transform_to(gd1_frame)\n", " skycoord_gd1 = reflex_correct(transformed)\n", "\n", " df = table.to_pandas()\n", " df['phi1'] = skycoord_gd1.phi1\n", " df['phi2'] = skycoord_gd1.phi2\n", " df['pm_phi1'] = skycoord_gd1.pm_phi1_cosphi2\n", " df['pm_phi2'] = skycoord_gd1.pm_phi2\n", " return df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now can transform the result from the last query." ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [], "source": [ "candidate_df = make_dataframe(results)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And see how it looks." ] }, { "cell_type": "code", "execution_count": 64, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEJCAYAAACdePCvAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuNCwgaHR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0A/m1h/gXFAigoKCjYpihrAAUFBQXbFEUAFBQUFGxTFAFQUFBQsE1RBEBBQUHBNkURAAUFBQXbFP8/FX9mwh3ud+8AAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt\n", "\n", "x = candidate_df['phi1']\n", "y = candidate_df['phi2']\n", "plt.plot(x, y, 'ko', markersize=0.5, alpha=0.5)\n", "\n", "plt.xlabel('phi1 (degree GD1)')\n", "plt.ylabel('phi2 (degree GD1)');" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The result is similar to what we saw in the previous lesson, except that have fewer stars now, because we did not find photometry data for all of the candidate sources." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Saving the DataFrame\n", "\n", "Let's save this `DataFrame` so we can pick up where we left off without running this query again.\n", "The HDF file should already exist, so we'll add `candidate_df` to it." ] }, { "cell_type": "code", "execution_count": 65, "metadata": {}, "outputs": [], "source": [ "filename = 'gd1_data.hdf'\n", "\n", "candidate_df.to_hdf(filename, 'candidate_df')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use `getsize` to confirm that the file exists and check the size:" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3.5835609436035156" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from os.path import getsize\n", "\n", "MB = 1024 * 1024\n", "getsize(filename) / MB" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Summary\n", "\n", "In this notebook, we used database `JOIN` operations to select photometry data for the stars we've identified as candidates to be in GD-1.\n", "\n", "In the next notebook, we'll use this data for a second round of selection, identifying stars that have photometry data consistent with GD-1.\n", "\n", "But before you go on, you might be interested in another file format, CSV." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## CSV\n", "\n", "Pandas can write a variety of other formats, [which you can read about here](https://pandas.pydata.org/pandas-docs/stable/user_guide/io.html).\n", "We won't cover all of them, but one other important one is [CSV](https://en.wikipedia.org/wiki/Comma-separated_values), which stands for \"comma-separated values\".\n", "\n", "CSV is a plain-text format that can be read and written by pretty much any tool that works with data. In that sense, it is the \"least common denominator\" of data formats.\n", "\n", "However, it has an important limitation: some information about the data gets lost in translation, notably the data types. If you read a CSV file from someone else, you might need some additional information to make sure you are getting it right.\n", "\n", "Also, CSV files tend to be big, and slow to read and write.\n", "\n", "With those caveats, here's how to write one:" ] }, { "cell_type": "code", "execution_count": 67, "metadata": {}, "outputs": [], "source": [ "candidate_df.to_csv('gd1_data.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can check the file size like this:" ] }, { "cell_type": "code", "execution_count": 68, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.7606849670410156" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "getsize('gd1_data.csv') / MB" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can see the first few lines like this:" ] }, { "cell_type": "code", "execution_count": 69, "metadata": {}, "outputs": [], "source": [ "def head(filename, n=3):\n", " \"\"\"Print the first `n` lines of a file.\"\"\"\n", " with open(filename) as fp:\n", " for i in range(n):\n", " print(next(fp))" ] }, { "cell_type": "code", "execution_count": 70, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ ",source_id,ra,dec,pmra,pmdec,best_neighbour_multiplicity,number_of_mates,g_mean_psf_mag,i_mean_psf_mag,phi1,phi2,pm_phi1,pm_phi2\n", "\n", "0,635860218726658176,138.5187065217173,19.09233926905897,-5.941679495793577,-11.346409129876392,1,0,17.8978004455566,17.5174007415771,-59.247329893833296,-2.016078400820631,-7.527126084640531,1.7487794924176672\n", "\n", "1,635674126383965568,138.8428741026386,19.031798198627634,-3.8970011609340207,-12.702779525389634,1,0,19.2873001098633,17.6781005859375,-59.13339098769217,-2.306900745179831,-7.560607655557415,-0.7417999555980248\n", "\n" ] } ], "source": [ "head('gd1_data.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The CSV file contains the names of the columns, but not the data types.\n", "\n", "We can read the CSV file back like this:" ] }, { "cell_type": "code", "execution_count": 71, "metadata": {}, "outputs": [], "source": [ "read_back_csv = pd.read_csv('gd1_data.csv')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's compare the first few rows of `candidate_df` and `read_back_csv`" ] }, { "cell_type": "code", "execution_count": 72, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
source_idradecpmrapmdecbest_neighbour_multiplicitynumber_of_matesg_mean_psf_magi_mean_psf_magphi1phi2pm_phi1pm_phi2
0635860218726658176138.51870719.092339-5.941679-11.3464091017.897817.517401-59.247330-2.016078-7.5271261.748779
1635674126383965568138.84287419.031798-3.897001-12.7027801019.287317.678101-59.133391-2.306901-7.560608-0.741800
2635535454774983040137.83775218.864007-4.335041-14.4923091016.923816.478100-59.785300-1.594569-9.357536-1.218492
\n", "
" ], "text/plain": [ " source_id ra dec pmra pmdec \\\n", "0 635860218726658176 138.518707 19.092339 -5.941679 -11.346409 \n", "1 635674126383965568 138.842874 19.031798 -3.897001 -12.702780 \n", "2 635535454774983040 137.837752 18.864007 -4.335041 -14.492309 \n", "\n", " best_neighbour_multiplicity number_of_mates g_mean_psf_mag \\\n", "0 1 0 17.8978 \n", "1 1 0 19.2873 \n", "2 1 0 16.9238 \n", "\n", " i_mean_psf_mag phi1 phi2 pm_phi1 pm_phi2 \n", "0 17.517401 -59.247330 -2.016078 -7.527126 1.748779 \n", "1 17.678101 -59.133391 -2.306901 -7.560608 -0.741800 \n", "2 16.478100 -59.785300 -1.594569 -9.357536 -1.218492 " ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "candidate_df.head(3)" ] }, { "cell_type": "code", "execution_count": 73, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Unnamed: 0source_idradecpmrapmdecbest_neighbour_multiplicitynumber_of_matesg_mean_psf_magi_mean_psf_magphi1phi2pm_phi1pm_phi2
00635860218726658176138.51870719.092339-5.941679-11.3464091017.897817.517401-59.247330-2.016078-7.5271261.748779
11635674126383965568138.84287419.031798-3.897001-12.7027801019.287317.678101-59.133391-2.306901-7.560608-0.741800
22635535454774983040137.83775218.864007-4.335041-14.4923091016.923816.478100-59.785300-1.594569-9.357536-1.218492
\n", "
" ], "text/plain": [ " Unnamed: 0 source_id ra dec pmra pmdec \\\n", "0 0 635860218726658176 138.518707 19.092339 -5.941679 -11.346409 \n", "1 1 635674126383965568 138.842874 19.031798 -3.897001 -12.702780 \n", "2 2 635535454774983040 137.837752 18.864007 -4.335041 -14.492309 \n", "\n", " best_neighbour_multiplicity number_of_mates g_mean_psf_mag \\\n", "0 1 0 17.8978 \n", "1 1 0 19.2873 \n", "2 1 0 16.9238 \n", "\n", " i_mean_psf_mag phi1 phi2 pm_phi1 pm_phi2 \n", "0 17.517401 -59.247330 -2.016078 -7.527126 1.748779 \n", "1 17.678101 -59.133391 -2.306901 -7.560608 -0.741800 \n", "2 16.478100 -59.785300 -1.594569 -9.357536 -1.218492 " ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "read_back_csv.head(3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Notice that the index in `candidate_df` has become an unnamed column in `read_back_csv`. The Pandas functions for writing and reading CSV files provide options to avoid that problem, but this is an example of the kind of thing that can go wrong with CSV files." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Best practices\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", "* 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." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Tags", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.8" } }, "nbformat": 4, "nbformat_minor": 4 }