• Stars
    star
    1,806
  • Rank 25,043 (Top 0.6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Download real-time images of Earth from the Himawari-8 satellite

Download real-time images of Earth from the Himawari-8 satellite

npm

Himawari 8 is a geostationary weather satellite deployed by the Japan Meteorological Agency. It takes photographs of Earth every 10 minutes.

Getting Started

brew install imagemagick
brew install graphicsmagick
npm i himawari

If you would like to generate videos, ffmpeg is also required.

brew install ffmpeg

Usage

var himawari = require('himawari');

himawari({

  /**
   * 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}
   */
  zoom: 1,

  /**
   * The time of the picture desired. If you want to get the latest image, use 'latest'
   * @type {String|Date}
   */
  date: 'latest', // Or new Date() or a date string

  /**
   * Turns on logging
   * @type {Boolean}
   */
  debug: 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}
   */
  infrared: false,

  /**
   * The location to save the resulting image
   * @type {String}
   */
  outfile: '/path/to/output/earth.jpg',

  /**
   * Set to true to parallelize tile downloads. Can be CPU intensive but decreases time to download images.
   * @type {Boolean}
   */
  parallel: false,

  /**
   * Skip empty images from being saved
   * @type {Boolean}
   */
  skipEmpty: true,

  /**
   * The max duration in milliseconds before requests for images and data times out
   * @type {Number}
   */
  timeout: 30000,

  /**
   * If true, only prints the URLs of the images that would have been downloaded
   * @type {Boolean}
   */
  urls: false,

  /**
   * A success callback if the image downloads successfully
   * @type {Function}
   */
  success: 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
   */
  error: 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
   */
  chunk: function (info) {
    console.log(info.outfile + ': ' + info.part + '/' + info.total);
  }
});

Command Line Interface

There is also a command-line interface available if you install it with -g.

npm i -g himawari

This installs a program called himawari that can be used like so:

Usage: 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

Acknowledgements

Example Images

Example Scripts

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.

Licensing

MIT

More Repositories

1

Snap.js

A Library for creating beautiful mobile shelfs in Javascript (Facebook and Path style side menus)
JavaScript
5,990
star
2

Medium.js

A tiny JavaScript library for making contenteditable beautiful (Like Medium's editor)
JavaScript
4,388
star
3

Behave.js

A lightweight, cross browser library for adding IDE style behaviors to plain text areas
JavaScript
1,741
star
4

Blur.js

blur.js is a jQuery plugin that produces psuedo-transparent blurred elements over other elements.
JavaScript
926
star
5

Mention.js

Lightweight wrapper for adding @user mention functionality to Twitter Bootstraps Typeahead plugin
JavaScript
751
star
6

off-the-rip

Downloads audio, artwork, and metadata from Soundcloud
JavaScript
455
star
7

Ripple.js

Adds Material style ripple to anything
JavaScript
277
star
8

AppScroll.js

AppScroll is a tiny (< 100 lines) JS library that fixes the "website dragging" issue caused on iDevices
JavaScript
251
star
9

Context.js

Contextual Menus with Twitters Bootstrap.css
JavaScript
249
star
10

Youtube-TV

A small, slick, library independent YouTube User/Playlist player
JavaScript
203
star
11

Sparky.js

Sparky.js is an idea about client-side Javascript organization.
JavaScript
197
star
12

Submodal

Add submodals to Bootstrap 3.x modals
JavaScript
184
star
13

stability-ts

DreamStudio Client written in TypeScript
TypeScript
156
star
14

Bits

Bits Editor is your personal playground to develop in HTML, CSS, and Javascript, all from your own server.
JavaScript
87
star
15

Github-Mobile

GitHub Mobile
79
star
16

Ratchet-Vine

A Ratchet template that attempts to recreat the beautiful Vine app
JavaScript
59
star
17

Shadow

An internal analytics engine used to track meta data and user relations for objects in your application
PHP
55
star
18

Blur.js-II

Javascript library for blurring HTML content with CSS and SVG
JavaScript
50
star
19

Throttle

A PHP function that can be used to throttle any actions you want, as to prevent flooding.
PHP
30
star
20

WebFontGenerator

This is a class to generate CSS3 web fonts with Font Forge and PHP
PHP
25
star
21

iTunes-Colors

Recreates the color-effect used in iTunes
25
star
22

Scenario.js

A lightweight A/B Testing library for use with MixPanel
JavaScript
21
star
23

Slow.js

slow.js is a small script used to slow down CSS transition durations by a predefined factor on a key press event.
JavaScript
21
star
24

Repo-Downloader

A small PHP class to download repo zipballs from GitHub
PHP
20
star
25

Architect.js

A simple scaffold for your client side JavaScript.
JavaScript
17
star
26

Formula.js

Turn hyperlinks into ajax requests, making links as powerful as forms.
JavaScript
14
star
27

Gift.js

A Javascript library for wrapping your websites up as a present
JavaScript
10
star
28

Rap

A wicked simple comment system
JavaScript
8
star
29

ParseObject.js

Simple function to parse a string and compare it against an object.
JavaScript
8
star
30

Hatchet

Hatchet is a mobile client for Y Combinator Hacker News, and was built with Ratchet. Currently, it is tailored for iOS devices.
JavaScript
7
star
31

stfu

Tools and scripts used to broaden my reach online
CSS
5
star
32

Sparky.js-Website

This is the website for Sparky.js
PHP
4
star
33

Brazzed

Add the Brazzers logo to any image for intensity...
PHP
4
star
34

sams-calendar-program

My Grandfathers Calendar Program read from two floppy disks.
Batchfile
3
star
35

stemmy

An experimental Typescript wrapper for demucs
TypeScript
2
star
36

Thought.js

Create a beautiful message for someone you care about.
JavaScript
2
star
37

trill

A multi-resource html5 audio player
1
star
38

Not-Enough-Juans

We need more Juans
JavaScript
1
star