novas: github.com/pebbe/novas Index | Files

package novas

import "github.com/pebbe/novas"

Package novas provides an interface to the Naval Observatory Vector Astrometry Software (NOVAS) [astronomy, astrometry, celestial mechanics, sun, moon, planets, stars].

NOVAS homepage: http://aa.usno.navy.mil/software/novas/

You need a planetary ephemeris file JPLEPH. You can download it here: http://pkleiweg.home.xs4all.nl/jpleph/

Put it in this directory:

$GOPATH/src/github.com/pebbe/novas/jpleph/

You can put the file in a different location. Then you need to provide the full path at run time in the environment variable JPLEPH, or you can set the full path at build time of the program that imports the package, like this:

go build -ldflags "-X github.com/pebbe/novas.JPLephFile=/opt/opt_local/novas/JPLEPH" program.go

Index

Package Files

body.go doc.go jpleph.go novas.go place.go planet.go star.go time.go tools_body.go tools_moon.go tools_planets.go tools_sun.go

Constants

const (
    // Types of refraction correction
    REFR_NONE     = RefractType(0)
    REFR_STANDARD = RefractType(1)
    REFR_PLACE    = RefractType(2)
)
const (
    AU = float64(149597870.700) // Astronomical Units to kilometers
)

Variables

var (
    Leap_secs = 33
    UT1_UTC   = float64(-0.387845)
)
var (
    Accuracy = 0 // 0 = full acccuray; 1 = reduced acccuray
)
var (
    JPLephFile = ""
)

func MoonPhase Uses

func MoonPhase(t Time) float64

Return the current phase of the moon as an angle.

type Body Uses

type Body struct {
    // contains filtered or unexported fields
}

func Jupiter Uses

func Jupiter() *Body

Create planet Jupiter.

func Mars Uses

func Mars() *Body

Create planet Mars.

func Mercury Uses

func Mercury() *Body

Create planet Mercury.

func Moon Uses

func Moon() *Body

Create solar body Moon.

func Neptune Uses

func Neptune() *Body

Create planet Neptune.

func NewStar Uses

func NewStar(starname, catalog string, starnumber int64, ra, dec, promora, promodec, parallax, radialvelocity float64) *Body

Create a star

starname:       name of celestial object
catalog:        catalog designator (e.g., HIP)
starnumber:     integer identifier assigned to object
ra:             ICRS right ascension (hours)
dec:            ICRS declination (degrees)
promora:        ICRS proper motion in right ascension (milliarcseconds/year)
promodec:       ICRS proper motion in declination (milliarcseconds/year)
parallax:       parallax (milliarcseconds)
radialvelocity: radial velocity (km/s)

func Pluto Uses

func Pluto() *Body

Create planet Pluto.

func Saturn Uses

func Saturn() *Body

Create planet Saturn.

func Sun Uses

func Sun() *Body

Create solar body Sun.

func Uranus Uses

func Uranus() *Body

Create planet Uranus.

func Venus Uses

func Venus() *Body

Create planet Venus.

func (*Body) App Uses

func (p *Body) App(t Time) BodyData

Compute the apparent place of an object.

func (*Body) Disc Uses

func (b *Body) Disc(t Time) float64

Return the percentage of the planet disc that is illuminated. Useful for moon and inner planets.

func (*Body) High Uses

func (p *Body) High(t Time, geo *Place, precision time.Duration, refr RefractType) (Time, BodyTopoData, error)

Compute the time of highest position in the sky of a body. Returns an error if the body doesn't goes up then down within 24 hours from the time given.

func (*Body) Low Uses

func (p *Body) Low(t Time, geo *Place, precision time.Duration, refr RefractType) (Time, BodyTopoData, error)

Compute the time of lowest position in the sky of a body. Returns an error if the body doesn't goes down then up within 24 hours from the time given.

func (*Body) Name Uses

func (b *Body) Name() string

Get the name of a body.

func (*Body) Rise Uses

func (p *Body) Rise(t Time, geo *Place, dip float64, precision time.Duration, refr RefractType) (Time, BodyTopoData, error)

Compute the time of rise of a body above the dip angle. Returns an error if the body doesn't rise above dip within 24 hours from the time given.

func (*Body) Set Uses

func (p *Body) Set(t Time, geo *Place, dip float64, precision time.Duration, refr RefractType) (Time, BodyTopoData, error)

Compute the time of set of a body below the dip angle. Returns an error if the body doesn't set below dip within 24 hours from the time given.

func (*Body) Topo Uses

func (p *Body) Topo(t Time, geo *Place, refr RefractType) BodyTopoData

Compute the topocentric place of a solar system body.

type BodyData Uses

type BodyData struct {
    RA   float64 // Right ascension
    Dec  float64 // Declination
    Dis  float64 // Distance in AU
    ELon float64 // Ecliptic longitude
    ELat float64 // Ecliptic latitude
}

Information returned by function (*Body) App(Time)

type BodyTopoData Uses

type BodyTopoData struct {
    Dis float64 // Distance in AU
    Az  float64 // Azimuth
    Alt float64 // Altitude
}

Information returned by function (*Body) Topo(Time, *Place, RefractType)

type EphData Uses

type EphData struct {
    DE_num int     // number of DE file
    JD_beg float64 // begin date of DE file in jd
    JD_end float64 // end date of DE file in jd
}

func EphInfo Uses

func EphInfo() EphData

Return info on current ephemeris file

func (EphData) String Uses

func (e EphData) String() string

type Place Uses

type Place struct {
    // contains filtered or unexported fields
}

func NewPlace Uses

func NewPlace(latitude, longitude, height, temperature, pressure float64) *Place

Defines an observer location, somewhere on earth.

func (Place) String Uses

func (p Place) String() string

type RefractType Uses

type RefractType int

type Time Uses

type Time struct {
    time.Time
    // contains filtered or unexported fields
}

Type Time holds time in a format needed by the C Novas functions.

Type Time is a struct that includes a time.Time object. All methods of time.Time are available. To set the time of an object Time t through assignement, use: t.Time =

func Autumn Uses

func Autumn(year int, precision time.Duration) Time

Computes the time of the start of autumn in the given year.

func Date Uses

func Date(year, month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to

yyyy-mm-dd hh:mm:ss + nsec nanoseconds

in the appropriate zone for that time in the given location.

See godoc on time.Date for details.

func Julian Uses

func Julian(jd float64) Time

Julian returns the Time corresponding to the given Julian date

func MoonPhaseNext Uses

func MoonPhaseNext(t Time, phase float64, precision time.Duration) Time

Return the time of the next lunar phase, expressed as an angle. 0 = new moon, 90 = first quarter, 180 = full moon, 270 = last quater.

func Now Uses

func Now() Time

Now returns the current local time.

func Spring Uses

func Spring(year int, precision time.Duration) Time

Computes the time of the start of spring in the given year.

func Summer Uses

func Summer(year int, precision time.Duration) Time

Computes the time of the start of summer in the given year.

func Winter Uses

func Winter(year int, precision time.Duration) Time

Computes the time of the start of winter in the given year.

func (*Time) ToJulian Uses

func (t *Time) ToJulian() float64

Package novas imports 10 packages (graph) and is imported by 1 packages. Updated 2019-02-24. Refresh now. Tools for package owners.