Home

Awesome

astronomia

An astronomical library

NPM version Build Status

This library is a translation of meeus from Go to Javascript and contains selected algorithms from the book "Astronomical Algorithms" by Jean Meeus, following the second edition, copyright 1998, with corrections as of August 10, 2009.

Additional algorithms not covered in the book have been added.

Installation

npm install --save astronomia

Browser usage

Make sure you add <meta charset="UTF-8"> to your HTML or at least include your bundle with <script src="your-bundle.js" charset="UTF-8"></script> then this package runs in modern browsers.

Usage

For documentation of the different packages please take a look at the source code as well as at the tests.

Packages

Using a single package

If you require a small footprint in your final application, each of the provided packages can be used as a single one:

// instead of
const base = require('astronomia').base
// use
const base = require('astronomia/base')

ES6 Syntax

// instead of
import {base} from 'astronomia'
// use
import base from 'astronomia/base'

To access dedicated VSOP87 data sets use e.g.

const {vsop87Bvenus} = require('astronomia').data
// or
const vsop87Bvenus = require('astronomia/data/vsop87Bvenus')

Running tests

npm test

to even run very long lasting tests, do

SLOWTESTS=1 npm test

In local browser

npm run zuul -- --local 3000

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license.

You are also implicitly verifying that all code is your original work or correctly attributed with the source of its origin and licence.

License

MIT Licensed

See LICENSE for more info.

References