celest

package module
v0.0.0-...-f28090b Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: AGPL-3.0 Imports: 9 Imported by: 0

README

From a set of two-line elements of the ISS (or any low-earth orbit satellite), inspect will calculate the latitude, longitude, altitude, SAA passes and night passes of the ISS. The duration of the prediction as well as the time step is settable by the user.

inspect use the SGP4 library written by D. Vallado in C++ to process the given TLE.

input TLE

inspect can only support the following TLE format (the first line being optional. But if present should be 24 characters long)

ISS (ZARYA)
1 25544U 98067A   18304.35926896  .00001207  00000-0  25703-4 0  9995
2 25544  51.6420  60.1332 0004268 356.0118  61.1534 15.53880871139693

the input file can be read by inspect from a local file or a remote file available on a http/https server.

inspect output

the output of inspect consists of a csv file. The columns of the file are:

  • datetime (YYYY-mm-dd HH:MM:SS.ssssss)
  • modified julian day
  • altitude (kilometer)
  • latitude (degree or DMS)
  • longitude (degree or DMS)
  • eclipse (1: night, 0: day)
  • crossing (1: crossing, 0: no crossing)
  • TLE epoch (not printed when output is pipe separated)

coordinate systems:

inspect can give the position of a satellite in three different way (mutually exclusive):

  • geocentric: the latitude, longitude and altitude are calculated from the centre of the earth.
  • geodetic: the latitude, longitude and altitude are calculated above an ellipsoidal surface of the earth.
  • teme/eci: the latitude, longitude and altitude are calculated from the centre of the earth. The main difference is that, in this system, the values are computed in an inertial system that do not rotate with the earth. These values are the outcome of the SGP4 propagator used by inspect and are used the computed the latitude, longitude in the geodetic or geocentric system.

usage

$ inspect [options] <file|url>

  -b       DATE    start date
  -c       COORD   coordinate system used (geocentric, geodetic, teme/eci)
  -d       TIME    TIME over which calculate the predicted trajectory
  -f       FORMAT  print predicted trajectory in FORMAT (csv, pipe, json, xml)
  -i       TIME    TIME between two points on the predicted trajectory
  -r       AREA    check if the predicted trajectory crossed the given AREA
  -s       SID     satellite identifier
  -t       DIR     store a TLE fetched from a remote server in DIR
  -w       FILE    write predicted trajectory in FILE (default to stdout)
  -bstar   LIMIT   B-STAR drag coefficient limit
  -360             longitude are given in range of [0:360[ instead of ]-180:180[
  -dms             convert latitude and longitude to DD°MIN'SEC'' format
  -config          load settings from a configuration file
  -version         print inspect version and exit
  -info            print info about the given TLE
  -help            print this message and exit

Documentation

Index

Constants

View Source
const (
	Y2000  = 2000
	Y1900  = 1900
	YPivot = 57
)
View Source
const Axis = 3

Variables

View Source
var (
	ErrShortPeriod = errors.New("propagation period shorter than step")
	ErrBaseTime    = errors.New("no propagation beyond base time")
)

Functions

func ConvertECEF

func ConvertECEF(rs []float64) (float64, float64, float64)

func ConvertTEME

func ConvertTEME(t time.Time, teme []float64) (float64, float64, float64)

func JD

func JD(t time.Time) float64

func MJD50

func MJD50(t time.Time) float64

func MJD70

func MJD70(t time.Time) float64

Types

type DragError

type DragError float64

func (DragError) Error

func (e DragError) Error() string

type Element

type Element struct {
	Sid  int
	When time.Time
	JD   float64
	JDF  float64

	Base time.Time

	//Elements of row#1
	Year      int
	Doy       float64
	Mean1     float64
	Mean2     float64
	BStar     float64
	Ephemeris int

	//Elements of row#2
	Inclination  float64
	Ascension    float64
	Excentricity float64
	Perigee      float64
	Anomaly      float64
	Motion       float64
	Revolution   int

	TLE []string
}

func NewElement

func NewElement(row1, row2 string) (*Element, error)

func (Element) Predict

func (e Element) Predict(p, s time.Duration, saa Shape) (*Result, error)

func (Element) Range

func (e Element) Range(i time.Duration) (time.Time, time.Time)

type Info

type Info struct {
	Sid int

	When   time.Time
	Starts time.Time
	Ends   time.Time
}

type InvalidLenError

type InvalidLenError int

func (InvalidLenError) Error

func (e InvalidLenError) Error() string

type MissingRowError

type MissingRowError int

func (MissingRowError) Error

func (e MissingRowError) Error() string

type ParseError

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

func (*ParseError) Error

func (e *ParseError) Error() string

type Point

type Point struct {
	When  time.Time `json:"dtstamp" xml:"dtstamp"`
	Epoch float64   `json:"jd" xml:"jd"`

	// Satellite position
	Lat float64 `json:"lat" xml:"lat"`
	Lon float64 `json:"lon" xml:"lon"`
	Alt float64 `json:"alt" xml:"alt"`

	// SAA and Eclipse crossing
	Saa     bool `json:"crossing" xml:"crossing"`
	Partial bool `json:"-" xml:"-"`
	Total   bool `json:"eclipse" xml:"eclipse"`
	// contains filtered or unexported fields
}

func (Point) CNES

func (p Point) CNES() Point

func (Point) Classic

func (p Point) Classic() Point

func (Point) Dublin

func (p Point) Dublin() Point

func (Point) Geocentric

func (p Point) Geocentric() Point

func (Point) Geodetic

func (p Point) Geodetic() Point

func (Point) MJD

func (p Point) MJD() float64

type PropagationError

type PropagationError int

func (PropagationError) Error

func (e PropagationError) Error() string

type Result

type Result struct {
	Err    error
	TLE    []string
	When   time.Time
	Epoch  float64
	Points []*Point
}

type Shape

type Shape interface {
	Contains(p Point) bool
}

type Trajectory

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

func (*Trajectory) Infos

func (t *Trajectory) Infos(period, interval time.Duration) []*Info

func (*Trajectory) Predict

func (t *Trajectory) Predict(p, s time.Duration, saa Shape, delay bool) (<-chan *Result, error)

func (*Trajectory) Scan

func (t *Trajectory) Scan(r io.Reader, sid int, bstar float64) error

Directories

Path Synopsis
cmd
crossing command
inspect command

Jump to

Keyboard shortcuts

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