sidereal-ephemeris
v0.0.5
Published
Sidereal-Ephemeris is a JavaScript library designed to handle ephemerides from the [JPL Solar System Dynamics Group](https://ssd.jpl.nasa.gov/).
Downloads
11
Readme
Sidereal-Ephemeris
Sidereal-Ephemeris is a JavaScript library designed to handle ephemerides from the JPL Solar System Dynamics Group.
It stores these ephemerides in highly compressed binary files and provides methods to read and utilize this data efficiently.
Features
- Compressed Ephemerides: Store and manage JPL ephemerides in compact binary formats.
- Efficient Access: Methods to efficiently read and utilize ephemeris data.
- Compatibility: Designed to be used in conjunction with the Sidereal library but can be used independently.
Installation
To install Sidereal-Ephemeris, use npm:
npm install sidereal-ephemeris
Basic usage
Sidereal-Ephemeris is primarily meant to be used with the Sidereal library.
With Sidereal
To use Sidereal-Ephemeris with Sidereal, simply import the desired ephemerides using the useEphemeris method. The Sidereal library will handle the rest.
import Sidereal from "sidereal";
import { loadEphemeris } from "sidereal-ephemeris";
const sidereal = new Sidereal();
// Load ephemerides for specific celestial bodies
const venusEphemeris = loadEphemeris('venus');
const earthEphemeris = loadEphemeris('earth');
sidereal.useEphemeris([venusEphemeris, earthEphemeris]);
const venus = sidereal.planet('venus');
Standalone
Sidereal-Ephemeris can also be used independently to access and manage ephemerides data. Here’s how you can load and use ephemerides directly:
const marsEphemeris = loadEphemeris('mars');
const {x,y,z} = marsEphemeris.getPositionAtDate(new Date());
console.log(`Current ${marsEphemeris.name} coordinates:`);
console.log(x,y,z);
Result
Current mars coordinates:
1.18639001969063 0.8157971635742206 -0.012003712610288913
License
Sidereal is licensed under the MIT License.