Board index FlightGear Development Weather

Live weather - typo in QNH

Everything related to weather simulation, visuals should be discussed in the shader subforum.

Live weather - typo in QNH

Postby Isaak » Mon Jul 01, 2019 9:43 am

Hi all,

Saturday I experienced an issue with live weather: I was cruising at FL370 with the 777 over Iraq during my flight from EDDL to OMDB when the weather picked up a live METAR string with a QNH of 9954 hPA, probably a typo where it had to be 995 or 994 hPA. This ridiculous QNH made my plane instantly uncontrollable: it thought it was flying way too high and fast, with all the bells and whistles (overspeed and altitude warnings) going off at once. At first I thought the PFD and alarm system were malfunctioning, but since this did never happen before I quickly took a glance at the METAR string, reverted to manual mode and deleted the 4 in the QNH so advanced weather had a valid string to work from (after which I had a tough time recovering from the stall I got in due to the autothrottle idling to compensate the overspeed, I think the sudden movements would have caused a few dead/injured passengers IRL :p). The issue is clear I guess: a small typo in the METAR string had disastrous effects on the weather simulation.

Would it be an idea to add some kind of error checking in the weather code, so it reverts to e.g. standard weather or the last known valid weather setting when an obviously wrong QNH (e.g. lower than 900 or greater than 1150 hPA) is found? (I think I prefer the latter, as this keeps the weather consistent with what the plane was in before). Obviously not a very important feature request, it's the first time in 9 years of flying in live weather that I encountered such an issue, but it was quite frightening and I guess human mistakes might occur in the future too so I think it's not wrong to make the weather system able to deal with such issues.

Thanks already!

Kind regards,

Isaak
Want to support medical research with your pc? Start Folding at Home and join team FlightGear!
Isaak
 
Posts: 767
Joined: Sat Jun 04, 2011 3:52 pm
Location: Hamme, Belgium
Pronouns: he, him
Callsign: OO-ISA
Version: next
OS: Windows 10

Re: Live weather - typo in QNH

Postby wkitty42 » Mon Jul 01, 2019 5:19 pm

i like the idea but i'm confused... supposedly there's a gradual change affected between METARs so that sudden things like this don't happen... i know that's been discussed concerning flights over the oceans where you go for hundreds of miles without a METAR update...

i think there should absolutely be a clamp on the upper and lower limits... maybe if a number outside of those limits is received, just clamp to the limit? or as you suggest use the old number instead of just the whole old METAR... would that work?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Live weather - typo in QNH

Postby V12 » Tue Jul 02, 2019 7:00 am

Next evidence of INOP weather iterpolation...
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: Live weather - typo in QNH

Postby Thorsten » Tue Jul 02, 2019 7:27 am

Next evidence of INOP weather iterpolation.


...or of some people's inability to understand the math of interpolation...

Would it be an idea to add some kind of error checking in the weather code, so it reverts to e.g. standard weather or the last known valid weather setting when an obviously wrong QNH (e.g. lower than 900 or greater than 1150 hPA) is found?


I've seen this as a feature - I believe X-plane has flight on Mars options, so by inserting a suitable value you can actually make the atmosphere Martian-like, or Jovian (I've always wanted to try simulating a gas giant atmosphere in FG at some point...)

More generally I prefer if computers do not 'think' for me whenever possible. I want them to simulate whatever is commanded or die trying.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Live weather - typo in QNH

Postby www2 » Tue Jul 02, 2019 11:55 am

@Thorsten
You mean this: https://what-if.xkcd.com/30/
For the the code we can do a online only check:
Code: Select all
# Check that the live data is use.
if(online){
  Check that the QNH is in range betwteen 950-1050 mb
  if ((950 < QNH) & (QNH < 1050)) {
    QNH = 1013.25;
  }
}
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu

Re: Live weather - typo in QNH

Postby Thorsten » Tue Jul 02, 2019 12:43 pm

Lowest recorded air pressure is 870 mbar, highest 1085 mbar - there we go.

You hard-code some limits, sooner or later someone will try out simulating storm systems (or whatever) and wonder 'Why does the weather system not do what I need?'

For an event that occurred once in 9 (!) years, clearly whatever we could do to make this error-proof and yet transparent enough such that any person wanting to simulate super-storms knows what is happening without looking through the code is quite a bit of over-engineering in my view.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Live weather - typo in QNH

Postby www2 » Tue Jul 02, 2019 12:59 pm

Thorsten
Thanks for the range a good limit is of online data is than from 700 mbar to 1200 mbar.
My early range is base on this article: https://www.smhi.se/en/theme/air-pressu ... el-1.12266
And the new value is range from -1449.98 meter to 3012.18 meter pressure altitude (Std atmosphere of 1013.25 Pa @ 15C)
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu

Re: Live weather - typo in QNH

Postby wkitty42 » Tue Jul 02, 2019 10:48 pm

www2 wrote in Tue Jul 02, 2019 11:55 am:
Code: Select all
if ((950 < QNH) & (QNH < 1050)) {

the above code gives me hives and makes me bad janky... the following is more logical and understandable ;)
Code: Select all
if ((QNH < MIN_QNH) or (QNH > MAX_QNH)) {

i'll leave determining the actual MIN_QNH and MAX_QNH numbers to someone else...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Live weather - typo in QNH

Postby www2 » Tue Jul 02, 2019 11:51 pm

wkitty42 wrote in Tue Jul 02, 2019 10:48 pm:
www2 wrote in Tue Jul 02, 2019 11:55 am:
Code: Select all
if ((950 < QNH) & (QNH < 1050)) {

the above code gives me hives and makes me bad janky... the following is more logical and understandable ;)
Code: Select all
if ((QNH < MIN_QNH) or (QNH > MAX_QNH)) {

i'll leave determining the actual MIN_QNH and MAX_QNH numbers to someone else...

My plan was using :
Code: Select all
if (MIN_QNH < QNH < MAX_QNH) {

But Nasal don't support this.
www2
 
Posts: 319
Joined: Thu Apr 16, 2009 2:58 pm
OS: Ubuntu

Re: Live weather - typo in QNH

Postby wkitty42 » Wed Jul 03, 2019 8:06 pm

hehe... yeah...

my point was to keep the value checking on the same side of each of the comparison portions, reverse the comparison operators as needed, and lastly to use OR instead of AND because the value of QNH cannot be both less than and greater than another value... plus, it is more readable and easier understood...

if i'm reading your new formulation correctly, it would return TRUE for a valid QNH value... i kinda like the format but i have to specifically switch gears to read it properly compared to most all other languages i've used in the last 30+ years...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: Live weather - typo in QNH

Postby Johan G » Thu Jul 04, 2019 11:52 pm

V12 wrote in Tue Jul 02, 2019 7:00 am:Next evidence of INOP weather iterpolation...

It is quite a jump though. A full order of magnitude. At the Earth one will probably not find that air pressure outside of pressure vessels or above sea level... :wink:
Isaak wrote in Mon Jul 01, 2019 9:43 am:[...] the weather picked up a live METAR string with a QNH of 9954 hPA, probably a typo where it had to be 995 or 994 hPA.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Some YouTube videos
Johan G
Moderator
 
Posts: 6625
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit


Return to Weather

Who is online

Users browsing this forum: No registered users and 1 guest