• Stars
    star
    117
  • Rank 301,828 (Top 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

An astronomical library

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.

  • Chrome: >=45
  • Firefox: >= 45
  • Safari: >=10
  • Mobile Safari: >=10
  • Edge: >=13
  • IE: >=10 (needs core-js/es6 polyfill)

Usage

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

Packages

  • angle: Angular Separation.
  • apparent: Apparent Place of a Star.
  • apsis: Perigee and apogee of the Moon.
  • base: Basic constants and methods
  • binary: Binary Stars.
  • circle: Smallest Circle containing three Celestial Bodies.
  • conjunction: Planetary Conjunctions.
  • coord: Transformation of Coordinates. Ecliptic, Equatorial, Horizontal, Galactic coordinates.
  • deltat: Dynamical Time and Universal Time.
  • eclipse: Eclipses.
  • elliptic: Elliptic Motion.
  • elementequinox: Reduction of ecliptical Elements from one Equinox to another one.
  • eqtime: Equation of time.
  • fit: Curve Fitting.
  • globe: Ellipsoid, Globe, Coordinates of Earth Observer.
  • illum: Illuminated Fraction of the Disk and Magnitude of a Planet.
  • interpolation: Interpolation of equidistant values (linear, len3, len5); Lagrange Polynoms
  • iterate: Iteration.
  • jm: Jewish and Moslem Calendars.
  • julian: Julian Days, Gregorian, Julian calendar functions.
  • jupiter: Ephemeris for Physical Observations of Jupiter.
  • jupitermoons: Positions of the Satellites of Jupiter.
  • kepler: Equation of Kepler.
  • line: Bodies in Straight Line
  • mars: Ephemeris for Physical Observations of Mars.
  • moon: Ephemeris for Physical Observations of the Moon.
  • moonillum: Illuminated Fraction of the Moon's Disk.
  • moonmaxdec: Maximum Declinations of the Moon.
  • moonnode: Passages of the Moon through the Nodes.
  • moonphase: Phases of the Moon.
  • moonposition: Position of the Moon.
  • nearparabolic: Near-parabolic Motion.
  • node: Passages through the Nodes.
  • nutation: Nutation and the Obliquity of the Ecliptic.
  • parabolic: Parabolic Motion.
  • parallactic: The Parallactic Angle, and three other Topics.
  • parallax: Correction for Parallax.
  • perihelion: Planets in Perihelion and Aphelion.
  • planetelements: Elements of Planetary Orbits.
  • planetposition: Ecliptic position of planets by full VSOP87 theory.
  • pluto: Pluto.
  • precess: Precession.
  • refraction: Atmospheric Refraction.
  • rise: Rising, Transit, and Setting.
  • saturnmoons: Positions of the Satellites of Saturn.
  • saturnring: The Ring of Saturn.
  • semidiameter: Semidiameters of the Sun, Moon, and Planets.
  • sexagesimal: Sexagesimal classes.
  • sidereal: Sidereal Time at Greenwich.
  • solar: Solar Coordinates.
  • solardisk: Ephemeris for Physical Observations of the Sun.
  • solarxyz: Rectangular Coordinates of the Sun.
  • solstice: Equinoxes, Solstices and Solarterms.
  • stellar: Stellar Magnitudes.
  • sundial: Calculation of a Planar Sundial.
  • sunrise: Compute rise, noon, set of the Sun for an earth observer.

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

  • LICENSE
  • meeus
  • VSOP87 dataset ftp://cdsarc.u-strasbg.fr/pub/cats/VI/81

More Repositories

1

date-holidays

worldwide holidays
JavaScript
918
star
2

gdal2tiles-leaflet

Generate raster image tiles for use with leaflet.
Python
478
star
3

leaflet-rastercoords

Leaflet plugin for plain image map projection to display large images using tiles generated with gdal2tiles-leaflet
JavaScript
120
star
4

md-fileserver

Locally view markdown files in a browser.
JavaScript
73
star
5

date-chinese

Chinese Calendar
JavaScript
47
star
6

date-holidays-parser

parser for worldwide holidays
JavaScript
46
star
7

markedpp

Preprocessor for markdown files
JavaScript
32
star
8

url-safe-base64

url safe base64 en- and decoding
JavaScript
26
star
9

self-signed-certs

Generate self signed ssl certificates with your own root CA certificate
Shell
26
star
10

serialize-to-js

serialize objects to javascript
JavaScript
24
star
11

safer-eval

a safer eval
JavaScript
20
star
12

bandwidth-limiter-http-proxy

Simple HTTP/HTTPS proxy to simulate slow network conditions.
JavaScript
20
star
13

offline-npm

hasslefree npm pack including all dependencies for offline installation with npm install
JavaScript
20
star
14

ansible-vault

An ansible vault compatible en- and decryption library for node
JavaScript
18
star
15

openflights-data

REST microservice for openflights airports and airlines data
JavaScript
16
star
16

debug-level

debug with levels
JavaScript
14
star
17

ua-parser2

Improved user-agent parser
JavaScript
13
star
18

affinefit

Fit an affine transformation to given points
JavaScript
11
star
19

named-regexp-groups

Regular expressions with named capture groups and named back-references
JavaScript
10
star
20

date-holidays-ical

Generate ical (.ics) files from date-holidays data
JavaScript
9
star
21

date-easter

Calculates Easter for a given year
JavaScript
8
star
22

weeknumber

week number systems for Gregorian year according to ISO-8601 or starting on sundays, saturdays
JavaScript
7
star
23

mock-http

Mock http request response
JavaScript
7
star
24

ua-parser-caps

Adding capabilities to ua-parser
JavaScript
5
star
25

vorwahlen

JavaScript
5
star
26

react-pure-css

pure-css react components
CSS
4
star
27

varnish-examples

A collection of varnish examples
Perl
4
star
28

markdown-it-admon

Plugin to create admonitions for markdown-it markdown parser
HTML
4
star
29

parseurl-fast

A fast url parser
JavaScript
3
star
30

sider-mem

An in-memory datastore in node for Redisβ„’ compatible clients
JavaScript
2
star
31

connect-chain-if

Compose a new middleware from a chain of middlewares to be called in series
JavaScript
2
star
32

turndown-cli

a cli for turndown with support for gfm
JavaScript
2
star
33

clones

should deep clone everything even global objects, functions, circularities, ...
JavaScript
2
star
34

snippets

A collection of javascript snippets
JavaScript
2
star
35

package-lock

(Re-)Build package-lock.json or npm-shrinkwrap.json file from node_modules folder
JavaScript
2
star
36

configg

A node configuration manager
JavaScript
2
star
37

xml-vs-js

Convert XML/ HTML to Javascript and vice versa
JavaScript
2
star
38

date-bengali-revised

Revised Bengali Calendar
JavaScript
2
star
39

astronomia-bundle-example

bundling example for astronomia package
JavaScript
1
star
40

yakbaktape

Read yakbak tape files
JavaScript
1
star
41

caldate

calendar date for date-holidays
JavaScript
1
star
42

at-line

get calling function, filename, line-number from error stack trace
JavaScript
1
star
43

date-holidays-react-example

example app running date-holidays with react
JavaScript
1
star
44

macbook-lubuntu-install

Shell
1
star
45

mongoose-reconnect

Reconnect mongoose connections
JavaScript
1
star
46

microformat

A format utility for node and browser
JavaScript
1
star
47

is-password-pwned

Check password against pwnedpasswords.com using k-anonimity model
JavaScript
1
star
48

imgviewer

A simple image viewer for local photos to display in a browser.
JavaScript
1
star
49

secure-identifier

secure identifier for usernames
JavaScript
1
star
50

undici-noproxy

JavaScript
1
star
51

vault-nacl

A symmetric encrypted vault using tweetnacl elliptic curves
JavaScript
1
star
52

signed-token-csrf

CSRF connect middleware using signed tokens
JavaScript
1
star
53

confluencer

convert markdown to copy & paste ready confuence rich text
JavaScript
1
star
54

signed-token

signed HMAC crypto token
JavaScript
1
star