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 ¶
- 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 ¶
This section is empty.
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. returns nil and error for:
- a semi-minor axis below none, or longer than the semi-major
- a semi-major axis past the far side of the sky, half a turn
- a position angle more than a turn from north
A semi-minor axis of none is an ellipse squashed to a line, which a catalogue may give.
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. returns nil and error for an ascension more than a turn either way, or a declination past a pole.
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 a time of day on a scale.
Dates from 1582 october 15 are gregorian, and dates before it are julian. Years are counted as astronomers count them: year nought is the year before year one.
A utc day that ends in a leap second has a 60th second in its last minute, and no other day does. returns nil and error for:
- a scale sky does not know
- a date neither calendar has, or one of the ten days of 1582 october the reform skipped
- a time of day the day does not have
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. returns nil and error for a scale sky does not know, or a part with more days than a float64 counts exactly.
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. returns nil and error for 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 above sea level. returns nil and error for:
- a latitude past a pole, or a longitude past the date line
- a height below the earth's centre, or above the highest a place on the earth stands, the top of the 1976 standard atmosphere
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 carries directions onto a small field about a centre, and back. Tangent is one. A caller that draws or fits positions takes a Projector, so its own tests can stand the generated mock in; the projection itself is tested here, once.
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 a gnomonic projection: the plane that touches the sky's sphere at a centre, onto which each direction is carried along the line from the sphere's middle.
It is the usual projection for a small field, and the one a catalogue's positions near a source are drawn and fitted on.
East and north on the plane are the standard coordinates, xi and eta. Each is the tangent of an angle, and Tangent keeps them as angles, which they nearly are close to the centre, where the plane is used.
The small-angle shortcut takes east as the difference in ascension times the cosine of the centre's declination, and north as the difference in declination.
At a centre sixty degrees north, the shortcut puts a point an arcminute east 0.015 arcseconds off the plane, and a point a degree east 54 arcseconds off. The tests measure both.
func NewTangent ¶
func NewTangent(centre Equatorial) Tangent
NewTangent is the tangent plane at a centre. It refuses none: every Equatorial is a direction on the sky, since NewEquatorial refuses any that is not, and the zero Equatorial is one too.
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, so it refuses none.