rise

package
v3.0.0-...-8217f41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Rise: Chapter 15, Rising, Transit, and Setting.

Formulas in the chapter are general enough to handle various astronomical objects. The methods ApproxTimes and Times implement this general math.

The function signatures aren't very friendly though, requiring a number of precomputed values. The example worked in the text gives these values for the planet Venus. With these example values as test data, methods ApproxPlanet and Planet are also given here. Similar methods for stars, the Sun, Moon, Pluto, or asteroids might also be developed using other packages from this library.

Index

Examples

Constants

This section is empty.

Variables

View Source
var (
	Stdh0Stellar   = unit.AngleFromMin(-34)
	Stdh0Solar     = unit.AngleFromMin(-50)
	Stdh0LunarMean = unit.AngleFromDeg(.125)
)

"Standard altitudes" for various bodies.

The standard altitude is the geometric altitude of the center of body at the time of apparent rising or setting.

View Source
var ErrorCircumpolar = errors.New("Circumpolar")

ErrorCircumpolar returned by Times when the object does not rise and set on the day of interest.

Functions

func ApproxPlanet

func ApproxPlanet(yr, mon, day int, pos globe.Coord, e, pl *pp.V87Planet) (tRise, tTransit, tSet unit.Time, err error)

ApproxPlanet computes approximate UT rise, transit and set times for a planet on a day of interest.

yr, mon, day are the Gregorian date.
pos is geographic coordinates of observer.
e must be a V87Planet object for Earth
pl must be a V87Planet object for another planet.

Obtain V87Planet objects with the planetposition package.

Result units are seconds of day and are in the range [0,86400).

Example
// Example 15.a, p. 103.
p := globe.Coord{
	Lon: unit.NewAngle(' ', 71, 5, 0),
	Lat: unit.NewAngle(' ', 42, 20, 0),
}
e, err := pp.LoadPlanet(pp.Earth)
if err != nil {
	fmt.Println(err)
	return
}
v, err := pp.LoadPlanet(pp.Venus)
if err != nil {
	fmt.Println(err)
	return
}
tRise, tTransit, tSet, err := rise.ApproxPlanet(1988, 3, 20, p, e, v)
if err != nil {
	fmt.Println(err)
	return
}
// Units for "m" values given near top of p. 104 are day fraction.
fmt.Printf("rising:   %+.5f %02s\n", tRise/86400, sexa.FmtTime(tRise))
fmt.Printf("transit:  %+.5f %02s\n", tTransit/86400, sexa.FmtTime(tTransit))
fmt.Printf("seting:   %+.5f %02s\n", tSet/86400, sexa.FmtTime(tSet))
Output:

rising:   +0.51816  12ʰ26ᵐ09ˢ
transit:  +0.81965  19ʰ40ᵐ17ˢ
seting:   +0.12113  02ʰ54ᵐ26ˢ

func ApproxTimes

func ApproxTimes(p globe.Coord, h0 unit.Angle, Th0 unit.Time, α unit.RA, δ unit.Angle) (tRise, tTransit, tSet unit.Time, err error)

ApproxTimes computes approximate UT rise, transit and set times for a celestial object on a day of interest.

The function argurments do not actually include the day, but do include values computed from the day.

p is geographic coordinates of observer. p 为地平坐标(仰角,方位角)
h0 is "standard altitude" of the body. h0 为天体升,降时实际地平线纬度
Th0 is apparent sidereal time at 0h UT at Greenwich. Th0 为格林威治0h UT视恒星时
α, δ are right ascension and declination of the body. α, δ为天体0h DT视赤经,视赤纬

Th0 must be the time on the day of interest. See sidereal.Apparent0UT.

α, δ must be values at 0h dynamical time for the day of interest. 近似计算升,中天,降时间

Example
// Example 15.a, p. 103.
// Venus on 1988 March 20
p := globe.Coord{
	Lon: unit.NewAngle(' ', 71, 5, 0),
	Lat: unit.NewAngle(' ', 42, 20, 0),
}
Th0 := unit.NewTime(' ', 11, 50, 58.1)
α := unit.NewRA(2, 46, 55.51)
δ := unit.NewAngle(' ', 18, 26, 27.3)
h0 := rise.Stdh0Stellar
tRise, tTransit, tSet, err := rise.ApproxTimes(p, h0, Th0, α, δ)
if err != nil {
	fmt.Println(err)
	return
}
// Units for "m" values given near top of p. 104 are day fraction.
fmt.Printf("rising:  %+.5f %02s\n", tRise/86400, sexa.FmtTime(tRise))
fmt.Printf("transit: %+.5f %02s\n", tTransit/86400, sexa.FmtTime(tTransit))
fmt.Printf("seting:  %+.5f %02s\n", tSet/86400, sexa.FmtTime(tSet))
Output:

rising:  +0.51816  12ʰ26ᵐ09ˢ
transit: +0.81965  19ʰ40ᵐ17ˢ
seting:  +0.12113  02ʰ54ᵐ26ˢ
Example (Computed)
// Example 15.a, p. 103, but using meeus packages to compute values
// given in the text.
jd := julian.CalendarGregorianToJD(1988, 3, 20)
p := globe.Coord{
	Lon: unit.NewAngle(' ', 71, 5, 0),
	Lat: unit.NewAngle(' ', 42, 20, 0),
}

// Th0 computed rather than taken from the text.
Th0 := sidereal.Apparent0UT(jd)
fmt.Printf("Th0: %.2s\n", sexa.FmtTime(Th0))

// Venus α, δ computed rather than taken from the text.
e, err := pp.LoadPlanet(pp.Earth)
if err != nil {
	fmt.Println(err)
	return
}
v, err := pp.LoadPlanet(pp.Venus)
if err != nil {
	fmt.Println(err)
	return
}
α, δ := elliptic.Position(v, e, jd)
fmt.Printf("α: %.2s\n", sexa.FmtRA(α))
fmt.Printf("δ: %.1s\n", sexa.FmtAngle(δ))

h0 := rise.Stdh0Stellar
tRise, tTransit, tSet, err := rise.ApproxTimes(p, h0, Th0, α, δ)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Printf("rising:   %+.5f %02s\n", tRise/86400, sexa.FmtTime(tRise))
fmt.Printf("transit:  %+.5f %02s\n", tTransit/86400, sexa.FmtTime(tTransit))
fmt.Printf("seting:   %+.5f %02s\n", tSet/86400, sexa.FmtTime(tSet))
Output:

Th0: 11ʰ50ᵐ58.09ˢ
α: 2ʰ46ᵐ55.51ˢ
δ: 18°26′27.3″
rising:   +0.51816  12ʰ26ᵐ09ˢ
transit:  +0.81965  19ʰ40ᵐ17ˢ
seting:   +0.12113  02ʰ54ᵐ26ˢ

func Planet

func Planet(yr, mon, day int, pos globe.Coord, e, pl *pp.V87Planet) (tRise, tTransit, tSet unit.Time, err error)

Planet computes UT rise, transit and set times for a planet on a day of interest.

yr, mon, day are the Gregorian date.
pos is geographic coordinates of observer.
e must be a V87Planet object for Earth
pl must be a V87Planet object for another planet.

Obtain V87Planet objects with the planetposition package.

Result units are seconds of day and are in the range [0,86400).

Example
// Example 15.a, p. 103.
p := globe.Coord{
	Lon: unit.NewAngle(' ', 71, 5, 0),
	Lat: unit.NewAngle(' ', 42, 20, 0),
}
e, err := pp.LoadPlanet(pp.Earth)
if err != nil {
	fmt.Println(err)
	return
}
v, err := pp.LoadPlanet(pp.Venus)
if err != nil {
	fmt.Println(err)
	return
}
tRise, tTransit, tSet, err := rise.Planet(1988, 3, 20, p, e, v)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Printf("rising:   %+.5f %02s\n", tRise/86400, sexa.FmtTime(tRise))
fmt.Printf("transit:  %+.5f %02s\n", tTransit/86400, sexa.FmtTime(tTransit))
fmt.Printf("seting:   %+.5f %02s\n", tSet/86400, sexa.FmtTime(tSet))
Output:

rising:   +0.51766  12ʰ25ᵐ26ˢ
transit:  +0.81980  19ʰ40ᵐ30ˢ
seting:   +0.12130  02ʰ54ᵐ40ˢ

func Stdh0Lunar

func Stdh0Lunar(π unit.Angle) unit.Angle

Stdh0Lunar is the standard altitude of the Moon considering π, the Moon's horizontal parallax.

func Times

func Times(p globe.Coord, ΔT unit.Time, h0 unit.Angle, Th0 unit.Time, α3 []unit.RA, δ3 []unit.Angle) (tRise, tTransit, tSet unit.Time, err error)

Times computes UT rise, transit and set times for a celestial object on a day of interest.

The function argurments do not actually include the day, but do include a number of values computed from the day.

p is geographic coordinates of observer.
ΔT is delta T.
h0 is "standard altitude" of the body.
Th0 is apparent sidereal time at 0h UT at Greenwich.
α3, δ3 are slices of three right ascensions and declinations.

h0 unit is radians.

Th0 must be the time on the day of interest, in seconds. See sidereal.Apparent0UT.

α3, δ3 must be values at 0h dynamical time for the day before, the day of, and the day after the day of interest. Units are radians.

Result units are seconds of day and are in the range [0,86400). 对近似计算结果迭代,得到精确升,中天,降时间

Example
// Example 15.a, p. 103.
// Venus on 1988 March 20
p := globe.Coord{
	Lon: unit.NewAngle(' ', 71, 5, 0),
	Lat: unit.NewAngle(' ', 42, 20, 0),
}
Th0 := unit.NewTime(' ', 11, 50, 58.1)
α3 := []unit.RA{
	unit.NewRA(2, 42, 43.25),
	unit.NewRA(2, 46, 55.51),
	unit.NewRA(2, 51, 07.69),
}
δ3 := []unit.Angle{
	unit.NewAngle(' ', 18, 02, 51.4),
	unit.NewAngle(' ', 18, 26, 27.3),
	unit.NewAngle(' ', 18, 49, 38.7),
}
h0 := unit.AngleFromDeg(-.5667)
ΔT := unit.Time(56)
tRise, tTransit, tSet, err := rise.Times(p, ΔT, h0, Th0, α3, δ3)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Printf("rising:  %+.5f %02s\n", tRise/86400, sexa.FmtTime(tRise))
fmt.Printf("transit: %+.5f %02s\n", tTransit/86400, sexa.FmtTime(tTransit))
fmt.Printf("seting:  %+.5f %02s\n", tSet/86400, sexa.FmtTime(tSet))
Output:

rising:  +0.51766  12ʰ25ᵐ26ˢ
transit: +0.81980  19ʰ40ᵐ30ˢ
seting:  +0.12130  02ʰ54ᵐ40ˢ
Example (Computed)
// Example 15.a, p. 103, but using meeus packages to compute values
// given in the text.
jd := julian.CalendarGregorianToJD(1988, 3, 20)
p := globe.Coord{
	Lon: unit.NewAngle(' ', 71, 5, 0),
	Lat: unit.NewAngle(' ', 42, 20, 0),
}
// Th0 computed rather than taken from the text.
Th0 := sidereal.Apparent0UT(jd)

// Venus α, δ computed rather than taken from the text.
e, err := pp.LoadPlanet(pp.Earth)
if err != nil {
	fmt.Println(err)
	return
}
v, err := pp.LoadPlanet(pp.Venus)
if err != nil {
	fmt.Println(err)
	return
}
α := make([]unit.RA, 3)
δ := make([]unit.Angle, 3)
α[0], δ[0] = elliptic.Position(v, e, jd-1)
α[1], δ[1] = elliptic.Position(v, e, jd)
α[2], δ[2] = elliptic.Position(v, e, jd+1)
for i, j := range []float64{jd - 1, jd, jd + 1} {
	_, m, d := julian.JDToCalendar(j)
	fmt.Printf("%s %.0f  α: %0.2s  δ: %0.1s\n",
		time.Month(m), d, sexa.FmtRA(α[i]), sexa.FmtAngle(δ[i]))
}

// ΔT computed rather than taken from the text.
ΔT := deltat.Interp10A(jd)
fmt.Printf("ΔT: %.1f\n", ΔT)

h0 := rise.Stdh0Stellar
tRise, tTransit, tSet, err := rise.Times(p, ΔT, h0, Th0, α, δ)
if err != nil {
	fmt.Println(err)
	return
}
fmt.Printf("rising:   %+.5f %02s\n", tRise/86400, sexa.FmtTime(tRise))
fmt.Printf("transit:  %+.5f %02s\n", tTransit/86400, sexa.FmtTime(tTransit))
fmt.Printf("seting:   %+.5f %02s\n", tSet/86400, sexa.FmtTime(tSet))
Output:

March 19  α: 2ʰ42ᵐ43.25ˢ  δ: 18°02′51.4″
March 20  α: 2ʰ46ᵐ55.51ˢ  δ: 18°26′27.3″
March 21  α: 2ʰ51ᵐ07.69ˢ  δ: 18°49′38.7″
ΔT: 55.9
rising:   +0.51766  12ʰ25ᵐ26ˢ
transit:  +0.81980  19ʰ40ᵐ30ˢ
seting:   +0.12130  02ʰ54ᵐ40ˢ

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL