-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dumping weather data live to file #124
Comments
hi, you can use this example code that process a specific type of messages in your code: https://github.com/junzis/pyModeS#customize-the-streaming-module |
Thanks. pyModeS/pyModeS/streamer/decode.py Line 190 in bb8f83e
# process commb message
........
if bds == "BDS50":
...
winds = pms.commb.wind44(msg) # Wind speed (kt) and direction (true) (deg)
temp = pms.commb.temp44(msg) # Static air temperature (C)
pres = pms.commb.p44(msg) # Average static pressure (hPa)
hum = pms.commb.hum44(msg) # Humidity (%) added it to the pyModeS/pyModeS/streamer/decode.py Line 253 in bb8f83e
if self.dumpto is not None:
dh = str(datetime.datetime.now().strftime("%Y%m%d_%H"))
fn = self.dumpto + "/pymodes_dump_%s.csv" % dh
output_buffer.sort(key=lambda x: x[0])
# filter output buffer
# only take acs with 3D position
if self.acs[icao]["lon"] and self.acs[icao]["lat"] and self.acs[icao]["alt"]:
# only print interesting variables
output_buffer = [o for o in output_buffer
if o[2] in ["winds","temp","pres", "hum","lat","lon","alt"]]
with open(fn, "a") as f:
writer = csv.writer(f)
writer.writerows(output_buffer) That seems to work well for now. |
Ok, actually now I understood that the meteorological variables need a BDS44, which seems to never appear in my messages because it hasn't been implemented yet. Is there any way to use pyModeS to extract temperature and winds from the wind speed, heading, etc... ? |
Hi,
I'm trying to decode weather data (temperature, winds, pressure...) from ADS-B messages and dump it to file.
I already have a working installation of
dump1090-fa
and can see the data by connecting withmodeslive
to the beast port (modeslive --source net --connect 127.0.0.1 30005 beast
).The question is..how can I connect and stream the data directly using the python module to a file using the Meteorological reports [Experimental] section functions?
I'm currently looking into the source of
modeslive
, and could probably build something using that, but I was wondering whether maybe you already have some example written with this scope in mind and wanted to avoid reinventing the wheel :DThanks
The text was updated successfully, but these errors were encountered: