xoolive / traffic

A toolbox for processing and analysing air traffic data
https://traffic-viz.github.io/
MIT License
357 stars 80 forks source link

Flight-ids SO6 to ADS-B files #109

Open javisaezh opened 3 years ago

javisaezh commented 3 years ago

Hello, I would like to know if there is already any method developed to match the flight_ids obtained from So6 to ADS-B files. I’m trying to use the assign_id method for both files but it seems to be assigned differnent new flight-ids for SO6 and ADS-B same flights.

Thank you.

xoolive commented 3 years ago

This is not directly implemented, but here is how you could do:

  1. first build a summary dataframe for the so6: you should edit here https://github.com/xoolive/traffic/blob/4dc83c3161e3ff2111d4b6f0979d8e5325400aa8/traffic/data/eurocontrol/ddr/so6.py#L594 to add the f.start and f.stop information as start and stop entries in the dictionary (you may file a PR to share this small edit, it is definitely worth it); store this as so6_stats = so6.stats().reset_index().

  2. then iterate on your ADS-B data based on this table, and automatically assign flight_id (edit here https://github.com/xoolive/traffic/blob/4dc83c3161e3ff2111d4b6f0979d8e5325400aa8/traffic/core/traffic.py#L205 to assign flight_id (maybe also origin and destination?) if the columns exists in the series (you may add the edit to the same PR!), then

    adsb_with_id = adsb_traffic.iterate_lazy(by=so6_stats).eval()

    Be careful that for historical reasons (this should change...), the flight_id in SO6 is an integer, so you have to force it to a string here if you want it to work properly with Traffic structures.

I don't have the availability to do it myself (do it: yes, test it: no) right now, but your help would be very much appreciated and welcome by fellow users. I would include this in the documentation as well.

xoolive commented 3 years ago

Hello @javisaezh did you find your way with your issue?

javisaezh commented 3 years ago

Hello.

My apologies for answering so late, but these days I've had to shelve this issue to deal with other things. Finally I found the way to solve the problem that I told you.

Thank you very much for your instructions.