flightid

package
v0.0.0-...-8a37403 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SelectorNames = []string{"conservative", "cone"}

SelectorNames is the list of selectors we want users to be able to pick from

Functions

func AircraftToString

func AircraftToString(list []Aircraft) string

func AirspaceHandler

func AirspaceHandler(w http.ResponseWriter, r *http.Request)

func ListSelectors

func ListSelectors() [][]string

Types

type Aircraft

type Aircraft struct {
	//`datastore:"-"` // for all these ??
	Dist                float64 `datastore:",noindex"` // in KM
	Dist3               float64 `datastore:",noindex"` // in KM (3D dist, taking height into account)
	BearingFromObserver float64 `datastore:",noindex"` // bearing from the house
	Fr24Url             string  `datastore:",noindex"` // Flightradar's playback view

	Id    string  `datastore:",noindex"` // Our ID for this instance of this flight
	Id2   string  // Better known as ModeS
	Lat   float64 `datastore:",noindex"`
	Long  float64 `datastore:",noindex"`
	Track float64 `datastore:",noindex"`

	Altitude  float64 `datastore:",noindex"`
	Speed     float64 `datastore:",noindex"`
	Squawk    string  `datastore:",noindex"`
	Radar     string  `datastore:",noindex"`
	EquipType string  `datastore:",noindex"`

	Registration string  `datastore:",noindex"`
	Epoch        float64 `datastore:",noindex"`
	Origin       string  `datastore:",noindex"`
	Destination  string  `datastore:",noindex"`
	FlightNumber string

	Unknown       float64 `datastore:",noindex"`
	VerticalSpeed float64 `datastore:",noindex"`
	Callsign      string  `datastore:",noindex"`
	Unknown2      float64 `datastore:",noindex"`

	// If we get any flightpath data about the flight, it gets written here.
	ArrivalProcedureName           string `datastore:",noindex"`
	ArrivalProcedureLastWaypoint   string `datastore:",noindex"`
	DepartureProcedureName         string `datastore:",noindex"`
	DepartureProcedureLastWaypoint string `datastore:",noindex"`
	Tags                           string `datastore:",noindex"` // comma-sep list
}

func AirspaceToLocalizedAircraft

func AirspaceToLocalizedAircraft(as *airspace.Airspace, pos geo.Latlong, elev float64) []Aircraft

func FilterAircraft

func FilterAircraft(in []Aircraft) []Aircraft

func IdentifyOverhead

func IdentifyOverhead(as *airspace.Airspace, pos geo.Latlong, elev float64, algo Selector) (*Aircraft, string)

func TimeSyncAircraft

func TimeSyncAircraft(in []Aircraft, pos geo.Latlong, elev float64, targetAge time.Duration) []Aircraft

func (Aircraft) BestIdent

func (a Aircraft) BestIdent() string

Why is this not getting invoked correctly ?/

func (*Aircraft) FromTrackpoint

func (a *Aircraft) FromTrackpoint(tp fdb.Trackpoint)

func (Aircraft) IATAAirlineCode

func (a Aircraft) IATAAirlineCode() string

func (Aircraft) Latlong

func (a Aircraft) Latlong() geo.Latlong

func (Aircraft) String

func (a Aircraft) String() string

func (Aircraft) Trackpoint

func (a Aircraft) Trackpoint() fdb.Trackpoint

type AircraftByAltitude

type AircraftByAltitude []Aircraft

func (AircraftByAltitude) Len

func (s AircraftByAltitude) Len() int

func (AircraftByAltitude) Less

func (s AircraftByAltitude) Less(i, j int) bool

func (AircraftByAltitude) Swap

func (s AircraftByAltitude) Swap(i, j int)

type AircraftByDist3

type AircraftByDist3 []Aircraft

func (AircraftByDist3) Len

func (s AircraftByDist3) Len() int

func (AircraftByDist3) Less

func (s AircraftByDist3) Less(i, j int) bool

func (AircraftByDist3) Swap

func (s AircraftByDist3) Swap(i, j int)

type AlgoConservativeNoCongestion

type AlgoConservativeNoCongestion struct{}

The original, "no congestion allowed" heuristic ...

func (AlgoConservativeNoCongestion) Identify

func (a AlgoConservativeNoCongestion) Identify(pos geo.Latlong, elev float64, in []Aircraft) (*Aircraft, string)

func (AlgoConservativeNoCongestion) String

type AlgoLowestInCone

type AlgoLowestInCone struct{}

func (AlgoLowestInCone) Identify

func (a AlgoLowestInCone) Identify(pos geo.Latlong, elev float64, in []Aircraft) (*Aircraft, string)

func (AlgoLowestInCone) String

func (a AlgoLowestInCone) String() string

type AlgoRandom

type AlgoRandom struct{}

func (AlgoRandom) Identify

func (a AlgoRandom) Identify(pos geo.Latlong, elev float64, in []Aircraft) (*Aircraft, string)

func (AlgoRandom) String

func (a AlgoRandom) String() string

type Result

type Result struct {
	Flight *Aircraft
	Err    error

	All      []*Aircraft
	Filtered []*Aircraft

	Debug string
}

Result has all the data retrieved from our attempt to identify the aircraft overhead

type Selector

type Selector interface {
	String() string

	// Pick out the noise-making flight from the array, and a oneline explanation. If none
	// was identified, returns nil (but the string will explain why).
	// The aircraft slice is initially sorted by Dist3.
	Identify(pos geo.Latlong, elev float64, aircraft []Aircraft) (*Aircraft, string)
}

Selector is a role for things (algorithms) that can select a problem aircraft from an airspace

func NewSelector

func NewSelector(name string) Selector

Jump to

Keyboard shortcuts

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