xoolive / traffic

A toolbox for processing and analysing air traffic data

Home Page:https://traffic-viz.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

label holding pattern in Traffic

junzis opened this issue · comments

Add a new function for traffic that labels the holding pattern, example code follows:

def label_holding(flight):
    flight = flight.assign(holding=False)
    hold = flight.holding_pattern().all()
    if hold:
        flight.data.loc[hold.data.index, "holding"] = True
    return flight

I am thinking of something along the following interface on FlightIterator:

.label(holding=True)
.label(index="{i}")  # will apply a format with index=i, f=self
.label(start="start", altitude_max="{f.altitude_max}")  # string will call for attribute

then on Flight:

.label("holding_pattern", **kwargs)
.label("aligned_on_ils('LFBO')", **kwargs)

This will induce some refactoring for more elegant output in:

  • all remains awkward in the way:
    • it creates a new index,
    • it concatenates non consecutive segments;
      so the method could disappear? or become an alias for label.
  • aligned_on_ils with the ILS argument
  • same with takeoff_runway and aligned_on_runway

yes. looks quite nice for me, let's do that.

After a closer look, it has to work only on Flight because we lose reference to the original flight when in FlightIterator