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