npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-ephem

v1.4.0

Published

Calculator/parser for JPL ephemeris data

Downloads

9

Readme

node-ephem

Parse JPL DE planetary ephemerides and calculate the position of planets (and moon) at a given time.

This module is based on Project Pluto's code for calculating planetary positions from JPL ephemerides.

Required

This module uses publicly available planetery ephemeride files which can be downloaded from NASA's Jet Propulsion Laboratory FTP server. More information on which file to chose can be found here.

Usage

Require the module.

var ephem = require('node-ephem');

Load ephemerides which you downloaded, by providing a path to it:

var e430 = ephem.load('./eph/linux_p1550p2650.430');

Find Mars, relative to the Sun, at this instant:

var position = e430.find(ephem.bodies.MARS, ephem.bodies.SUN, ephem.julian(new Date));

Find RA/Dec of Neptune at this moment, adjusted for light-time:

var radec = ephem.equatorial(e430.observe(ephem.bodies.MERCURY, ephem.bodies.EARTH, ephem.julian(new Date)));

Functions

node-ephem exports:

Function | Parameters | Description ---|---|--- load | path | Load planetary ephemerides file, returns ephemeris object julian | date | convert Date to Julian day (J2000 epoch, TT) equatorial | position | Cartesian to Equаtorial

ephemeris object:

Function | Parameters | Description ---|---|--- find | body, observer, time | Find the position of body looking from observer at time observe | body, observer, time | Find position of body adjusted for light-time status | | Returns constants from loaded epehmeris file and status

Planets

node-ephem provides a convenient name to code mapping via exported constants

Planet | Code --- | --- ephem.bodies.MERCURY | 1 ephem.bodies.VENUS | 2 ephem.bodies.EARTH | 3 ephem.bodies.MARS | 4 ephem.bodies.JUPITER | 5 ephem.bodies.SATURN | 6 ephem.bodies.URANUS | 7 ephem.bodies.NEPTUNE | 8 ephem.bodies.PLUTO | 9 ephem.bodies.MOON | 10 ephem.bodies.SUN | 11

Testrunner

A testrunner is included which executes the test files available for DE files. Download the testpo file and place in the same directory as the ephemeris file, then run:

node testrunner.js

Follow the instructions.