1 | # ![Screenshot](https://raw.githubusercontent.com/emirozer/bowshock/master/docs/bowshock2.png)
|
2 |
|
3 | <a href="https://www.npmjs.com/package/node-bowshock/"><img src="https://nodei.co/npm/node-bowshock.png?downloads=true&downloadRank=true&stars=true"></a>
|
4 | <br/>
|
5 | [![GitHub issues](https://img.shields.io/github/issues/javajohnhub/node-bowshock.svg)](https://github.com/javajohnhub/node-bowshock/issues)
|
6 | [![Build Status](https://travis-ci.org/javajohnHub/node-bowshock.svg?branch=master)](https://travis-ci.org/javajohnHub/node-bowshock)
|
7 | [![Coverage Status](https://coveralls.io/repos/github/javajohnHub/node-bowshock/badge.svg?branch=master)](https://coveralls.io/github/javajohnHub/node-bowshock?branch=master)
|
8 | <br/>
|
9 | An npm Package for Node.js based on https://github.com/emirozer/bowshock
|
10 | <br/>
|
11 | bowshock is an all-in-one wrapper for NASA API's.
|
12 | Here is a list of currently supported API's :
|
13 |
|
14 | - [Earth API](https://api.nasa.gov/api.html#earth)
|
15 | - [APOD (Astronomy Picture of the Day) API](https://api.nasa.gov/api.html#apod)
|
16 | - [Mars Rover Photos API](https://api.nasa.gov/api.html#MarsPhotos)
|
17 | - [Asteroids - NeoWs API](https://api.nasa.gov/api.html#NeoWS)
|
18 | - [Extra Vehicular Activity - US and Russia](https://dev.socrata.com/foundry/data.nasa.gov/q8u9-7uq7)
|
19 | - [DONKI (Space Weather Database Of Notifications, Knowledge, Information) API](https://api.nasa.gov/api.html#DONKI)
|
20 | - [EONET API](https://eonet.sci.gsfc.nasa.gov/docs/v2.1)
|
21 | - [EPIC API](https://api.nasa.gov/api.html#EPIC)
|
22 | - [EXOPLANET API](https://api.nasa.gov/api.html#exoPlanet)
|
23 | - [NASA IMAGE AND VIDEO LIBRARY API](https://api.nasa.gov/api.html#Images)
|
24 | - [SATELLITE SITUATION CENTER API](https://api.nasa.gov/api.html#SSC)
|
25 | - [GENELAB API](https://api.nasa.gov/api.html#genelab)
|
26 | - [Patents API](https://api.nasa.gov/api.html#patents)
|
27 | - [Asterank API](http://www.asterank.com/api)
|
28 | - [HelioViewer API](http://helioviewer.org/api/docs/v1/)
|
29 | - [Skymorph API](http://www.asterank.com/skymorph)
|
30 | - [SSD/CNEOS API](https://api.nasa.gov/api.html#ssd_CNEOS)
|
31 | - [Trek WMTS API](https://api.nasa.gov/api.html#trek)
|
32 | - [Techport API](https://data.nasa.gov/developer/external/techport/techport-api.pdf)
|
33 |
|
34 | ## Install
|
35 |
|
36 | npm install node-bowshock
|
37 |
|
38 | ## Do I need an API Key ?
|
39 |
|
40 | | | Yes | No |
|
41 | | --------- | -------- | -------- |
|
42 | | Earth | ✔ | |
|
43 | | Apod | ✔ | |
|
44 | | Donki | ✔ | |
|
45 | | Rover | ✔ | |
|
46 | | NeoWs | ✔ | |
|
47 | | EPIC | | ✔ |
|
48 | | EVA | | ✔ |
|
49 | | EONET | | ✔ |
|
50 | | ExoPlanet | | ✔ |
|
51 | | Helio | | ✔ |
|
52 | | GeneLab | ✔ | |
|
53 | | ImgVidLib | | ✔ |
|
54 | | Patents | ✔ | |
|
55 | | Skymorph | | ✔ |
|
56 | | SSC | | ✔ |
|
57 | | SSD/CNEOS | ✔ | |
|
58 | | Trek WMTS | | ✔ |
|
59 | | Techport | | ✔ |
|
60 |
|
61 | Get your NASA API KEY from : https://data.nasa.gov/developer/external/planetary/#apply-for-an-api-key
|
62 |
|
63 | #### Setting up the API Key
|
64 |
|
65 | <br/>
|
66 | Set an environment varible NASA_API_KEY which is equal to your key string.<br/>
|
67 | Create a .env file in the root of the project.
|
68 | Logging to console can be enabled or disabled.<br/>
|
69 |
|
70 | ---
|
71 |
|
72 | .env<br/>
|
73 |
|
74 | ```bash
|
75 | NASA_API_KEY=########################
|
76 | LOGGER=true
|
77 | ```
|
78 |
|
79 | ---
|
80 |
|
81 | #### All functions return a promise. I might switch to observables
|
82 |
|
83 | ##### Apod
|
84 |
|
85 | ```javascript
|
86 | let bowshock = require("node-bowshock")
|
87 | //with specific date and tags - For apod all args are optional
|
88 | bowshock.apod("2017-03-11").then(apod => {
|
89 | });
|
90 | ```
|
91 |
|
92 | ##### Donki
|
93 |
|
94 | ```javascript
|
95 | let bowshock = require("node-bowshock");
|
96 | let object = {
|
97 | startDate: "2017-09-10",
|
98 | endDate: "2017-10-10"
|
99 | };
|
100 | bowshock.donki.CME(object);
|
101 | bowshock.donki.CMEA(object);
|
102 | bowshock.donki.FLR(object);
|
103 | bowshock.donki.GST(object);
|
104 | bowshock.donki.HSS(object);
|
105 | bowshock.donki.IPS(object);
|
106 | bowshock.donki.MPC(object);
|
107 | bowshock.donki.notifications(object);
|
108 | bowshock.donki.RBE(object);
|
109 | bowshock.donki.SEP(object);
|
110 | bowshock.donki.WSASim(object);
|
111 | ```
|
112 |
|
113 | ##### EPIC
|
114 |
|
115 | ```javascript
|
116 | let bowshock = require("node-bowshock");
|
117 |
|
118 | bowshock.epic.natural();
|
119 | bowshock.epic.naturalAll();
|
120 | bowshock.epic.naturalDate("2018-5-15");
|
121 | bowshock.epic.naturalAvailable();
|
122 | bowshock.epic.enhanced();
|
123 | bowshock.epic.enhancedAll();
|
124 | bowshock.epic.enhancedDate("2018-5-15");
|
125 | bowshock.epic.enhancedAvailable();
|
126 | ```
|
127 |
|
128 | ##### ExoPlanet
|
129 |
|
130 | ```javascript
|
131 | let bowshock = require("node-bowshock");
|
132 |
|
133 | bowshock.exoPlanet.getSingleKOI("K00007.01");
|
134 | bowshock.exoPlanet.allConfirmedPlanetsAndCols();
|
135 | bowshock.exoPlanet.confirmedPlanetsInKeplerField();
|
136 | bowshock.exoPlanet.starsKnownToHostExoPlanets();
|
137 | bowshock.exoPlanet.confirmedPlanetsThatTransitHostStars();
|
138 | bowshock.exoPlanet.currentNonConfirmedPlanetCandidates();
|
139 | bowshock.exoPlanet.k2TargetsFromCapaign9();
|
140 | bowshock.exoPlanet.confirmedPlanetsInMissionStarList();
|
141 | bowshock.exoPlanet.allMicrolensingPlanetsWithTimeSeries();
|
142 | bowshock.exoPlanet.allPlanetaryCandidatesSmallerThan2ReWithEquilibriumTemperaturesBetween180and303K();
|
143 | ```
|
144 |
|
145 | ##### GeneLab
|
146 |
|
147 | ```javascript
|
148 | let bowshock = require("node-bowshock");
|
149 |
|
150 | bowshock.geneLab.search({ type: "cgene", term: "a" });
|
151 | ```
|
152 |
|
153 | ##### Image and Video Library
|
154 |
|
155 | ```javascript
|
156 | let bowshock = require("node-bowshock");
|
157 |
|
158 | let obj = {
|
159 | q: "space"
|
160 | // center: '',
|
161 | // description: '',
|
162 | // description_508: '',
|
163 | // keywords: 'space',
|
164 | // location: '',
|
165 | // media_type: '',
|
166 | // nasa_id: '',
|
167 | // photographer: '',
|
168 | // secondary_creator: '',
|
169 | // title: '',
|
170 | // year_start: '',
|
171 | // year_end: ''
|
172 | };
|
173 | bowshock.nasaImgVideo.search(obj);
|
174 |
|
175 | bowshock.nasaImgVideo.getAsset("Space-to-Ground_171_170407");
|
176 | bowshock.nasaImgVideo.getMetadata("Space-to-Ground_171_170407");
|
177 | bowshock.nasaImgVideo.getCaptions("Space-to-Ground_171_170407");
|
178 | ```
|
179 |
|
180 | ##### SSC
|
181 |
|
182 | ```javascript
|
183 | let bowshock = require("node-bowshock");
|
184 |
|
185 | bowshock.satelliteSituationCenter.getObservatories();
|
186 |
|
187 | bowshock.satelliteSituationCenter.getWADL();
|
188 |
|
189 | bowshock.satelliteSituationCenter.getSpaseObservatories();
|
190 |
|
191 | bowshock.satelliteSituationCenter.getGroundStations();
|
192 |
|
193 | bowshock.satelliteSituationCenter.getLocations();
|
194 |
|
195 | bowshock.satelliteSituationCenter.getGraphs();
|
196 | bowshock.satelliteSituationCenter.getConjunctions();
|
197 | ```
|
198 |
|
199 | ##### Mars Rovers
|
200 |
|
201 | ```javascript
|
202 | let bowshock = require("node-bowshock");
|
203 |
|
204 | bowshock.mars.curiosity("2015-06-03");
|
205 | bowshock.mars.opportunity("2015-06-03");
|
206 | bowshock.mars.spirit("2015-06-03");
|
207 | bowshock.mars.manifest("curiosity");
|
208 | bowshock.mars.insight({perPage: 50});
|
209 | ```
|
210 |
|
211 | ##### NeoWs
|
212 |
|
213 | ```javascript
|
214 | let bowshock = require("node-bowshock");
|
215 |
|
216 | bowshock.neows.today(true);
|
217 |
|
218 | bowshock.neows.stats();
|
219 |
|
220 | bowshock.neows.feed("2015-06-03");
|
221 |
|
222 | //Lookup a specific Asteroid based on its NASA JPL small body (SPK-ID) ID
|
223 | bowshock.neows.lookup(3542519);
|
224 |
|
225 | bowshock.neows.browse();
|
226 | ```
|
227 |
|
228 | ##### EVA
|
229 |
|
230 | ```javascript
|
231 | let bowshock = require("node-bowshock");
|
232 |
|
233 | bowshock.eva();
|
234 | ```
|
235 |
|
236 | ##### EONET
|
237 |
|
238 | ```javascript
|
239 | let bowshock = require("node-bowshock");
|
240 |
|
241 | bowshock.eonet.events({
|
242 | source: "InciWeb, EO",
|
243 | status: "open",
|
244 | limit: 5,
|
245 | days: 20
|
246 | });
|
247 |
|
248 | bowshock.eonet.categories({
|
249 | id: 8,
|
250 | source: "InciWeb, EO",
|
251 | status: "open",
|
252 | limit: 5,
|
253 | days: 20
|
254 | });
|
255 |
|
256 | bowshock.eonet.layers(8);
|
257 | ```
|
258 |
|
259 | ##### Asterank
|
260 |
|
261 | ```javascript
|
262 | let bowshock = require("node-bowshock");
|
263 |
|
264 | //all args mandatory
|
265 | bowshock.asterank({
|
266 | query: { e: { $lt: 0.1 }, i: { $lt: 4 }, a: { $lt: 1.5 } },
|
267 | limit: 10
|
268 | });
|
269 | ```
|
270 |
|
271 | ##### Earth
|
272 |
|
273 | ```javascript
|
274 | let bowshock = require("node-bowshock");
|
275 |
|
276 | //imagery endpoint lon & lat mandatory, rest optional
|
277 | bowshock.earth.imagery({ lon: 100.75, lat: 1.5, date: "2014-02-04" });
|
278 |
|
279 | //assets endpoint lon & lat & begin mandatory, end optional
|
280 | bowshock.earth.assets({ lon: 100.75, lat: 1.5, begin: "2014-02-01" });
|
281 | ```
|
282 |
|
283 | ##### HelioViewer
|
284 |
|
285 | ```javascript
|
286 | let bowshock = require("node-bowshock");
|
287 |
|
288 | //args are mandatory
|
289 | bowshock.helioviewer.getjp2image({ date: "2014-01-01T23:59:59", sourceId: 14 });
|
290 |
|
291 | //args are mandatory
|
292 | bowshock.helioviewer.getjp2header(7654321);
|
293 |
|
294 | //startTime, endTime and sourceId are required
|
295 | bowshock.helioviewer.getJPX({
|
296 | startTime: "2014-01-01T00:00:00",
|
297 | endTime: "2014-01-01T00:45:00",
|
298 | sourceId: 14
|
299 | //linked: true,
|
300 | //cadence: 12
|
301 | });
|
302 |
|
303 | //startTime, endTime and sourceId are required
|
304 | bowshock.helioviewer.getJPXClosestToMidPoint({
|
305 | startTimes: [1306886400, 1306887000, 1306887600],
|
306 | endTimes: [1306886700, 1306887300, 1306887900],
|
307 | sourceId: 14
|
308 | //linked: true
|
309 | });
|
310 |
|
311 | //startTime, endTime, layers, events, eventsLabels, and imageScale are required
|
312 | bowshock.helioviewer.queueMovie({
|
313 | startTime: "2010-03-01T12:12:12",
|
314 | endTime: "2010-03-04T12:12:12",
|
315 | layers: "[3,1,100],[4,1,100]",
|
316 | events: "[AR,HMI_HARP;,SPoCA,1],[CH,all,1]",
|
317 | eventsLabels: false,
|
318 | imageScale: 21.04,
|
319 | format: "mp4",
|
320 | frameRate: 15,
|
321 | maxFrames: 300,
|
322 | scale: true,
|
323 | scaleType: "earth",
|
324 | scaleX: -1000,
|
325 | scaleY: -500,
|
326 | movieLength: 4.3333,
|
327 | watermark: true,
|
328 | width: 1920,
|
329 | height: 1200,
|
330 | x0: 0,
|
331 | y0: 0,
|
332 | x1: -5000,
|
333 | y1: -5000,
|
334 | x2: 5000,
|
335 | y2: 5000
|
336 | //callback: "Wrap the response object in a function call of your choosing."
|
337 | });
|
338 |
|
339 | bowshock.helioviewer.reQueueMovie("VXvX5");
|
340 |
|
341 | // id and format required
|
342 | bowshock.helioviewer.getMovieStatus({
|
343 | id: "VXvX5",
|
344 | format: "mp4",
|
345 | verbose: true
|
346 | //callback: "callback",
|
347 | //token: "4673d6db4e2a3365ab361267f2a9a112"
|
348 | });
|
349 |
|
350 | // id and format are required - saves movie to root directory
|
351 | bowshock.helioviewer.downloadMovie({
|
352 | id: "VXvX5",
|
353 | format: "mp4",
|
354 | hq: true
|
355 | });
|
356 |
|
357 | //id, format, and height are required --opens movie in default web browser
|
358 | bowshock.helioviewer.playMovie({
|
359 | id: "VXvX5",
|
360 | format: "mp4",
|
361 | height: 820
|
362 | //hq: true,
|
363 | //width: 846
|
364 | });
|
365 |
|
366 | //date, imageScale, layers, eventLabels, and height are required
|
367 | bowshock.helioviewer.takeScreenshot({
|
368 | date: "2014-01-01T23:59:59",
|
369 | imageScale: 2.4204409,
|
370 | layers: "[SDO,AIA,AIA,335,1,100]",
|
371 | eventLabels: false,
|
372 | height: 1200,
|
373 | //events: "[AR,HMI_HARP;SPoCA,1],[CH,all,1]"
|
374 | //scale: false,
|
375 | //scaleType: "earth",
|
376 | //scaleX: -1000,
|
377 | //scaleY: -500,
|
378 | //width: 1920,
|
379 | //x0: 1,
|
380 | //y0: 1,
|
381 | x1: -5000,
|
382 | y1: -5000,
|
383 | x2: 5000,
|
384 | y2: 5000,
|
385 | display: true,
|
386 | watermark: false
|
387 | });
|
388 |
|
389 | bowshock.helioviewer.downloadScreenshot(3240748);
|
390 |
|
391 | //date and sourceId are required
|
392 | bowshock.helioviewer.getClosestImage({
|
393 | date: "2014-01-01T23:59:59",
|
394 | sourceId: 14
|
395 | //callback: "callback"
|
396 | });
|
397 |
|
398 | // all args are optional
|
399 | bowshock.helioviewer.getDataSources({
|
400 | verbose: true,
|
401 | enable: "[Yohkoh,STEREO_A,STEREO_B]"
|
402 | //callback: "callback
|
403 | });
|
404 |
|
405 | //all args are required
|
406 | bowshock.helioviewer.getTile({
|
407 | id: 36275490,
|
408 | x: -1,
|
409 | y: -1,
|
410 | imageScale: 2.42044088
|
411 | });
|
412 |
|
413 | bowshock.helioviewer.shortenURL(
|
414 | "date%3D2014-02-25T15%3A18%3A07.000Z%26imageScale%3D2.4204409%26centerX%3D-410.06307838566283%26centerY%3D-244.6662219973343%26imageLayers%3D%255BSDO%2CAIA%2CAIA%2C304%2C1%2C100%255D%26eventLayers%3D%26eventLabels%3Dtrue"
|
415 | );
|
416 |
|
417 | bowshock.helioviewer.getNewsFeed();
|
418 |
|
419 | bowshock.helioviewer.checkYouTubeAuth();
|
420 |
|
421 | bowshock.helioviewer.getYouTubeAuth({
|
422 | id: "F3Dh5",
|
423 | title: "Test",
|
424 | description:
|
425 | "This movie was produced by Helioviewer.org. See the original at http://helioviewer.org/?movieId=F3Dh5 or download a high-quality version from http://api.helioviewer.org/v2/downloadMovie/?id=F3Dh5&format=mp4&hq=true",
|
426 | tags: "test",
|
427 | share: true
|
428 | });
|
429 |
|
430 | bowshock.helioviewer.uploadMovieToYouTube({
|
431 | id: "F3Dh5",
|
432 | share: true
|
433 | });
|
434 |
|
435 | helioviewer.getUserVideos();
|
436 | ```
|
437 |
|
438 | ##### Patents
|
439 |
|
440 | ```javascript
|
441 | let bowshock = require("node-bowshock");
|
442 |
|
443 | //only query is mandatory, rest is optional
|
444 | bowshock.patents({ query: "temperature", concept_tags: true, limit: 5 });
|
445 | ```
|
446 |
|
447 | ##### Skymorph
|
448 |
|
449 | ```javascript
|
450 | let bowshock = require("node-bowshock");
|
451 |
|
452 | // mandatory obj id
|
453 | bowshock.skymorph.search_target_obj("J99TS7A");
|
454 |
|
455 | //argument is a key that can be found in search_target_obj data
|
456 | bowshock.skymorph.search_image(
|
457 | "|001204124410|51882.530787037|129.062741402712|4.64001695570385|128.337645|4.0726|20.70|-4.28|-11.08|n.a.|n.a.|n.a.|71.9154214757038|547.287989060186|y|"
|
458 | );
|
459 | ```
|
460 |
|
461 | ##### SSD/CNEOS
|
462 |
|
463 | ```javascript
|
464 | let bowshock = require("node-bowshock");
|
465 |
|
466 | //all args are optional
|
467 | bowshock.ssd.cad({
|
468 | date_min: "2014-03-11",
|
469 | date_max: "2016-03-11"
|
470 | //dist_min: 0.05,
|
471 | //dist_max: 0.1,
|
472 | //h_min: 22,
|
473 | //h_max: 17.75,
|
474 | //v_inf_min: 5,
|
475 | //v_inf_max: 20,
|
476 | //v_rel_min: 11.2,
|
477 | //v_rel_max: 19,
|
478 | //class: "ATE",
|
479 | //pha: false,
|
480 | //nea: false,
|
481 | //comet: false,
|
482 | //neo: true,
|
483 | //kind: "a",
|
484 | //spk: 2000433,
|
485 | //des: 433,
|
486 | //body: "Earth",
|
487 | //sort: "date",
|
488 | //limit: 5,
|
489 | //fullname: true
|
490 | });
|
491 | //all args are optional
|
492 | bowshock.ssd.fireballs({
|
493 | date_min: "2016-12-01",
|
494 | date_max: "2017-01-01",
|
495 | //energy_min: .3,
|
496 | //energy_max: 10,
|
497 | //impact_e_min: .08,
|
498 | //impact_e_max: 10,
|
499 | //vel_min: 18.5,
|
500 | //vel_max: 20,
|
501 | //alt_min: 1,
|
502 | //alt_max: 22,
|
503 | //req_loc: false,
|
504 | req_alt: false,
|
505 | req_vel: false,
|
506 | req_vel_comp: false,
|
507 | vel_comp: false,
|
508 | sort: "date",
|
509 | limit: 5
|
510 | });
|
511 |
|
512 | bowshock.ssd.nhats({
|
513 | dv: 12,
|
514 | dur: 450,
|
515 | stay: 8,
|
516 | launch: "2015-2020",
|
517 | //h: 16,
|
518 | //occ: 3,
|
519 | //spk:2000433,
|
520 | //des: "141P",
|
521 | plot: true
|
522 | });
|
523 |
|
524 | bowshock.ssd.sentry({
|
525 | spk: 2029075
|
526 | //des: 29075,
|
527 | //h_max: 50,
|
528 | //ps_min: 10,
|
529 | //ip_min: 1e-3,
|
530 | //days: 6,
|
531 | //all: false,
|
532 | //removed: false
|
533 | });
|
534 | ```
|
535 |
|
536 | ##### Trek WMTS
|
537 |
|
538 | ```javascript
|
539 | let bowshock = require("node-bowshock");
|
540 |
|
541 | bowshock.trek.mars("curiosity_ctx_mosaic");
|
542 |
|
543 | bowshock.trek.vesta("global_LAMO");
|
544 | ```
|
545 |
|
546 | ##### Techport
|
547 |
|
548 | ```javascript
|
549 | let bowshock = require("node-bowshock");
|
550 |
|
551 | bowshock.techport(4795);
|
552 | ```
|
553 |
|
554 | ## Contributors
|
555 |
|
556 | - [John Edwards](https://github.com/javajohnhub)
|
557 | <br>
|
558 |
|
559 | ## BTW What is "bowshock"?
|
560 |
|
561 | ![Screenshot](https://raw.githubusercontent.com/emirozer/bowshock/master/docs/bowshock.jpg)
|