traffic icon indicating copy to clipboard operation
traffic copied to clipboard

label holding pattern in Traffic

Open junzis opened this issue 3 years ago • 2 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

junzis avatar Sep 28 '22 12:09 junzis

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

xoolive avatar Sep 29 '22 09:09 xoolive

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

junzis avatar Sep 29 '22 10:09 junzis

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

xoolive avatar Oct 05 '22 16:10 xoolive