traffic
traffic copied to clipboard
label holding pattern in Traffic
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:
-
allremains 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_ilswith theILSargument - same with
takeoff_runwayandaligned_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