GithubHelp home page GithubHelp logo

mkretlow / vsop87.jl Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 8.08 MB

Julia wrapper to the Fortran implementation of the planetary solutions VSOP87 by Bretagnon & Francou.

License: Other

Julia 100.00%
astrodynamics orbital-mechanics ephemerides planets

vsop87.jl's Introduction

VSOP87.jl Build Status

This is a Julia wrapper to the Fortran VSOP87 implementation of the planetary solutions VSOP87.

Install

VSOP87.jl can then be installed through Julia's package manager. On Linux and macOS you need to have either Gfortran or the Intel Fortran Compiler installed to be able to build the binary dependencies.

pkg> add "https://github.com/mkretlow/VSOP87.jl.git"

Usage

julia> using VSOP87

# vsop87(tjd::Float64, ivers::Signed, ibody::Signed, prec::Float64 = 0.0)

julia> rar,ierr = vsop87(tjd, ivers, ibody, prec)

Args

tdj,ivers,ibody,prec :  Julian date, VSOP version (main,A,B,C,D,E series), body select code, preset precision

The code ivers of the version is :
iv = 0 for the main version VSOP87 :  Heliocentric elliptic elements J2000
iv = 1 for the version VSOP87A     :  Heliocentric rectangular variables J2000
iv = 2 for the version VSOP87B     :  Heliocentric spherical variables J2000
iv = 3 for the version VSOP87C     :  Heliocentric rectangular variables of date
iv = 4 for the version VSOP87D     :  Heliocentric spherical variables of date
iv = 5 for the version VSOP87E     :  Barycentric rectangular variables J2000

The codes of the bodies are :
0 : Sun
1 : Mercury
2 : Venus
3 : Earth
4 : Mars
5 : Jupiter
6 : Saturn
7 : Uranus
8 : Neptune
9 : Earth-Moon barycenter

prec : Preset of desired relative precision (full or reduced precision of result).
       If prec is equal to 0.0 then the precision is the precision p0 of the
       complete solution VSOP87 (full precision). That's the default.
       Mercury    p0 =  0.6 10**-8
       Venus      p0 =  2.5 10**-8
       Earth      p0 =  2.5 10**-8
       Mars       p0 = 10.0 10**-8
       Jupiter    p0 = 35.0 10**-8
       Saturn     p0 = 70.0 10**-8
       Uranus     p0 =  8.0 10**-8
       Neptune    p0 = 42.0 10**-8

Other values (let's say between p0 and 10^-2) are possible.
For more details see header of deps/vsop87.f.

Return

rar  : 6-element Array{Float64} with results, depending on value of ivers

ierr : Error return code
    0: no error
    1: file error (check up ivers index)
    2: file error (check up ibody index)
    3: precision error (check up prec parameter)
    4: reading file error

Example

# Heliocentric rectangular coordinates and velocities of Earth for JD2451545.0 (2000-01-01.5 TDB):

julia> vsop87(2451545.0, 1, 3)
([-0.177135, 0.967242, -3.90003e-6, -0.0172076, -0.00315879, 1.06867e-7], 0)

vsop87.jl's People

Contributors

mkretlow avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.