Giter VIP home page Giter VIP logo

himawari.js's Introduction

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

[![npm][npm-image]][npm-url] [npm-image]: https://img.shields.io/npm/v/himawari.svg?style=flat-square [npm-url]: https://www.npmjs.com/package/himawari

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

Getting Started

brew install imagemagick
brew install graphicsmagick
npm i himawari

Usage

var himawari = require('himawari');

himawari({

  /**
   * The zoom level of the image. Can be 1-5 (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
   * @type {Boolean}
   */
  infrared: false,

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

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

  /**
   * 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)
    --skipempty, -s       Skip saving images that contain no useful information (i.e. "No Image") (Default: `true`)
    --infrared, -i        Capture picture on the infrared spectrum (Default: `false`)
    --help, -h            Show help

Acknowledgement

Michael Pote created a Powershell Script that inspired this library.

Example Images

License

MIT

himawari.js's People

Contributors

jakiestfu avatar ungoldman avatar emilbayes avatar

Watchers

Michael Lotkowski avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.