Board index FlightGear Development Weather

Discontinuity in the weather

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

Discontinuity in the weather

Postby V12 » Mon Mar 05, 2018 6:24 am

I'm using advanced weather with live METAR. I performed some short sightseeing flights for example from Sion to Agosta with Twotty. Took off in nice weather with blue sky and some cumuluses, flew through the valley, made turn into the other valley and weather suddenly and non-continualy changed to fully overcasted. QNH changed non-continualy too. At http://wiki.flightgear.org/Advanced_weather I found :
METAR and continuously varying weather parameters

If METAR info is available, this (rather than default tile center info) should be used to set parameters like visibility, pressure or temperature. To avoid discontinuous jumps, the info should be linearly interpolated in time for each nearby position from which a METAR is available. If METAR is updated every 10 minutes, one can use the information at startup for each position for the first 10 minutes of flight, then as soon as the next METAR is available slowly change the value (at each position) within the next 10 minutes to the values just fetched, and continue to do so (in essence creating a 10 minute offset from real to simulated weather).


How can I obtain that slow change of the weather ? Because the weather is allways changed non-continualy after all METAR changes. No interpolation, no aproximation or something else, everytime sudden and steep change. When I'm flying at FL600, this is not problem, after any METAR changes I need chceck autopilot, many times had been disengaged with baro altitude discontinuity. In one second is sky below me fully covered with clouds and second later I can't see any clouds. It is annoying in high altitude, but somewhere in the Alps valley - it is ticket to the hell.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby Thorsten » Mon Mar 05, 2018 6:39 am

I'm using advanced weather with live METAR.


Are you sure?

* Unless you're using 2018.1 RC, you can have the AW checkbox selected (to load the Nasal code) but not have AW running (because until recently an agreement among developers required that it won't be automatically started - so you always need to start it manually or it won't run).

* A quick scan through your screenshots indicate in many cases features of BW, not AW (the cloud patterns are rather different)

* The behavior you describe is inconsistent with how AW works internally or any of my tests, but it does describe BW rather nicely.
Thorsten
 
Posts: 10240
Joined: Mon Nov 02, 2009 8:33 am

Re: Discontinuity in the weather

Postby V12 » Mon Mar 05, 2018 6:46 am

Allways AW checked. I have FG 2017.3.1. But I don't know AW is running. I will post screenshot with my AW presets sometime afternoon.
And stupid question - how can I automaticaly start AW, when FG start ?
Last edited by V12 on Mon Mar 05, 2018 6:48 am, edited 1 time in total.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby Thorsten » Mon Mar 05, 2018 6:48 am

Allways AW checked. I have FG 2017.3.1.


Yes, that's what I was trying to tell you - you can have it checked as long as you like, still won't run until you actually start it by opening the dialog and pressing okay.

That only changed in 2018.1
Thorsten
 
Posts: 10240
Joined: Mon Nov 02, 2009 8:33 am

Re: Discontinuity in the weather

Postby V12 » Mon Mar 05, 2018 6:49 am

Yes, You should be right. Is there possibility to start AW automaticaly ?
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby legoboyvdlp » Mon Mar 05, 2018 11:01 am

In 2018.1 Advanced Weather can now be started automatically.

Nevertheless, @Thorsten, at times I have seen quite large changes in aircraft speed as the atmospheric pressure changes. This had fatal results with SHM at the event on Saturday... he was away, and the autopilot tripped due to overspeed protection, causing him to stall as the nose rose (now fixed with stall protection!) I wonder if you have noticed these airspeed spikes with large METAR changes?

The airspeed also changes quite rapidly when you switch from basic to advanced weather.
User avatar
legoboyvdlp
 
Posts: 6256
Joined: Sat Jul 26, 2014 1:28 am
Callsign: YV-LEGO
Version: 2018.3.1
OS: Windows 10 HP

Re: Discontinuity in the weather

Postby Thorsten » Mon Mar 05, 2018 1:52 pm

Nevertheless, @Thorsten, at times I have seen quite large changes in aircraft speed as the atmospheric pressure changes.


The system does the following when a new METAR comes in

* create an interpolation point at the new location
* give weight zero to the point
* do a spatial interpolation based on weight and distance with the existing point
* increase weight to 1 over the next 30 seconds or so

So normally both spatial interpolation and weight ramp-up should prevent a large change from happening, as typically a new METAR is only fetched if the new station is about as distant as the old one, and there may be several active interpolation points behind you.

But - if you fly e.g. transatlantic, you would not have received a METAR for the last few thousand kilometers and have the weather you started with still - if the arrival weather is very different, the spatial interpolation will of course place you almost completely into the power of the new point (which is perhaps a few tens of kilometers distant, compared to the thousands of kilometers of the old point) - I can imagine that in this scenario, pressure might change quite a bit on a short timescale.

The problem here is not getting any weather reports for an extended period of time in the first place.

The airspeed also changes quite rapidly when you switch from basic to advanced weather.


if you happen to be aloft, there's no reason they will give you the same wind, because the way they produce aloft winds from the reported ground winds is pretty different, so the rapid change in wind is probably genuine rather than an artifact as above.

If you want to have things like teleporting, instant weather changes in the air and such like, you better harden your AP to deal with the transients this causes...
Thorsten
 
Posts: 10240
Joined: Mon Nov 02, 2009 8:33 am

Re: Discontinuity in the weather

Postby V12 » Mon Mar 05, 2018 6:52 pm

This is example of the "interpolation" between cloud tiles (FL510) :
Image

And this is AW settings that produced previous image (now FL300, descend to LZIB) :
Image

But there is one positive fact - after METAR change no more baro altitude jumps.

Next test (FL300) :
Image

CPU i5 2550@3.5GHz, nVidia 750 GTX 2GB, 8GB RAM, Ubuntu 17.10, original nVidia driver (not open source).
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby Thorsten » Tue Mar 06, 2018 6:37 am

This is example of the "interpolation" between cloud tiles (FL510) :


What interpolation between cloud tiles - there's no such thing done. If you have one report of clear skies and one of 8/8 coverage, you're going to see these chunks.

Essentially this is a problem with the input data...

Given the graininess of METAR stations over the US or Europe and the size of the chunks, the alternative would mean to basically ignore a weather report and you would not be guaranteed to get the right weather when you reach the station.
Thorsten
 
Posts: 10240
Joined: Mon Nov 02, 2009 8:33 am

Re: Discontinuity in the weather

Postby V12 » Tue Mar 06, 2018 7:12 am

OK. Thank You for the explanation. Autostart of the AW solved - I found this :

Autostarting Advanced Weather

Currently, the choice of Advanced Weather is not saved through sessions. To enable this, use --prop:/local-weather/autostart=1 and then check the property in the Nasal init code using getprop("/local-weather/autostart"), if it's true, invoke the same routines as the dialog's ok/apply buttons (see the corresponding bindings), and you'll end up with a fully optional autostart-feature. To retain the setting, set the userarchive attribute to true. Yes, it's not straightforward.


Source : http://wiki.flightgear.org/Weather
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby wkitty42 » Tue Mar 06, 2018 1:55 pm

yes, that's the old way where you had to start it manually or resort to a "3rd party" script method... this is no longer needed with 2018.1...
"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: 5027
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Discontinuity in the weather

Postby V12 » Tue Mar 06, 2018 7:48 pm

Yes, I know, but I have linux 2017.3.1.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby wkitty42 » Tue Mar 06, 2018 8:35 pm

you should be able to upgrade to the latest release or build yourself a new one with the d&c script... i looked at implementing one of those AW autostart things but decided to wait and not have to worry about going and unimplementing the workaround...
"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: 5027
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Discontinuity in the weather

Postby V12 » Wed Mar 07, 2018 5:56 am

I will wait for official stable release, BW is enough for my high altitude flying. And for some cross Alps adventures will start AW manualy, or use described workaround with NASAL script, because use --prop:/local-weather/autostart=1 not works absolutly perfectly. Solution based on the slightly modified NASAL script for AW autostart (viewtopic.php?f=69&t=27065) is better :

Code: Select all
var normalize_string = func(src) {
    if (src == nil)
        src = "";
    var dst = "";
    for (var i = 0; i < size(src); i += 1) {
        if (src[i] == `\n` or src[i] == `\r`)
            src[i] = ` `;

        if (i == 0 and src[i] == ` `)
            continue;

        if (i != 0 and src[i] == ` ` and src[i - 1] == ` `)
            continue;

        dst = dst ~ " ";
        dst[size(dst) - 1] = src[i];
    }
    return dst;
}

_setlistener("/sim/signals/nasal-dir-initialized", func {
    var aw_enable = func (enable) {
        setprop("/sim/gui/dialogs/metar/source-selection", "Live data");

        var metar_norm = normalize_string(getprop("environment/metar/data"));
        setprop("/sim/gui/dialogs/metar/metar-string", metar_norm);

        # Live data, not manual
        setprop("/environment/realwx/enabled", 1);

        # Useless
        setprop("/environment/params/metar-updates-environment", 1);
        setprop("/environment/config/enabled", 1);

        if (enable) {
            # Re-initialize local weather with updated
            # initial tile and tile selection.
            settimer(func {
                local_weather.set_tile();
            }, 5);
        }
        else {
            local_weather.clear_all();
        }
    };
   
    setlistener("/nasal/local_weather/loaded", func {
        aw_enable(1);
    });
});


I changed parameter in the settimer from original 0.2 to 5, because with 0.2 sim usually crashed on resource leak after recursive timer call in case of extreme cloudy weather.
Fly high, fly fast - fly Concorde !
User avatar
V12
 
Posts: 937
Joined: Thu Jan 12, 2017 4:27 pm
Location: LZIB
Callsign: BAWV12

Re: Discontinuity in the weather

Postby Parnikkapore » Fri Mar 09, 2018 12:23 pm

Just my cents on this - I run AW all the time and the altitude periodically goes crazy, even upsetting the autopilot. That also happens whenever I press "OK" on the Weather dialog. This lasts for just 1 second tho.
There are free alternatives to every program you encounter. You just have to find them.
Parnikkapore
 
Posts: 796
Joined: Thu Oct 29, 2015 10:16 am
Callsign: HS-FGS
Version: next [PPA]
OS: Mint 18

Next

Return to Weather

Who is online

Users browsing this forum: No registered users and 1 guest