|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
5 | | - "id": "02961155", |
| 5 | + "id": "762aaefe", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | 8 | "<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n", |
|
17 | 17 | }, |
18 | 18 | { |
19 | 19 | "cell_type": "markdown", |
20 | | - "id": "d5b3f505", |
| 20 | + "id": "da1f6693", |
21 | 21 | "metadata": {}, |
22 | 22 | "source": [ |
23 | 23 | "### Learning Objectives\n", |
|
32 | 32 | { |
33 | 33 | "cell_type": "code", |
34 | 34 | "execution_count": 1, |
35 | | - "id": "059227f5", |
| 35 | + "id": "8ee0dfea", |
36 | 36 | "metadata": {}, |
37 | 37 | "outputs": [ |
38 | 38 | { |
|
52 | 52 | }, |
53 | 53 | { |
54 | 54 | "cell_type": "markdown", |
55 | | - "id": "b562fc9a", |
| 55 | + "id": "6e7736bf", |
56 | 56 | "metadata": {}, |
57 | 57 | "source": [ |
58 | 58 | "### 1. Import Common Python Libraries\n", |
|
63 | 63 | { |
64 | 64 | "cell_type": "code", |
65 | 65 | "execution_count": 2, |
66 | | - "id": "571db9b6", |
| 66 | + "id": "10073880", |
67 | 67 | "metadata": {}, |
68 | 68 | "outputs": [], |
69 | 69 | "source": [ |
|
75 | 75 | }, |
76 | 76 | { |
77 | 77 | "cell_type": "markdown", |
78 | | - "id": "5804cfca", |
| 78 | + "id": "bd6f5847", |
79 | 79 | "metadata": {}, |
80 | 80 | "source": [ |
81 | 81 | "To access tables, we will use the TAP service in a similar manner to what we showed in the [Intro to DP0 notebook](https://github.com/rubin-dp0/tutorial-notebooks/blob/main/01_Intro_to_DP0_Notebooks.ipynb), and explored further in the [TAP tutorial notebook](https://github.com/rubin-dp0/tutorial-notebooks/blob/main/02_Intermediate_TAP_Query.ipynb). See those notebooks for more details." |
|
84 | 84 | { |
85 | 85 | "cell_type": "code", |
86 | 86 | "execution_count": 3, |
87 | | - "id": "9cd8365c", |
| 87 | + "id": "d92075a0", |
88 | 88 | "metadata": {}, |
89 | 89 | "outputs": [ |
90 | 90 | { |
|
109 | 109 | }, |
110 | 110 | { |
111 | 111 | "cell_type": "markdown", |
112 | | - "id": "0692f75b", |
| 112 | + "id": "2c360ee6", |
113 | 113 | "metadata": {}, |
114 | 114 | "source": [ |
115 | 115 | "### 2. Loading tables with TAP\n", |
|
120 | 120 | { |
121 | 121 | "cell_type": "code", |
122 | 122 | "execution_count": 4, |
123 | | - "id": "951e7454", |
| 123 | + "id": "542205dc", |
124 | 124 | "metadata": {}, |
125 | 125 | "outputs": [ |
126 | 126 | { |
|
175 | 175 | }, |
176 | 176 | { |
177 | 177 | "cell_type": "markdown", |
178 | | - "id": "34671835", |
| 178 | + "id": "fed3c407", |
179 | 179 | "metadata": {}, |
180 | 180 | "source": [ |
181 | 181 | "For our analysis, let's choose the Object table, `dp01_dc2_catalogs.object`, and then we will compare the measurements from this table to the \"truth\" values from `dp01_dc2_catalogs.truth_match`.\n", |
|
186 | 186 | { |
187 | 187 | "cell_type": "code", |
188 | 188 | "execution_count": 5, |
189 | | - "id": "8d8582e7", |
| 189 | + "id": "f8c99854", |
190 | 190 | "metadata": {}, |
191 | 191 | "outputs": [ |
192 | 192 | { |
|
1480 | 1480 | { |
1481 | 1481 | "cell_type": "code", |
1482 | 1482 | "execution_count": 6, |
1483 | | - "id": "d11c682b", |
| 1483 | + "id": "cbf6cd38", |
1484 | 1484 | "metadata": {}, |
1485 | 1485 | "outputs": [ |
1486 | 1486 | { |
|
1558 | 1558 | }, |
1559 | 1559 | { |
1560 | 1560 | "cell_type": "markdown", |
1561 | | - "id": "706be8e0", |
| 1561 | + "id": "548c4deb", |
1562 | 1562 | "metadata": {}, |
1563 | 1563 | "source": [ |
1564 | 1564 | "For this exploration, we will select a small region of sky around a random RA, Dec position. The following two cells read data centered on (RA, Dec) = (62.0, -37.0) degrees, within a radius of 0.1 degrees, for first the Object table, then the Truth-Match table. Note that we are selecting only a subset of the columns seen in the schema above. You can add or remove columns as you wish.\n", |
|
1569 | 1569 | { |
1570 | 1570 | "cell_type": "code", |
1571 | 1571 | "execution_count": 28, |
1572 | | - "id": "01f5a6a1", |
| 1572 | + "id": "31cb6776", |
1573 | 1573 | "metadata": {}, |
1574 | 1574 | "outputs": [ |
1575 | 1575 | { |
|
1600 | 1600 | }, |
1601 | 1601 | { |
1602 | 1602 | "cell_type": "markdown", |
1603 | | - "id": "92bddbf7", |
| 1603 | + "id": "c47251a0", |
1604 | 1604 | "metadata": {}, |
1605 | 1605 | "source": [ |
1606 | 1606 | "Note: the reason for including the timing of the cells' execution will become clear later in this notebook." |
|
1609 | 1609 | { |
1610 | 1610 | "cell_type": "code", |
1611 | 1611 | "execution_count": 29, |
1612 | | - "id": "9a9e1d71", |
| 1612 | + "id": "f301e7bf", |
1613 | 1613 | "metadata": {}, |
1614 | 1614 | "outputs": [ |
1615 | 1615 | { |
|
1641 | 1641 | }, |
1642 | 1642 | { |
1643 | 1643 | "cell_type": "markdown", |
1644 | | - "id": "28f32658", |
| 1644 | + "id": "0d31c06b", |
1645 | 1645 | "metadata": {}, |
1646 | 1646 | "source": [ |
1647 | 1647 | "These tables will be much easier to work with as `pandas` \"dataframes\". The query results have convenient methods that we can use to convert them." |
|
1650 | 1650 | { |
1651 | 1651 | "cell_type": "code", |
1652 | 1652 | "execution_count": 36, |
1653 | | - "id": "e00c223b", |
| 1653 | + "id": "cad26f3e", |
1654 | 1654 | "metadata": {}, |
1655 | 1655 | "outputs": [], |
1656 | 1656 | "source": [ |
|
1660 | 1660 | }, |
1661 | 1661 | { |
1662 | 1662 | "cell_type": "markdown", |
1663 | | - "id": "7959876d", |
| 1663 | + "id": "92a57677", |
1664 | 1664 | "metadata": {}, |
1665 | 1665 | "source": [ |
1666 | 1666 | "### 3. Merge the two tables and compare measurements to truth values\n", |
|
1671 | 1671 | { |
1672 | 1672 | "cell_type": "code", |
1673 | 1673 | "execution_count": 37, |
1674 | | - "id": "968c4de8", |
| 1674 | + "id": "45e26c53", |
1675 | 1675 | "metadata": {}, |
1676 | 1676 | "outputs": [], |
1677 | 1677 | "source": [ |
|
1692 | 1692 | "# suffixes=['_obj', '_truth'])" |
1693 | 1693 | ] |
1694 | 1694 | }, |
1695 | | - { |
1696 | | - "cell_type": "code", |
1697 | | - "execution_count": 50, |
1698 | | - "id": "e0501732", |
1699 | | - "metadata": {}, |
1700 | | - "outputs": [ |
1701 | | - { |
1702 | | - "data": { |
1703 | | - "text/plain": [ |
1704 | | - "14428" |
1705 | | - ] |
1706 | | - }, |
1707 | | - "execution_count": 50, |
1708 | | - "metadata": {}, |
1709 | | - "output_type": "execute_result" |
1710 | | - } |
1711 | | - ], |
1712 | | - "source": [ |
1713 | | - "len(tmatch_pd.index)" |
1714 | | - ] |
1715 | | - }, |
1716 | 1695 | { |
1717 | 1696 | "cell_type": "markdown", |
1718 | | - "id": "b64cb2f7", |
| 1697 | + "id": "efd48a2b", |
1719 | 1698 | "metadata": {}, |
1720 | 1699 | "source": [ |
1721 | 1700 | "### 4. Do the same table join, but as a single query within ADQL\n", |
|
1728 | 1707 | { |
1729 | 1708 | "cell_type": "code", |
1730 | 1709 | "execution_count": 40, |
1731 | | - "id": "d789c1b8", |
| 1710 | + "id": "37da07ec", |
1732 | 1711 | "metadata": {}, |
1733 | 1712 | "outputs": [ |
1734 | 1713 | { |
|
1763 | 1742 | { |
1764 | 1743 | "cell_type": "code", |
1765 | 1744 | "execution_count": 51, |
1766 | | - "id": "18c5f0e2", |
| 1745 | + "id": "1aaec194", |
1767 | 1746 | "metadata": {}, |
1768 | 1747 | "outputs": [ |
1769 | 1748 | { |
|
1783 | 1762 | { |
1784 | 1763 | "cell_type": "code", |
1785 | 1764 | "execution_count": 12, |
1786 | | - "id": "656708df", |
| 1765 | + "id": "947b57c4", |
1787 | 1766 | "metadata": {}, |
1788 | 1767 | "outputs": [], |
1789 | 1768 | "source": [ |
|
1817 | 1796 | }, |
1818 | 1797 | { |
1819 | 1798 | "cell_type": "markdown", |
1820 | | - "id": "6ac5ce1f", |
| 1799 | + "id": "70725f50", |
1821 | 1800 | "metadata": {}, |
1822 | 1801 | "source": [ |
1823 | 1802 | "#### Compare the measurements from the Object table to the \"true\" values for some objects.\n", |
|
1830 | 1809 | { |
1831 | 1810 | "cell_type": "code", |
1832 | 1811 | "execution_count": 13, |
1833 | | - "id": "fc1537e0", |
| 1812 | + "id": "63794774", |
1834 | 1813 | "metadata": {}, |
1835 | 1814 | "outputs": [ |
1836 | 1815 | { |
|
1849 | 1828 | }, |
1850 | 1829 | { |
1851 | 1830 | "cell_type": "markdown", |
1852 | | - "id": "6e48f05a", |
| 1831 | + "id": "0b6d075a", |
1853 | 1832 | "metadata": {}, |
1854 | 1833 | "source": [ |
1855 | 1834 | "Just to confirm that things look like we expect, let's plot a color-magnitude (g vs. g-i) and color-color (r-i vs. g-r) diagram." |
|
1858 | 1837 | { |
1859 | 1838 | "cell_type": "code", |
1860 | 1839 | "execution_count": 14, |
1861 | | - "id": "1a10bfe0", |
| 1840 | + "id": "c800041b", |
1862 | 1841 | "metadata": {}, |
1863 | 1842 | "outputs": [ |
1864 | 1843 | { |
|
1909 | 1888 | }, |
1910 | 1889 | { |
1911 | 1890 | "cell_type": "markdown", |
1912 | | - "id": "59bc08df", |
| 1891 | + "id": "f10bef95", |
1913 | 1892 | "metadata": {}, |
1914 | 1893 | "source": [ |
1915 | 1894 | "Looks pretty normal - the stellar locus in color-color space is right where one expects it to be, and the galaxies dominate at the faint end of the CMD. \n", |
|
1920 | 1899 | { |
1921 | 1900 | "cell_type": "code", |
1922 | 1901 | "execution_count": 15, |
1923 | | - "id": "aa255174", |
| 1902 | + "id": "d7d71847", |
1924 | 1903 | "metadata": {}, |
1925 | 1904 | "outputs": [ |
1926 | 1905 | { |
|
1954 | 1933 | }, |
1955 | 1934 | { |
1956 | 1935 | "cell_type": "markdown", |
1957 | | - "id": "ca567c55", |
| 1936 | + "id": "65b4c108", |
1958 | 1937 | "metadata": {}, |
1959 | 1938 | "source": [ |
1960 | 1939 | "Well, that looks good -- the ratio of measured to true fluxes is centered on 1.0. It seems like the fluxes are recovered pretty well, on average.\n", |
|
1965 | 1944 | { |
1966 | 1945 | "cell_type": "code", |
1967 | 1946 | "execution_count": null, |
1968 | | - "id": "4780cc71", |
| 1947 | + "id": "ecffbcbe", |
1969 | 1948 | "metadata": {}, |
1970 | 1949 | "outputs": [], |
1971 | 1950 | "source": [] |
|
0 commit comments