Documentation
¶
Overview ¶
Package sky is where things are, seen from places, at instants, in frames: the sun over a hillside, a star through the sun's lens, a merger's waves at two detectors. doc/sky.md is its design.
A small field around a source is a Tangent plane, the gnomonic projection, with positions on it as east and north Offsets; a position's error is an Ellipse whose outline lies on that plane.
Package sky is built on measure.
Index ¶
- func ErrBehind() error
- func ErrDate() error
- func ErrEllipse() error
- func ErrPlace() error
- func ErrScale() error
- type Ellipse
- type Equatorial
- type Horizontal
- type Instant
- func (moment Instant) Calendar() (year, month, day, hour, minute int, second float64)
- func (moment Instant) GPSSeconds() (float64, error)
- func (moment Instant) Julian() (whole, fraction float64)
- func (moment Instant) MeanSidereal() (*measure.Angle, error)
- func (moment Instant) On(scale Scale) (*Instant, error)
- func (moment Instant) Scale() Scale
- func (moment Instant) UT1(dut1 measure.Duration) (*Instant, error)
- type Offset
- type Place
- type Projector
- type Scale
- type Tangent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrBehind ¶
func ErrBehind() error
ErrBehind is a direction a quarter turn or more from a tangent plane's centre, which the line from the sphere's middle never takes to the plane.
func ErrDate ¶
func ErrDate() error
ErrDate is a date or a julian date that is no moment: no such day in the calendar, a time past the day's end, or a number that is none.
func ErrEllipse ¶
func ErrEllipse() error
ErrEllipse is axes that make no ellipse, or an outline of too few points to draw one.
Types ¶
type Ellipse ¶
type Ellipse struct {
// contains filtered or unexported fields
}
Ellipse is an error ellipse on the sky, as catalogues give a position's: its semi-major and semi-minor axes, and the position angle of the major axis, east of north.
func NewEllipse ¶
NewEllipse is the ellipse of two semi-axes and the position angle of the major one, east of north. It refuses an axis below nothing or not finite, a minor axis longer than the major, and an angle not finite, and then gives no ellipse.
type Equatorial ¶
type Equatorial struct {
// contains filtered or unexported fields
}
Equatorial is a direction on the sky's own frame: right ascension east along the equator, and declination north of it.
func NewEquatorial ¶
func NewEquatorial(ascension, declination measure.Angle) (*Equatorial, error)
NewEquatorial is the direction at a right ascension and declination. It refuses an ascension that is not a finite number and a declination past a pole, and then gives no direction.
func (Equatorial) Ascension ¶
func (seen Equatorial) Ascension() measure.Angle
Ascension is the direction's right ascension, east along the equator.
func (Equatorial) Declination ¶
func (seen Equatorial) Declination() measure.Angle
Declination is the direction's declination, north of the equator.
func (Equatorial) String ¶
func (seen Equatorial) String() string
String is the direction in degrees, for a person reading an error.
type Horizontal ¶
type Horizontal struct {
// contains filtered or unexported fields
}
Horizontal is a direction in the local sky: azimuth from north round toward east, and altitude above the horizon.
func (Horizontal) Altitude ¶
func (seen Horizontal) Altitude() measure.Angle
Altitude is how far above the horizon.
func (Horizontal) Azimuth ¶
func (seen Horizontal) Azimuth() measure.Angle
Azimuth is how far round from north, toward east.
type Instant ¶
type Instant struct {
// contains filtered or unexported fields
}
Instant is a moment on a scale, held in two parts so none of its resolution is lost: a whole modified julian day, and how far through that day it is, from nought up to one. On a utc day ending in a leap second the day is 86401 s, and the fraction is of that.
func Calendar ¶
Calendar is the instant at a date and time on a scale. From 1582 october 15 the date is gregorian, and before it julian; years are counted as astronomers do, with year nought before year one.
A utc day that ended in a leap second has a second of 60 in its last minute; no other day does. Calendar refuses no scale, no such date and no such time, and then gives no instant.
func FromGPS ¶
FromGPS is the instant a gps time names: seconds of gps time since the gps epoch, 1980 january 6 0h utc. The LIGO and Virgo detectors, and the open science centre that publishes their data, give their times this way.
FromGPS refuses a time that is not a finite number, or so far off its days cannot be counted exactly, and then gives no instant.
func FromJulian ¶
FromJulian is the instant at a julian date given in two parts whose sum is the date; one part may carry it all and the other nought. It refuses no scale, a date that is no finite number, and one so far off its days cannot be counted exactly, and then gives no instant.
func (Instant) Calendar ¶
Calendar is the date and time of the instant on its own scale, by meeus, astronomical algorithms, chapter 7: gregorian from 1582 october 15 and julian before.
func (Instant) GPSSeconds ¶
GPSSeconds is the instant as seconds of gps time since the gps epoch, FromGPS undone. It refuses what On refuses: an instant on ut1, or on utc where its leap seconds are not known.
func (Instant) Julian ¶
Julian is the instant's julian date in two parts: the julian date of the start of its day, and the fraction of the day since.
func (Instant) MeanSidereal ¶
MeanSidereal is greenwich mean sidereal time at an instant on ut1: how far the earth has turned against the stars, by the iau's expression of 1982. It refuses an instant on another scale, and then gives no angle.
func (Instant) On ¶
On is the same instant on another scale. ut1 needs iers's measurements of the earth's turning, which sky does not hold yet, so it is refused by name. On refuses no scale, and then gives no instant.
type Offset ¶
type Offset struct {
// contains filtered or unexported fields
}
Offset is a place on a tangent plane: how far east and north of the centre it is.
type Place ¶
type Place struct {
// contains filtered or unexported fields
}
Place is a place on the earth: its latitude, north above nought; its longitude, east above nought, as the iau counts it; and its height.
func OnEarth ¶
OnEarth is the place at a latitude, a longitude and a height. It refuses a latitude past a pole, a longitude past the date line, and a height that is not a finite number, and then gives no place.
func (Place) Local ¶
func (there Place) Local(at Equatorial, sidereal measure.Angle) Horizontal
Local is a direction on the sky's frame as it stands in the place's sky, when greenwich has turned so far: its sidereal time. apparent directions take apparent sidereal time. by meeus, astronomical algorithms, equations 13.5 and 13.6, with azimuth from north.
type Projector ¶
type Projector interface {
Onto(at Equatorial) (*Offset, error)
Back(offset Offset) Equatorial
}
Projector takes directions onto a small field about a centre, and back: a Tangent is one. A caller that draws or fits positions takes a Projector, so its tests stand a mock in (celestial/mocks) and expect its calls; the projection is tested once, here.
type Scale ¶
type Scale struct {
// contains filtered or unexported fields
}
Scale is the clock an instant is on: utc, tai, tt, tdb, ut1 or gps. doc/sky.md says what each is. The zero Scale is none of them, and every instant refuses it.
func GPS ¶
func GPS() Scale
GPS is the global positioning system's time, tai less 19 s, the clock LIGO, Virgo and the open science centre give their times on.
type Tangent ¶
type Tangent struct {
// contains filtered or unexported fields
}
Tangent is the plane that touches the sky's sphere at a centre, and the gnomonic projection onto it: each direction goes along the line from the sphere's middle to where that line meets the plane.
It is the standard projection for small fields, and the one a catalogue's positions near a source are drawn and fit on.
East and north on the plane are the standard coordinates, xi and eta, each the tangent of an angle; here they are kept as angles, which is what they are near the centre, where the projection is used.
The small-angle shortcut, east as the ascension apart times the cosine of the centre's declination and north as the declination apart, misses the plane by 0.015 arcseconds an arcminute east of a centre at sixty degrees north, and by 54 a degree east; the tests measure both.
func NewTangent ¶
func NewTangent(centre Equatorial) Tangent
NewTangent is the tangent plane at a centre.
func (Tangent) Back ¶
func (plane Tangent) Back(offset Offset) Equatorial
Back is the direction a place on the plane stands for: Onto, undone. Every place on the plane is some direction.