{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", " SELECT columnnames\n", " FROM tablename\n", " WHERE conditions\n", "" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/holtz/anaconda3/lib/python3.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (3.0.4) doesn't match a supported version!\n", " RequestsDependencyWarning)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ " SELECT FE_H, MG_FE, apogeeStar.extratarg FROM aspcapStar JOIN apogeeStar ON aspcapStar.apstar_id = apogeeStar.apstar_id WHERE LOGG>1 AND LOGG<2 AND apogeeStar.extratarg = 0 \n", "67267\n" ] } ], "source": [ "from astroquery.sdss import SDSS\n", "sql=\" SELECT FE_H, MG_FE, apogeeStar.extratarg \\\n", " FROM aspcapStar \\\n", " JOIN apogeeStar ON aspcapStar.apstar_id = apogeeStar.apstar_id \\\n", " WHERE LOGG>1 AND LOGG<2 AND apogeeStar.extratarg = 0 \\\n", " \"\n", "print(sql)\n", "dr17=SDSS.query_sql(sql, data_release=17) \n", "print(len(dr17))\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " FE_H MG_FE extratarg\n", "--------- ------------ ---------\n", " 0.35839 0.003715992 0\n", " 0.2297 0.0008270144 0\n", " 0.10624 0.0788789 0\n", " -0.84662 0.341623 0\n", " -0.27705 0.277463 0\n", " 0.37835 -0.054977 0\n", " -0.1863 0.189303 0\n", " -0.18991 0.275463 0\n", " 0.26089 0.03521502 0\n", " 0.33715 0.03567898 0\n", " ... ... ...\n", " -1.1376 0.159043 0\n", " -1.0695 0.1186619 0\n", " -0.31406 0.14725 0\n", " -0.57243 0.353973 0\n", " -0.37482 0.08792439 0\n", " -1.0257 0.121325 0\n", " -0.38679 0.103378 0\n", "-0.099163 0.111828 0\n", " -0.29464 0.088771 0\n", " -0.14344 -0.009474009 0\n", " -0.68592 0.09890097 0\n", "Length = 67267 rows\n" ] } ], "source": [ "print(dr17)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "How many objects did you get?\n", "
\n",
"For your scatter plot, choose the smallest point sizes (s= keyword with plt.scatter)."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"67211\n"
]
},
{
"data": {
"text/plain": [
"