/js-erfa

A port of the erfa astronomical library to js, using emscripten

Primary LanguageJavaScriptOtherNOASSERTION

What is jsERFA

This is a Javascript implementation/wrapper of the liberfa library. liberfa is a collection of key algorithms for astronomy, and is in turn, based on the SOFA library published by the International Astronomical Union (IAU).

The core ERFA functions have been compiled to javascript using Emscripten and have been wrapped accordingly to hide all the C like pointer behaviours.

Where functions return multiple results via referenced arguments, they have been wrapped up into simple objects.

Building

A pre-compiled version of liberfa.js had been provided. Emscripten is required should you wish to recompile liberfa.js from the upstream source.

The build_erfa_js.sh script will clone the erfa library into the working directory and compile liberfa.js for you.

Tests

The tests are based on the supplied upstream tests found in t_erfa_c.c

As the tests only check for basic correctness of the functions, it may not be a good idea to try and fly any spacecraft with this code.

Licence

This code makes use of liberfa, the license for this is included in LICENCE_ERFA.txt.