Closed peepsnet closed 5 years ago
Will this also capture METARs with a heavy (+) symbol? eg. +TSRA
Will this also capture METARs with a heavy (+) symbol? eg. +TSRA
Yes. The function
word in metar['raw_text'] for word in ['TSRA', 'VCTS', 'TS ']
will find any instance of the options: TSRA or VCTS or TS
Agreed that it'd be nice to search for "TS" as a weather modifier. This particular modification however would match too much - for instance, the ICAO of KSTS would always match, regardless of their weather conditions.
Would you be able to convert it into something more strict?
Thanks for working on it!
That is why I asked to match "TS " (Notice the space after TS).
More strict would be " TS "(a space on each side)
I am using the modified code with success
KSTS 021853Z VRB04KT 10SM SCT026 17/12 A2989 RMK AO2 SLP115 T01670122
would still get matched with the trailing space.
Are there other modifiers that get combined with TS? I'm afraid that " TS " might then miss something like "TSSH". Maybe the best search would be for TS anywhere in the body that's NOT the first word (the ICAO code)?
Well... According to this page: http://moratech.com/aviation/metar-class/metar-pg9-ww.html#DECODE
Any time thunderstorms are mentioned it is the leading letters in the identifier except for VCTS
So... ' TS', '+TS', '-TS', 'VCTS' would find all the variables... but it would also match:
TSB25RAB25
but that would always exist after RMK if you delete the first 4 chars and everything after RMK then all that is left would be current weather data. Then that var could be searched for ' TS', '+TS', '-TS', 'VCTS'
Any value there??
What do you think about this regex that looks for TS between the ICAO and RMK (if it exists)? That way it won't match any remarks about a TS having ended.
What do you think about this regex that looks for TS between the ICAO and RMK (if it exists)? That way it won't match any remarks about a TS having ended.
Looks good. The only thing left is to release it on the world and wait to be proven wrong! :)
@peepsnet, did you want to update your PR to go with the regex approach from #9, or would you prefer I just make the change and close this PR?
Fixed this in f9f549e, closing.
The code for checking if a metar contains any TS is missing one qualifyer.
TS can appear alone in a metar:
This line does not detect that TS by itself
https://github.com/ScottSturdivant/rpi_metar/blob/7b67181c3d5b59ead807a4c06cb7fc9f8293a5bb/rpi_metar/airports.py#L88
I propose the line be:
By adding the "TS "(with a space) you will catch all the TS in the body of the metar