-
Notifications
You must be signed in to change notification settings - Fork 0
/
2017-07-25-space-apis-json-and-rest-socis-es.html
697 lines (672 loc) · 23.4 KB
/
2017-07-25-space-apis-json-and-rest-socis-es.html
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="author" content="Antonio Hidalgo">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<title>APIs espaciales, JSON y REST (SOCIS 2017) | blog</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="alternate" type="application/atom+xml" title="blog blog atom feed" href="/feeds/all.atom.xml" />
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/theme/css/fontello.css"/>
<style>.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #808080 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0040D0 } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #40a070 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #40a070 } /* Literal.Number.Float */
.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */</style>
<style>body {
margin: 0;
padding: 0;
font: 15px 'Source Sans Pro', sans-serif;
line-height: 1.6em;
color: #222222;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
}
a {
color: #007ee5;
text-decoration: none;
}
a:hover {
color: #007ee5;
text-decoration: none;
}
header.main-header {
background: none repeat scroll 0% 0% #205F29;
margin-bottom: 0px;
}
header.main-header a {
color: #fff;
}
header.main-header .container {
max-width: 1000px;
}
header.main-header .container nav a:hover {
background-color: #5C881C;
}
header.navbar-default {
border-bottom: none;
background-color: #EFEFEF;
}
article {
margin: 0;
}
article header.about {
margin-bottom: 0px;
padding-bottom: 0px;
}
article header {
padding-bottom: 20px;
}
article header h1 {
margin-bottom: 2px;
font-weight: 700;
color: #000;
}
article header time {
color: #9E9E9E;
float: right;
}
article header time.left {
color: #9E9E9E;
float: left;
}
article div.social-links ul {
padding: 0px;
}
article div.social-links li {
display: inline;
font-size: 20px;
}
article div.social-links li a {
color: #000;
padding: 10px;
}
article div.social-links li a:hover {
color: #666;
text-decoration: none;
}
article p {
font-size: 16px;
margin-bottom: 20px;
line-height: 1.6em;
text-align: justify;
}
article p.note {
background: #f5f5f5;
border: 1px solid #ddd;
padding: 0.533em 0.733em;
}
article p.update {
background-color: #FEEFB3;
border: 1px solid #e6e68a;
padding: 0.533em 0.733em;
}
article p.alert {
background-color: #ffe2e2;
border: 1px solid #ffb2b2;
padding: 0.533em 0.733em;
}
article ul,
article ol {
margin-top: 0px;
margin-bottom: 25px;
}
article li {
font-size: 16px;
line-height: 1.6em;
}
article a:hover {
text-decoration: underline;
}
article blockquote {
border-left: 2px solid #c7c7cc;
color: #666;
margin: 30px 0;
padding: 0 0 0 25px;
}
article img {
max-width: 100%;
}
article code {
color: #333;
background-color: #EEE;
border-radius: 0;
font-size: 13px;
}
article .meta {
margin-top: 35px;
}
article .meta a:hover {
text-decoration: none;
}
article .meta div {
display: block;
}
article .meta address:before,
article .meta time:before,
article .meta a.tag:before {
font-family: 'fontello';
margin-right: 6px;
}
article .meta address.author {
float: left;
}
article .meta address:before {
content: '\e819';
}
article .meta time:before {
content: '\f133';
}
article .meta div.tags {
clear: both;
}
article .meta a.tag {
margin: 0 10px 10px 0;
padding: 1px 12px;
display: inline-block;
font-size: 14px;
color: rgba(0, 0, 0, 0.8);
background: rgba(0, 0, 0, 0.05);
}
article .meta a.tag:before {
content: '\e821';
}
article .meta a.tag:hover {
background: rgba(0, 0, 0, 0.15);
}
article .meta a.read_more,
article .meta a.comments_btn {
font-size: 14px;
font-weight: 800;
padding: 10px 20px;
color: #007aa3;
background: #FFF;
border: 1px solid #007aa3;
}
article .meta a.read_more:hover,
article .meta a.comments_btn:hover {
color: #FFF;
background: #007aa3;
}
article .meta:after {
content: "";
display: table;
clear: both;
}
.index {
max-width: 700px;
}
.index article header h2 {
font-size: 36px;
margin-bottom: 2px;
font-weight: 700;
}
.index article header h2 a {
color: #333;
}
.index article header h2 a:hover {
color: #007ee5;
text-decoration: none;
}
.index .separator {
padding: 40px 0 0 0;
margin: 0 0 40px 0;
height: 10px;
border-bottom: solid 1px #CCC;
}
.index .pagination {
display: block;
margin-bottom: 100px;
}
.index .pagination .left {
text-align: right;
}
.index .pagination .right {
text-align: left;
}
.index .pagination a {
display: inline-block;
border: 2px solid #5C881C;
margin: 0 5px;
padding: 8px 20px;
font-weight: bold;
color: #5C881C;
}
.index .pagination a:hover {
color: #FFF;
background: #5C881C;
}
.post {
max-width: 700px;
}
.post h1 {
font-size: 42px;
}
.post h2:before {
content: "# ";
font-weight: bold;
color: #DDD;
}
.post h3:before {
content: "## ";
font-weight: bold;
color: #DDD;
}
.post h4:before {
content: "### ";
font-weight: bold;
color: #DDD;
}
.post p {
font-size: 18px;
}
.list {
max-width: 700px;
}
.list ul.double-list {
margin: 0 auto 60px;
padding: 0;
list-style-type: none;
}
.list ul.double-list li {
padding: 5px 0;
}
.list ul.double-list li h2 {
font-size: 1em;
display: inline;
font-weight: normal;
}
.list ul.double-list li span {
font-family: sans-serif;
text-transform: uppercase;
text-align: right;
float: right;
padding-top: 3px;
font-size: 12px;
color: #999;
}
.full-width-content {
padding-top: 10px;
padding-left: 0px;
padding-right: 0px;
margin-left: -20px;
margin-right: -20px;
}
.col-xs-1,
.col-sm-1,
.col-md-1,
.col-lg-1,
.col-xs-2,
.col-sm-2,
.col-md-2,
.col-lg-2,
.col-xs-3,
.col-sm-3,
.col-md-3,
.col-lg-3,
.col-xs-4,
.col-sm-4,
.col-md-4,
.col-lg-4,
.col-xs-5,
.col-sm-5,
.col-md-5,
.col-lg-5,
.col-xs-6,
.col-sm-6,
.col-md-6,
.col-lg-6,
.col-xs-7,
.col-sm-7,
.col-md-7,
.col-lg-7,
.col-xs-8,
.col-sm-8,
.col-md-8,
.col-lg-8,
.col-xs-9,
.col-sm-9,
.col-md-9,
.col-lg-9,
.col-xs-10,
.col-sm-10,
.col-md-10,
.col-lg-10,
.col-xs-11,
.col-sm-11,
.col-md-11,
.col-lg-11,
.col-xs-12,
.col-sm-12,
.col-md-12,
.col-lg-12 {
padding-right: 0px;
padding-left: 0px;
}</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>
<script type="text/javascript">
init_mathjax = function() {
if (window.MathJax) {
// MathJax loaded
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
},
displayAlign: 'left', // Change this to 'center' to center equations.
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 0}}
}
});
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}
}
init_mathjax();
</script>
</head>
<body>
<header style="background-color:#b5e0ec;color:#777;text-align:center">
You are seeing my blog. If you want to see my page, it can be found
<a href="https://anhiga.me" title="Anhiga's page">here</a>.
</header>
<header class="navbar navbar-default bs-docs-nav">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#theNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" title="Home" class="title">anhiga's blog</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation" id="theNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="/archives.html" title="Archive">Archive</a></li>
<li><a class="nodec icon-rss" href="feeds/all.atom.xml" title="poliastro.github.io RSS feed" rel="me"></a></li>
</ul>
</nav>
</div>
</header>
<div id="wrap">
<ul class="active" style="padding-left: 10px;float: left;color: #777">
Also available in:
</ul>
<ul class="active" style="padding-left: 20px;float:left;">
<a href="https://blog.anhiga.me/2017/07/25/2017-07-25-space-apis-json-and-rest-socis/"
title="en">en</a>
</ul>
<!-- separator -->
<li style="list-style-type:none; background-color: white; padding: 1px;"> </li>
<div class="container post">
<article>
<header>
<h1>APIs espaciales, JSON y REST (SOCIS 2017)</h1>
<div class="meta">
<time datetime="article.date.isoformat()" pubdate>Tue 25 July 2017</time>
<address class="vcard author">By
<a class="url fn" href="https://blog.anhiga.me/author/antonio-hidalgo-galindo.html">Antonio Hidalgo Galindo</a>
</address>
</div>
</header>
<div class="article_content">
<p>Después de montar el blog, era el momento de empezar con la primera semana de mi <a href="https://github.com/poliastro/poliastro/wiki/SOCIS-2017-Antonio-Hidalgo#timeline">timeline</a>. La tarea de esta semana era investigar las APIs de la NASA disponibles y otras bases de datos de NEOs que pudiesen ser útiles para este proyecto.</p>
<p>Ya había estudiado algunas APIs y echado un vistazo a sus posibilidades, pero hacía falta una investigación más profunda. Como mi <a href="https://github.com/poliastro/poliastro/wiki/SOCIS-2017-Antonio-Hidalgo#proposal">propuesta</a> se componía de 3 páginas diferentes, decidí analizar cada una por separado.</p>
<h2>CNEOS</h2>
<p>En la página del <a href="https://cneos.jpl.nasa.gov/orbits/">CNEOS</a> hay una lista de distintas herramientas, pero puede ser acortada a las siguientes APIs:</p>
<ul>
<li>
<p><a href="https://ssd.jpl.nasa.gov/sbdb.cgi">JPL Small-Body Database Browser</a>: permite buscar cualquier cuerpo menor (como los NEOs) mediante su número IAU, nombre o designación, y también soporta los caracteres comodín <code>*</code> y/o <code>?</code>. Los datos disponibles incluyen, citando a la propia página:</p>
<blockquote>
<ul>
<li>elementos orbitales</li>
<li>diagramas orbitales</li>
<li>parámetros físicos</li>
<li>circunstancias sobre el descubrimiento</li>
</ul>
<p>Los nuevos objetos descubiertos y sus órbitas son añadidos de forma diaria.</p>
</blockquote>
</li>
<li>
<p><a href="https://ssd.jpl.nasa.gov/sbdb_query.cgi">JPL Small-Body Database Search Engine</a>: permite generar tablas personalizadas con datos orbitales y parámetros físicos de un subconjunto de todos los asteroides y cometas. Permite una gran cantidad de restricciones de búsqueda, por ejemplo:
<img alt="Figure 1" src="https://blog.anhiga.me/images/sbdb_constraints.jpg" title="Figure 1"></p>
</li>
</ul>
<p>También permite seleccionar los datos de salida, y elegir entre HTML y CSV.</p>
<ul>
<li><a href="https://ssd.jpl.nasa.gov/?horizons">Horizons</a>: proporciona acceso a efemérides de alta precisión para objetos del sistema solar, no solo cuerpos menores. Se puede acceder mediante telnet, email y una interfaz web.</li>
</ul>
<h2>NEOWS</h2>
<p>Entre las APIs de la NASA, está [NeoWs]https://api.nasa.gov/neo/?api_key=DEMO_KEY). Se puede utilizar para listar NEOs y obtener sus elementos orbitales y próximas aproximaciones (valga la redundancia) a la Tierra, dado un SPK-ID (número que el <a href="https://www.jpl.nasa.gov/">JPL</a> usa para identificar objetos). A pesar de su nombre, sólo funciona con NEAs (Near Earth Asteroids), y por tanto no proporciona información sobre cometas.</p>
<h2>JPL SSD/CNEOS API SERVICE</h2>
<p>Como dice su web, el <a href="https://ssd-api.jpl.nasa.gov/">JPL SSD/CNEOS API SERVICE</a></p>
<blockquote>
<p>proporciona una interfaz para datos en formato JSON relacionados con el <a href="https://ssd.jpl.nasa.gov/">SSD</a> y el <a href="https://cneos.jpl.nasa.gov/">CNEOS</a>.</p>
</blockquote>
<p>Las APIs más relevantes son:</p>
<ul>
<li>
<p><a href="https://ssd-api.jpl.nasa.gov/doc/cad.html">Close-Approach Data (CAD)</a>: proporciona datos sobre aproximaciones a la tierra para todos los asteroides y cometas en la base de datos del JPL.</p>
</li>
<li>
<p><a href="https://cneos.jpl.nasa.gov/nhats/">Accessible NEAs (NHATS)</a>: está operado por el Near-Earth Object Human Space Flight Accessible Targets Study (<a href="https://cneos.jpl.nasa.gov/nhats/intro.html">NHATS</a>), y se puede utilizar para identificar NEAs que pueden ser aptos para futuras misiones tripuladas.</p>
</li>
<li>
<p><a href="https://ssd-api.jpl.nasa.gov/doc/scout.html">Scout</a>: el sistema Scout propociona análisis de trayectorias y evaluación de riesgos en objetos descubiertos recientemente.</p>
</li>
<li>
<p><a href="https://cneos.jpl.nasa.gov/sentry/">Sentry</a>: Sentry es un sistema de monitorización de colisiones automático, que escanea continuamente el catálogo más actual de asteroides y analiza las posibilidades de un futuro impacto.</p>
</li>
</ul>
<h2>Eligiendo las APIs</h2>
<p>Una vez estudiadas todas las posibilidades, era momento de elegir las APIs que parecían más adecuadas para nuestro propósito.</p>
<p>Ya que el núcleo de <code>poliastro</code> son los objetos <a href="https://poliastro.readthedocs.io/en/latest/api.html#poliastro.twobody.orbit.Orbit">Orbit</a>, nuestro objetivo principal es crear automáticamente las órbitas de los NEOs, usando los datos obtenidos de APIs de internet. Para conseguir esto, se necesitan o bien los elementos orbitales o bien los vectores de posición y velocidad, así que el primer requisito que tenían que cumplir las APIs, era proporcionar alguno de estos datos.</p>
<p>Por tanto, varias APIs podían ser descartadas por no proporcionar la información necesaria: <code>Accesible NEAs</code>, <code>Scout</code>, <code>Sentry</code> y <code>Close-Approach Data</code>.</p>
<p>Ya que preferíamos no tener que lidiar con intrincadas peticiones POST, otro requisito importante que las APIs tenían que cumplir era proporcionar una buena interfaz (la "I" de API significa interfaz, así que...), y, a ser posible, algo que se acercase a un <a href="https://es.wikipedia.org/wiki/Transferencia_de_Estado_Representacional">Servicio REST</a>.</p>
<p><code>JPL Small-Body Database Search Engine</code> requiere peticiones POST de más de 150 líneas, así que la descartamos automáticamente.</p>
<p>Finalmente, el tercer requisito, considerando que escribimos software en Python, era que la información fuese proporcionada <code>machine-readable</code> (en formato fácil de leer y manipular para el ordenador), siendo JSON el formato preferido, y un código HTML mal escrito el peor formato.</p>
<p>Tanto <code>JPL Small-Body Database Browser</code> como <code>Horizons</code> proporcionan la salida en HTML, el cual tiene que ser parseado, con todos los riesgos que ésto implica, por lo que fueron descartados.</p>
<p>Para clarificar toda esta la retahíla de datos, hice una tabla:</p>
<table>
<thead>
<tr>
<th align="center">API</th>
<th align="center">Elementos orbitales?</th>
<th align="center">REST?</th>
<th align="center">Machine-readable?</th>
<th align="center">Otras</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">JPL Small-Body Database Browser</td>
<td align="center">Sí</td>
<td align="center">Sí</td>
<td align="center">No</td>
<td align="center">No se limita a NEOs</td>
</tr>
<tr>
<td align="center">JPL Small-Body Database Search Engine</td>
<td align="center">Sí</td>
<td align="center">No</td>
<td align="center">Sí (CSV)</td>
<td align="center">No se limita a NEOs</td>
</tr>
<tr>
<td align="center">Horizons</td>
<td align="center">Sí</td>
<td align="center">No</td>
<td align="center">No</td>
<td align="center"><a href="https://github.com/mommermi/callhorizons">ya existe una interfaz Python</a></td>
</tr>
<tr>
<td align="center">NeoWs</td>
<td align="center">Sí</td>
<td align="center">Sí</td>
<td align="center">Sí (JSON)</td>
<td align="center">Solo para NEAs (asteroides)</td>
</tr>
<tr>
<td align="center">Close-Approach Data (CAD)</td>
<td align="center">No</td>
<td align="center">Sí</td>
<td align="center">Sí (JSON)</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">Accessible NEAs (NHATS)</td>
<td align="center">No</td>
<td align="center">Sí</td>
<td align="center">Sí (JSON)</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">Scout</td>
<td align="center">No</td>
<td align="center">Sí</td>
<td align="center">Sí (JSON)</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">Sentry</td>
<td align="center">No</td>
<td align="center">Sí</td>
<td align="center">Sí (JSON)</td>
<td align="center"></td>
</tr>
</tbody>
</table>
<p>Teniendo todos estos requisitos en mente, la mejor opción parecía ser <code>NeoWs</code>. Aunque no proporciona información sobre NECs (cometas), éstos solo representan un 0.7% del total de los NEOs, por tanto podían ser descartados (sólo de momento :P). Otro problema relacionado con <code>NeoWs</code> es el hecho de que sólo permite buscar por número SPK-ID (no confundir con número IAU), el cuál es desconocido para la mayoría de la gente, por tanto, antes de hacer ninguna petición a la API, se necesita encontrar el número SPK-ID.</p>
<p>Y eso ha sido todo esta semana. La próxima, empezaremos con la programación propiamente dicha, añadiendo una función <code>orbit_from_spk_id</code> que haga una petición a la API <code>NeoWs</code> ¡Nos vemos!</p>
</div>
<div class="meta">
<div class="tags">
<a href="https://blog.anhiga.me/tag/socis.html" class="tag">SOCIS</a>
<a href="https://blog.anhiga.me/tag/esa.html" class="tag">ESA</a>
<a href="https://blog.anhiga.me/tag/poliastro.html" class="tag">poliastro</a>
<a href="https://blog.anhiga.me/tag/nasa.html" class="tag">NASA</a>
<a href="https://blog.anhiga.me/tag/apis.html" class="tag">APIs</a>
<a href="https://blog.anhiga.me/tag/open-data.html" class="tag">open data</a>
</div>
</div>
</article>
<!-- <script data-isso="//localhost:1234"
data-isso-lang="en"
src="//localhost:1234/js/embed.min.js"></script>
<section id="isso-thread">
<h3>Comments</h3>
</section>
-->
</div>
<style type="text/css">
{
max-width: 700px;
}
.text_cell .prompt {
display: none;
}
div.cell {
padding: 0;
}
div.text_cell_render {
padding: 0;
}
div.prompt {
font-size: 13px;
}
div.input_prompt {
padding: .7em 0.2em;
}
div.output_prompt {
padding: .4em .2em;
}
div.input_area {
margin: .2em 0.4em;
max-width: 580px;
}
table.dataframe {
font-family: Arial, sans-serif;
font-size: 13px;
line-height: 20px;
}
table.dataframe th, td {
padding: 4px;
text-align: left;
}
pre code {
background-color: inherit;
}</style>
</div>
<!--
<footer>
<p>
© 2012-2017 Antonio Hidalgo, license <a href="https://github.com/anhiga/anhiga.github.io-source/blob/master/LICENSE"> </a>
unless otherwise noted.
Generated by <a href= "http://docs.getpelican.com/">Pelican</a>.
</p>
</footer>
-->
</body>
</html>