-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pruebas SS
176 lines (176 loc) · 9.26 KB
/
Pruebas SS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Pruebas",
"version": "0.3.2",
"provenance": [],
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/astrodatos/proyecto_ps2/blob/master/Pruebas%20SS\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "ZYGHpzVG_hep",
"colab_type": "code",
"outputId": "d47fdce7-475d-4e03-e4bf-bbc7505a21d9",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 377
}
},
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import sklearn as sk\n",
"import pandas as pd\n",
"!pip install astroquery\n"
],
"execution_count": 10,
"outputs": [
{
"output_type": "stream",
"text": [
"Requirement already satisfied: astroquery in /usr/local/lib/python3.6/dist-packages (0.3.9)\n",
"Requirement already satisfied: requests>=2.4.3 in /usr/local/lib/python3.6/dist-packages (from astroquery) (2.21.0)\n",
"Requirement already satisfied: html5lib>=0.999 in /usr/local/lib/python3.6/dist-packages (from astroquery) (1.0.1)\n",
"Requirement already satisfied: beautifulsoup4>=4.3.2 in /usr/local/lib/python3.6/dist-packages (from astroquery) (4.6.3)\n",
"Requirement already satisfied: astropy>=1.0 in /usr/local/lib/python3.6/dist-packages (from astroquery) (3.0.5)\n",
"Requirement already satisfied: keyring>=4.0 in /usr/local/lib/python3.6/dist-packages (from astroquery) (19.0.2)\n",
"Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (2.8)\n",
"Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (1.24.3)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (3.0.4)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.4.3->astroquery) (2019.3.9)\n",
"Requirement already satisfied: six>=1.9 in /usr/local/lib/python3.6/dist-packages (from html5lib>=0.999->astroquery) (1.12.0)\n",
"Requirement already satisfied: webencodings in /usr/local/lib/python3.6/dist-packages (from html5lib>=0.999->astroquery) (0.5.1)\n",
"Requirement already satisfied: numpy>=1.10.0 in /usr/local/lib/python3.6/dist-packages (from astropy>=1.0->astroquery) (1.16.4)\n",
"Requirement already satisfied: secretstorage; sys_platform == \"linux\" in /usr/local/lib/python3.6/dist-packages (from keyring>=4.0->astroquery) (3.1.1)\n",
"Requirement already satisfied: entrypoints in /usr/local/lib/python3.6/dist-packages (from keyring>=4.0->astroquery) (0.3)\n",
"Requirement already satisfied: jeepney in /usr/local/lib/python3.6/dist-packages (from secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (0.4)\n",
"Requirement already satisfied: cryptography in /usr/local/lib/python3.6/dist-packages (from secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (2.7)\n",
"Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/local/lib/python3.6/dist-packages (from cryptography->secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (1.12.3)\n",
"Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python3.6/dist-packages (from cryptography->secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (0.24.0)\n",
"Requirement already satisfied: pycparser in /usr/local/lib/python3.6/dist-packages (from cffi!=1.11.3,>=1.8->cryptography->secretstorage; sys_platform == \"linux\"->keyring>=4.0->astroquery) (2.19)\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "Ix0j_vnVO1on",
"colab_type": "code",
"outputId": "0c2dd595-b467-4f7f-e84c-3a05c953e073",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 289
}
},
"source": [
"from astroquery.gaia import Gaia\n",
"data = Gaia.launch_job(\"\"\"SELECT TOP 100000 gaia_source.source_id,gaia_source.ra,gaia_source.ra_error,gaia_source.dec,gaia_source.dec_error,gaia_source.phot_g_mean_mag,gaia_source.bp_rp,gaia_source.g_rp,gaia_source.phot_variable_flag,gaia_source.teff_val,gaia_source.a_g_val,gaia_source.radius_val,gaia_source.lum_val\n",
"FROM gaiadr2.gaia_source\"\"\")\n"
],
"execution_count": 32,
"outputs": [
{
"output_type": "stream",
"text": [
"WARNING: W35: None:5:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING:astropy:W35: None:5:0: W35: 'value' attribute required for INFO elements\n",
"WARNING: W35: None:7:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING:astropy:W35: None:7:0: W35: 'value' attribute required for INFO elements\n",
"WARNING: W35: None:8:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING:astropy:W35: None:8:0: W35: 'value' attribute required for INFO elements\n",
"WARNING: W35: None:9:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING:astropy:W35: None:9:0: W35: 'value' attribute required for INFO elements\n",
"WARNING: W35: None:11:0: W35: 'value' attribute required for INFO elements [astropy.io.votable.tree]\n",
"WARNING:astropy:W35: None:11:0: W35: 'value' attribute required for INFO elements\n",
"WARNING: W27: None:12:0: W27: COOSYS deprecated in VOTable 1.2 [astropy.io.votable.tree]\n",
"WARNING:astropy:W27: None:12:0: W27: COOSYS deprecated in VOTable 1.2\n",
"WARNING: W06: None:33:0: W06: Invalid UCD 'phot.color': Unknown word 'phot.color' [astropy.io.votable.tree]\n",
"WARNING:astropy:W06: None:33:0: W06: Invalid UCD 'phot.color': Unknown word 'phot.color'\n",
"WARNING: W06: None:36:0: W06: Invalid UCD 'phot.color': Unknown word 'phot.color' [astropy.io.votable.tree]\n",
"WARNING:astropy:W06: None:36:0: W06: Invalid UCD 'phot.color': Unknown word 'phot.color'\n"
],
"name": "stderr"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "hvfFwUhfPkIm",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "23083460-e7fe-42cc-90d6-aacdb9db4d06"
},
"source": [
"r = data.get_results()\n",
"r = r.to_pandas()\n",
"obs = r.dropna()\n",
"print(obs.shape)\n"
],
"execution_count": 33,
"outputs": [
{
"output_type": "stream",
"text": [
"(2323, 13)\n"
],
"name": "stdout"
}
]
},
{
"cell_type": "code",
"metadata": {
"id": "sjUqIx65QYKN",
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 200
},
"outputId": "4d443bf9-86f2-4ddd-f04b-b388b147685c"
},
"source": [
""
],
"execution_count": 34,
"outputs": [
{
"output_type": "error",
"ename": "NameError",
"evalue": "ignored",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-34-d71ed9fe977c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0marchivo\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdownload_file\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'https://raw.githubusercontent.com/piacortes/astroclases/master/planets.csv?token=AXWBlnRlbOADXAfY-qtBxFJQ3SugzCucks5cpBbnwA%3D%3D'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mplanetas\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0marchivo\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcomment\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"#\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNameError\u001b[0m: name 'download_file' is not defined"
]
}
]
}
]
}