From 6a9cf210bb2b9a478f118333c7c996a3551e6e61 Mon Sep 17 00:00:00 2001 From: nzkarit Date: Wed, 23 May 2018 17:21:52 +1200 Subject: [PATCH] README update and fixes while writing readme --- ADSB_Encoder.py | 3 --- FR24csv.py | 2 +- README.md | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ADSB_Encoder.py b/ADSB_Encoder.py index 3bacd2e..637f295 100755 --- a/ADSB_Encoder.py +++ b/ADSB_Encoder.py @@ -105,10 +105,8 @@ def manyPlanes(arguments): row['longitude'] = float(row['longitude']) if not 'altitude' in row.keys(): row['altitude'] = arguments.altitude - print('here') else: row['altitude'] = float(row['altitude']) - print('there') if not 'capability' in row.keys(): row['capability'] = arguments.capability if not 'typecode' in row.keys(): @@ -123,7 +121,6 @@ def manyPlanes(arguments): row['surface'] = arguments.surface logger.debug('Row from CSV: %s' % (row)) modes = ModeS() - print(row['altitude']) (df17_even, df17_odd) = modes.df17_pos_rep_encode(row['capability'], row['icao'], row['typecode'], row['surveillancestatus'], row['nicsupplementb'], row['altitude'], row['time'], row['latitude'], row['longitude'], row['surface']) ppm = PPM() diff --git a/FR24csv.py b/FR24csv.py index d4bb15a..dfcbd58 100644 --- a/FR24csv.py +++ b/FR24csv.py @@ -11,7 +11,7 @@ def auto_int(x): return int(x, 0) def argParser(): - description = 'This script will take a FR24 CSV file and convert it into a format for ADSB_Encoder.py' + description = 'This script will take a FR24 CSV file and convert it into a format for FR24csv.py' parser = argparse.ArgumentParser(description=description) parser.add_argument('-i', '--icao', action='store', type=auto_int, dest='icao', default=cfg.get('plane', 'icao'), help='The ICAO number for the plane in hex. Ensure the ICAO is prefixed with \'0x\' to ensure this is parsed as a hex number. This is 24 bits long. Default: %(default)s') parser.add_argument('--csv', '--csvfile', '--in', '--input', action='store', type=str, dest='csvfile', help='The name of the FR24 CSV file', required=True) diff --git a/README.md b/README.md index 77bcf85..7319d5f 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,26 @@ These CSV files can be used for input into the application ## generateAllICAO.py This script will generate a CSV with all the different ICAO numbers in it. +# Import FlightRadar24 CSV files +This script will take a FR24 CSV files and convert it ready for import into ADSB_Encoder.py. It outputs a file called fr24.csv. +``` +$ ./FR24csv.py --csv +$ ./ADSB_Encoder.py --csv fr24.csv + +$ ./FR24csv.py --help +usage: FR24csv.py [-h] [-i ICAO] --csv CSVFILE + +This script will take a FR24 CSV file and convert it into a format for +FR24csv.py + +optional arguments: + -h, --help show this help message and exit + -i ICAO, --icao ICAO The ICAO number for the plane in hex. Ensure the ICAO + is prefixed with '0x' to ensure this is parsed as a + hex number. This is 24 bits long. Default: 0x75008F + --csv CSVFILE, --csvfile CSVFILE, --in CSVFILE, --input CSVFILE + The name of the FR24 CSV file +``` # References 1. "*Gr-Air-Modes*", **Nick Foster**, 2012 1. "*EXPLOITING THE AUTOMATIC DEPENDENT SURVEILLANCE BROADCAST SYSTEM VIA FALSE TARGET INJECTION*", **Domenic Magazu III**, 2012