Name: himawari.js
Owner: ABC News
Description: Download real-time images of Earth from the Himawari-8 satellite
Forked from: jakiestfu/himawari.js
Created: 2017-03-29 04:25:51.0
Updated: 2017-04-27 20:27:47.0
Pushed: 2016-02-18 03:55:57.0
Homepage: http://jakiestfu.github.io/himawari.js/demo/
Size: 79
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Download real-time images of Earth from the Himawari-8 satellite
Himawari 8 is a geostationary weather satellite deployed by the Japan Meteorological Agency. It takes photographs of Earth every 10 minutes.
install imagemagick
install graphicsmagick
i himawari
If you would like to generate videos, ffmpeg
is also required.
install ffmpeg
himawari = require('himawari');
wari({
*
The zoom level of the image. Can be 1-5 for non-infrared, and 1-3 for infrared (default: 1)
Each zoom level requires more images to be downloaded and therefore stitched
together. Higher zoom yields a higher resolution image.
@type {Number}
/
om: 1,
*
The time of the picture desired. If you want to get the latest image, use 'latest'
@type {String|Date}
/
te: 'latest', // Or new Date() or a date string
*
Turns on logging
@type {Boolean}
/
bug: false,
*
If set to true, an image on the infrared light spectrum will be generated. Please note that
infrared only supports zooms up to 3
@type {Boolean}
/
frared: false,
*
The location to save the resulting image
@type {String}
/
tfile: '/path/to/output/earth.jpg',
*
Set to true to parallelize tile downloads. Can be CPU intensive but decreases time to download images.
@type {Boolean}
/
rallel: false,
*
Skip empty images from being saved
@type {Boolean}
/
ipEmpty: true,
*
The max duration in milliseconds before requests for images and data times out
@type {Number}
/
meout: 30000,
*
If true, only prints the URLs of the images that would have been downloaded
@type {Boolean}
/
ls: false,
*
A success callback if the image downloads successfully
@type {Function}
/
ccess: function () { process.exit(); },
*
A callback if the image cannot be downloaded or saved
@type {Function}
@param {Object} err An error object or information surrounding the issue
/
ror: function (err) { console.log(err); },
*
A callback that is fired every time a tile has been downloaded.
@param {Object} info Information about the download such as filepath, part, and total images
/
unk: function (info) {
console.log(info.outfile + ': ' + info.part + '/' + info.total);
There is also a command-line interface available if you install it with -g
.
i -g himawari
This installs a program called himawari
that can be used like so:
e: himawari [options]
--zoom, -z The zoom level of the image. Can be 1-5. (Default: `1`)
--date, -d The time of the picture desired. If you want to get the latest image, use 'latest'. (Default: `"latest"`)
--debug, -l Turns on logging. (Default: `false`)
--outfile, -o The location to save the resulting image. (Default: `"himawari-{date}.jpg"` in current directory)
--parallel, -p Parallelize downloads for increased speeds (can be CPU intensive)
--skipempty, -s Skip saving images that contain no useful information (i.e. "No Image") (Default: `true`)
--timeout, -t The max duration in milliseconds before requests for images and data times out (Default: `30000`)
--urls, -u Only print the URLs of the images that would have been downloaded (Default: `false`)
--infrared, -i Capture picture on the infrared spectrum (Default: `false`)
--version, -v Prints the version of the package
--help, -h Show help
There are two example files that showcase how Himawari.js can be used. The first, basic.js
, is to simply be executed and will download the latest image of earth and save it to your Desktop.
The second, video.js
, will get a particular date (one where it starts off all black), and will decrement 10 minutes from that date until it has been 24 hours. The resulting images will be saved to a directory, and then piped to ffmpeg
which will stitch the images together in a lovely video for you to oogle over.
MIT