Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

High Precision Ephemeris

NotificationsYou must be signed in to change notification settings

rstub/swephR

Repository files navigation

R build statusCoverage statusCRAN statusDownloadsDependencies

swephR

The goal of swephR is to provide an R interface to theSwissEphemeris. The Swiss Ephemeris is ahigh precision ephemeris based upon the DE431 ephemeris from NASA’s JPL.It covers the time range 13201 BCE to 17191 CE.

Installation

You can install the released version of swephR fromCRAN with:

install.packages("swephR")

Intermediate releases can also be obtained fromhttps://rstub.r-universe.dev/:

install.packages('swephR',repos= c('https://rstub.r-universe.dev','https://cloud.r-project.org'))

This package uses the semi-analytic theory by Steve Moshier. For fasterand more accurate calculations, the compressed Swiss Ephemeris data isavailable in theswephRdata package. To access this data package, run

install.packages("swephRdata",repos="https://rstub.r-universe.dev",type="source")

The size of theswephRdata package is approximately 115 MB. The usercan also use the original JPL DE431 data.

Example

To compute the position of celestial body or star with SE (SwissEphemeris), you do the following steps:

library(swephR)swe_version()#> [1] "2.10.03"

For a specific date, compute the Julian day number (in below example:J2000.0, 1 January 2000 at 12:00 UT):

year<-2000month<-1day<-1hour<-12jdut<- swe_julday(year,month,day,hour,SE$GREG_CAL)jdut#> [1] 2451545

Compute (using Moshier ephemeris) the positions (longitude, latitude,distance, longitude speed and latitude speed) of a planet or othercelestial bodies (in below example: the Sun):

ipl<-SE$SUNiflag<-SE$FLG_MOSEPH+SE$FLG_SPEEDresult<- swe_calc_ut(jdut,ipl,iflag)result#> $return#> [1] 260#>#> $xx#> [1]  2.803689e+02  2.323265e-04  9.833276e-01  1.019432e+00 -8.922802e-07#> [6] -7.339410e-06#>#> $serr#> [1] ""

or a fixed star (in below example: Sirius):

starname="sirius"result<- swe_fixstar2_ut(starname,jdut,iflag)result#> $return#> [1] 260#>#> $starname#> [1] "Sirius,alCMa"#>#> $xx#> [1]  1.040853e+02 -3.960507e+01  5.439322e+05  4.643164e-05 -7.119376e-05#> [6] -4.130539e-03#>#> $serr#> [1] ""

The current R interface is modeled after the C interface. It istherefore often helpful to consult thegeneraldocumentation andprogrammer’sdocumentation for theSwiss Ephemeris.

Feedback

All feedback (bug reports, security issues, feature requests, …) shouldbe provided asissues.

About

High Precision Ephemeris

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp