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

@aeroflightlabs/native-eph-reader

v0.0.4

Published

Currently only 440 version is supported, tested with `linux_p1550p2650.440` and works fine. Last time I downloaded the eph file it was available under this link: https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de440/linux_p1550p2650.440

Downloads

6

Readme

Fast node-gyp reader for JPL planetary ephemeris

Currently only 440 version is supported, tested with linux_p1550p2650.440 and works fine. Last time I downloaded the eph file it was available under this link: https://ssd.jpl.nasa.gov/ftp/eph/planets/Linux/de440/linux_p1550p2650.440

How to use

First, be sure to call loadEph440 globally with path to linux_p1550p2650.440 before doing anything else with the library

Planetary mapping is as follows:

1 = mercury barycenter
2 = venus barycenter
3 = earth
4 = mars barycenter
5 = jupiter barycenter
6 = saturn barycenter
7 = uranus barycenter
8 = neptune barycenter
9 = pluto barycenter
10 = moon
11 = sun
12 = solar-system barycenter
13 = earth barycenter

After that, following functions are available:


getBulk

getBulk(input: GetBulkInput[], output: number[]): void

Gets positions of elements in relation to other elements. The result is stored in the output parameter as series of 3d vectors, interleaved position and velocity, which are stored as 3 numbers, so the output array must have size equal to input.length * 6. For example in case of input having 2 inputs A and B, the output format will be:

[
  A.position.x, A.position.y, A.position.z,
  A.velocity.x, A.velocity.y, A.velocity.z,
  B.position.x, B.position.y, B.position.z,
  B.velocity.x, B.velocity.y, B.velocity.z
]

The format is clear, but it's pretty strange, it's all because of performance, as the main reason of this library existence is performance. The position returned is in AU and velocity in AU/Day, to have the most raw data.


getGravityFlux

getGravityFlux(where: ephvec3, whenTimestamp: number, output: ephvec3): void

  • output must be an array of 3 numbers and result stored in it will be in format:
[
  acceleration.x, acceleration.y, acceleration.z
]
  • where is expected to be in meters, acceleration returned is in meters/seconds^2,
  • whenTimestamp is a unix timestamp with fractions support

integrateGravity

integrateGravity(startPosition: ephvec3, startVelocity: ephvec3, startTime: number, endTime: number, timeStep: number, outputPosition: ephvec3, outputVelocity: ephvec3): void

  • outputPosition must be an array of 3 numbers and result stored in it will be in format:
[
  position.x, position.y, position.z
]

outputVelocity must be an array of 3 numbers and result stored in it will be in format:

[
  velocity.x, velocity.y, velocity.z
]
  • startPosition and startVelocity are expected to be in meters
  • startTime and endTime are unix timestamps with fractions support
  • timeStep is the time resolution to use in seconds, higher means faster but lower precision
  • outputPosition is saved as meters
  • outputVelocity is saved meters/second

generateTrajectoryForecast

generateTrajectoryForecast(startPosition: ephvec3, startVelocity: ephvec3, startTime: number, endTime: number, timeStep: number, outputPositionArray: number[]): void

  • outputPositionArray must be an array of numbers with count equal ((endTime-startTime) * 3) / timeStep and result stored in it will be in format:
[
  position.x, position.y, position.z,
  ...
]
  • startPosition and startVelocity are expected to be in meters
  • startTime and endTime are unix timestamps with fractions support
  • timeStep is the time resolution to use in seconds, higher means faster but lower precision
  • outputPositionArray is saved as meters