x72y5e / radar

Display flight data on the UnicornHatHD module for Raspberry Pi
MIT License
24 stars 4 forks source link

Invalid Syntax #2

Closed IT-Berater closed 5 years ago

IT-Berater commented 5 years ago

Hi,

i test the script, with parameter: python tracker.py 52.44 9.73

its generate:

File "tracker.py", line 19 def plot(grid: np.ndarray): ^ SyntaxError: invalid syntax

Greetings Thomas

x72y5e commented 5 years ago

Thanks for opening this issue. I cannot reproduce your error. I ran tracker.py and used the data input dialogue, using your coordinate as a fixed point, and a square around it (as you will see below). The programme ran as expected:

No unicorn hat found. Printing to console only. enter coordinate (in format lat, long) for bottom-left of the map: (or press enter for default) 52.41, 9.66 enter coordinate (in format lat, long) for top-right of the map: (or press enter for default)52.46, 9.78 enter coordinates (in format lat, long) for any fixed point, or press enter to continue: 52.44, 9.73 enter coordinates (in format lat, long) for any fixed point, or press enter to continue: getting data... From: EDDT Berlin-Tegel, Berlin, Germany To: EDDM Munich, Germany Type: Airbus A319 112 Operator: Lufthansa Altitude: 27150 Last Info: 0.0 seconds ago

From: EDDT Berlin-Tegel, Berlin, Germany To: EDDM Munich, Germany Type: Airbus A319 112 Operator: Lufthansa Altitude: 27150 Last Info: 5.05 seconds ago

From: None To: None Type: Airbus A320 232 Operator: British Airways Altitude: 3150 Last Info: 0.0 seconds ago

If you wish to enter coordinates otherwise than through the input dialogue in main, you need to ensure you are supplying all of the necessary arguments:

fixed_points: List[Tuple[float, float]], lat_min: float, lat_max: float, long_min: float, long_max: float, r: float = 25.): """ :param fixed_points: list of fixed points to display. first item is tracking centre :param r: range (km) of tracking, from centre :param lat_min: minimum latitude to use for display grid :param lat_max: maximum latitude to use for display grid :param long_min: minimum longitude to use for display grid :param long_max: maximum longitude to use for display grid :return: None

If you wish to try this, and let me know if you still get an error, I will investigate further.

Thanks again.

IT-Berater commented 5 years ago

Hi, what are the right parameter? I use:

pi@pi-home:~/radar $ ./tracker.py import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/358. import-im6.q16: unable to open X server' @ error/import.c/ImportImageCommand/358. import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/358. from: can't read /var/mail/datetime import-im6.q16: unable to open X server' @ error/import.c/ImportImageCommand/358. from: can't read /var/mail/typing import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/358. from: can't read /var/mail/plane ./tracker.py: Zeile 11: try:: Kommando nicht gefunden. import-im6.q16: unable to open X server' @ error/import.c/ImportImageCommand/358. ./tracker.py: Zeile 14: except: Kommando nicht gefunden. ./tracker.py: Zeile 15: Syntaxfehler beim unerwarteten Wort "No unicorn hat found. Printing to console only."' ./tracker.py: Zeile 15: print("No unicorn hat found. Printing to console only.")'

or

pi@pi-home:~/radar $ ./tracker.py 52.44,9.73 import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/358. import-im6.q16: unable to open X server' @ error/import.c/ImportImageCommand/358. import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/358. from: can't read /var/mail/datetime import-im6.q16: unable to open X server' @ error/import.c/ImportImageCommand/358. from: can't read /var/mail/typing import-im6.q16: unable to open X server ' @ error/import.c/ImportImageCommand/358. from: can't read /var/mail/plane ./tracker.py: Zeile 11: try:: Kommando nicht gefunden. import-im6.q16: unable to open X server' @ error/import.c/ImportImageCommand/358. ./tracker.py: Zeile 14: except: Kommando nicht gefunden. ./tracker.py: Zeile 15: Syntaxfehler beim unerwarteten Wort "No unicorn hat found. Printing to console only."' ./tracker.py: Zeile 15: print("No unicorn hat found. Printing to console only.")'

x72y5e commented 5 years ago

Which python version are you using? This is written in python 3.6. Do you have the unicornhathd module installed?

IT-Berater commented 5 years ago

Python 2.7.13. No.

IT-Berater commented 5 years ago

This is on Raspberry Pi Debian Raspian stretch Version the current version.

x72y5e commented 5 years ago

Ok, well I haven't tested it for python 2 and I doubt it will work. Your Pi should have a python 3 installation but if not I would suggest using virtual environments (https://docs.python.org/3/library/venv.html). To use the programme fully, you will also need to get hold of the UnicornHatHD display, and then install its library. I will close this issue now. Many thanks.