Board index FlightGear Development Weather

Proposition: Increase CAVOK visibility

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

Proposition: Increase CAVOK visibility

Postby Mihajlo » Mon Sep 24, 2018 9:17 pm

You can also treat this as a (small) feature request, rather than a proposition.
I've discussed CAVOK METAR interpretation with Thorsten last year, but we never finished the discussion about visibility. I believe that current CAVOK visibility is way too low compared to most real life CAVOK situations and other AW METAR interpretations. Minimum CAVOK visibility is 10km and current FG CAVOK visibility is 13 or 15 km i believe. Statistically speaking it's wrong since we are close to that minimum instead of a more average visibility. My motivation for asking this is that at my local airport CAVOK is most often reported, and frankly it's no fun to always fly in lots haze when in reality visibility is usually much better, but more importantly statistically inaccurate. Visibility is much better in all non CAVOK metar interpretations (except in reports where visibility is reported below 10km), so CAVOK stands out here compared to the rest. I don't see a reason why CAVOK report should have such a low visibility compared to other reports such SCT040 report for example. If this change is acceptable, I would be interested to hear from other people what would would be the best (most common) visibility for CAVOK, or maybe derive visibility form temperature and dew point or simply treat it as a 9999 SCT055 report.
Mihajlo
 
Posts: 54
Joined: Tue Aug 28, 2018 6:47 pm

Re: Proposition: Increase CAVOK visibility

Postby Mihajlo » Tue Sep 25, 2018 10:49 am

I also don't mind doing the change myself if I only have to change a visibility value, since AW doesn't seem to use it's heuristics to determine visibility when CAVOK is reported, but instead uses predetermined visibility value that's always the same, but I don't know which file has CAVOK weather definition.
Mihajlo
 
Posts: 54
Joined: Tue Aug 28, 2018 6:47 pm

Re: Proposition: Increase CAVOK visibility

Postby PINTO » Wed Sep 26, 2018 3:48 am

Go to FG_install/data/Nasal/local_weather/weather_tiles.nas

Press ctrl+f and search for "# some METAR report just above max. visibility, if so we guess visibility based on pressure" (around line 2666 in 2018.2.3rc, older versions had it around 2654)

Change:

Code: Select all
   var is_visibility_max = 0;

   if (vis == 9999) {is_visibility_max = 1;}

   if ((vis > 16093) and (vis < 16094)) # that's 10 nm
      {is_visibility_max = 1;}

   if (is_visibility_max == 1)
         {
         if (p * inhg_to_hp < 1000.0) {vis = 10000.0 + 5000 * rand();}   
         else if (p * inhg_to_hp < 1010.0) {vis = 15000.0 + 7000 * rand();}
         else if (p * inhg_to_hp < 1020.0) {vis = 22000.0 + 14000.0 * rand();}
         else {vis = 30000.0 + 15000.0 * rand();}

         if (realistic_visibility_flag == 1) {vis = vis * realistic_visibility_multiplyer;}
         }


to:

Code: Select all
   var is_visibility_max = 0;

   if (vis == 9999) {
      is_visibility_max = 1;
   } elsif ((vis > 16093) and (vis < 16094)){ # that's 10 nm
      is_visibility_max = 1;
   } elsif ((vis > 11999) and (vis < 12001)) { # CAVOK
      is_visibility_max = 1;
   }

   if (is_visibility_max == 1)
         {
         if (p * inhg_to_hp < 1000.0) {vis = 10000.0 + 5000 * rand();}   
         else if (p * inhg_to_hp < 1010.0) {vis = 15000.0 + 7000 * rand();}
         else if (p * inhg_to_hp < 1020.0) {vis = 22000.0 + 14000.0 * rand();}
         else {vis = 30000.0 + 15000.0 * rand();}

         if (realistic_visibility_flag == 1) {vis = vis * realistic_visibility_multiplyer;}
         }
Actively developing the MiG-21bis (github repo) (forum thread) (dev discord) (fg wiki)

http://opredflag.com is an active flightgear dogfighting community (using a system that isn’t bombable)
User avatar
PINTO
 
Posts: 966
Joined: Wed Oct 21, 2015 7:28 pm
Callsign: pinto
Version: stable
OS: Win10

Re: Proposition: Increase CAVOK visibility

Postby Thorsten » Wed Sep 26, 2018 7:39 am

Do I understand correctly that no visibility is reported in the METAR string and the value of 12 km comes from the METAR parser somehow?

In this case, I don't know whether AW fighting the METAR parser is a good thing - it makes sense to detect some reported value as 'generic' and act accordingly because we can't do anything about how stations report, but we can do something about how the METAR parser makes up numbers, so that is what should be changed here.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Proposition: Increase CAVOK visibility

Postby Mihajlo » Wed Sep 26, 2018 11:10 am

Thanks, PINTO.
Yes, CAVOK report never states visibility, but it is known that the visibility is at least 10 km, so it's the same as 9999 report except that you don't know cloud coverage and it's altitude. I don't know where 12 km comes from but it's hardcoded somehow I think and always the same . I don't think I've seen it in METAR parser, but I might have missed it.There was a discussion a long time ago about this: https://sourceforge.net/p/flightgear/ma ... /29613903/ and as you can see Stuart and Torsten were also in favor of increasing the CAVOK visibility but for some reason the change never happened, so I think it's best to ask them or James where the 12 km value is stored. Preferably I think it's best to let AW decide visibility like in other reports, and not have the same low and unrealistic hardcoded visibility value. I'm in favor of having more variation here. Of course I only want to change visibility and leave the clouds the same like we agreed. I'm not completely against a hardcoded value as long as it's something more realistic, but I think letting AW decide this is even better. If you don't mind I'll ask where this value is stored on the mailing list, since Stuart and Torsten rarely visit the forum.
Mihajlo
 
Posts: 54
Joined: Tue Aug 28, 2018 6:47 pm

Re: Proposition: Increase CAVOK visibility

Postby Thorsten » Wed Sep 26, 2018 11:58 am

I see your point about the AW heuristics being better than a hard-coded value. But let's say I'm specifically uncomfortable with keying AW to do something relying on the METAR parser delivering a particular not so realistic value.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: Proposition: Increase CAVOK visibility

Postby Mihajlo » Thu Sep 27, 2018 1:48 pm

Found it: https://sourceforge.net/p/flightgear/fl ... ar.cxx#l58
I don't know how to code this to treat CAVOK the same as 9999 report and use AW heuristics, so if someone knows it would be great.
However I also wouldn't mind simply increasing the value which I could do myself but I don't have a c++ building environment, so again hoping someone could do it here and commit this change.
In the second case I am open to suggestions on what would be the best, most common visibility value. I was thinking 25 km, but we could go higher or a bit lower of course.
Mihajlo
 
Posts: 54
Joined: Tue Aug 28, 2018 6:47 pm

Re: Proposition: Increase CAVOK visibility

Postby Mihajlo » Thu Sep 27, 2018 3:05 pm

Actually, never mind. I can simply modify that file with notepad++. I hope this is the right way. I don't think I need c++ building environment to modify it. I will ask someone on the mailing list to commit this changed file, (all I did was change 12000 m to 25000 m).
Mihajlo
 
Posts: 54
Joined: Tue Aug 28, 2018 6:47 pm


Return to Weather

Who is online

Users browsing this forum: No registered users and 3 guests