1
0
Fork 0

Local Weather 1.1 by Thorsten Renk

This commit is contained in:
Frederic Bouvier 2011-05-14 15:15:20 +02:00
parent cfe9dc2328
commit aa6680b4a6
10 changed files with 797 additions and 275 deletions

View file

@ -7,7 +7,7 @@
<body> <body>
<h1>Local Weather Package - v1.0</h1> <h1>Local Weather Package - v1.1</h1>
<h2>1. Introduction</h2> <h2>1. Introduction</h2>
@ -15,19 +15,20 @@ The aim of a local weather system is to simulate weather phenomena tied to speci
This is in contrast to the current (v.2.0.0) global weather system of Flightgear where weather changes affect the weather everywhere in the simulated world and are (with few exceptions) not tied to specific locations. In such a system, it is impossible to observe e.g. the approach of a rainfront while flying in sunshine.<p> This is in contrast to the current (v.2.0.0) global weather system of Flightgear where weather changes affect the weather everywhere in the simulated world and are (with few exceptions) not tied to specific locations. In such a system, it is impossible to observe e.g. the approach of a rainfront while flying in sunshine.<p>
The local weather package aims to provide the functionality to simulate such local phenomena. In version 1.0, the package supplies various cloud placement algorithms, as well as local control over most major weather parameters (wind, visibility, pressure, temperature, rain, snow, thermal lift, turbulence...) through interpolation routines and effect volumes. The dynamics of the different systems is tied together - for instance clouds and weather effects drift in the specified wind field. The package also contains a fairly detailed algorithm to generate convective clouds and thermals with a realistic distribution over the various terrain types. There is a simulation of the interaction of the convective cloud system with the terrain as a function of time. Clouds drifting in the wind flow over obstacles, i.e. they change their altitude dynamically. Convection is implemented with a life cycle model of Cumulus clouds - they are generated, evolve for a given lifetime dependent on the underlying terrain and decay at the end of their life cycle. Thermals associated with the clouds follow the same pattern. In particular, in the presence of wind favourable spots for convection generate 'alleys' of dense cloud cover downwind, or thermals and clouds generated over land decay rapidly once they reach open water.<p> The local weather package aims to provide the functionality to simulate such local phenomena. In version 1.1, the package supplies various cloud placement algorithms, as well as local control over most major weather parameters (wind, visibility, pressure, temperature, rain, snow, thermal lift, turbulence...) through interpolation routines and effect volumes. The dynamics of the different systems is tied together - for instance clouds and weather effects drift in the specified wind field. The package also contains a fairly detailed algorithm to generate convective clouds and thermals with a realistic distribution over the various terrain types. There is a simulation of the interaction of the convective cloud system with the terrain as a function of time. Clouds drifting in the wind flow over obstacles, i.e. they change their altitude dynamically. Convection is implemented with a life cycle model of Cumulus clouds - they are generated, evolve for a given lifetime dependent on the underlying terrain and decay at the end of their life cycle. Thermals associated with the clouds follow the same pattern. In particular, in the presence of wind favourable spots for convection generate 'alleys' of dense cloud cover downwind, or thermals and clouds generated over land decay rapidly once they reach open water.<p>
For long-range flights, the system provides an offline weather system with plausible transitions between different large-scale weather patterns like fronts and low and high pressure areas, as well as the optional use of live METAR data. <p> For long-range flights, the system provides an offline weather system with plausible transitions between different large-scale weather patterns like fronts and low and high pressure areas, as well as the optional use of live METAR data. <p>
<h2>2. Installation</h2> <h2>2. Installation</h2>
The package needs to be unpacked in the Flightgear root directory. It writes content into the <i>Nasal/, gui/, gui/dialogs/, Shaders, Effects/, Docs/</i>, and <i>Models/Weather/</i> subdirectories. The installation does not overwrite any of the default Flightgear files, but to be accessible from the menu for Flightgear 2.0.0, one must copy <i>gui/menubar.xml.alt</i> to the default <i>menubar.xml</i> or copy the three lines of the environemnt menu calling <i>local_weather</i>, <i>local_weather_tiles</i> and <i>local_weather_config</i> into the default file. More recent versions of Flightgear already provide the necessary menu items.<p> The package needs to be unpacked in the Flightgear root directory. It writes content into the <i>Nasal/, gui/, gui/dialogs/, Shaders, Effects/, Docs/</i>, <i>Environment/</i> and <i>Models/Weather/</i> subdirectories. The installation does not overwrite any of the default Flightgear files, but to be accessible from the menu for Flightgear 2.0.0, one must copy <i>gui/menubar.xml.alt</i> to the default <i>menubar.xml</i> or copy the three lines of the environemnt menu calling <i>local_weather</i>, <i>local_weather_tiles</i> and <i>local_weather_config</i> into the default file. More recent versions of Flightgear already provide the necessary menu items. In order to read in the default menu entries, the line <b>&#60;local-weather include="Environment/local-weather-defaults.xml"/&#62;</b> needs to be added to the file <i>preferences.xml</i>.<p>
This adds the items <i>Local Weather</i>, <i>Local Weather Tiles</i> and <i>Local Weather Config</i> to the <i>Environment</i> menu when Flightgear is up. Most of the basic functionality is contained in <i>local_weather.nas</i> which is loaded at startup and identifies itself with a message.<p> This adds the items <i>Local Weather</i>, <i>Local Weather Tiles</i> and <i>Local Weather Config</i> to the <i>Environment</i> menu when Flightgear is up. Most of the basic functionality is contained in <i>local_weather.nas</i> which is loaded at startup and identifies itself with a message. A compatibility layer (<i>compat_layer.nas</i>) tests for hard-coded support and ensures that, dependent on the version, hard-coded or Nasal-coded fallback functions are used.<p>
Unless asked to do so from the menu, local weather does <b>not</b> run any process in the background. Upon loading, the package does not set any properties already existing, but only generates properties necessary for the menu entries in its own subdirectory <i>/local-weather/</i> in the tree. The package also does a features check on startup if particular functions are available in hard-coded form. If the features are not present, the package will largely still function properly using slower Nasal fallback code.<p> Unless asked to do so from the menu, local weather does <b>not</b> run any process in the background. Upon loading, the package does not set any properties already existing, but only generates properties necessary for the menu entries in its own subdirectory <i>/local-weather/</i> in the tree. The package also does a features check on startup if particular functions are available in hard-coded form. If the features are not present, the package will largely still function properly using slower Nasal fallback code.<p>
In order to use the hard-coded terrain presampling routines, it is currently necessary to add the line <b> --prop:/environment/terrain/area[0]/enabled=1</b> to the Flightgear commandline. If this is not done, the system will use the slower fallback routines.<p>
<h2>3. Functionality</h2> <h2>3. Functionality</h2>
@ -163,7 +164,7 @@ The following pictures show possible results of tile setups 'High-pressure-borde
<h3>Performance settings</h3> <h3>Performance settings</h3>
The performance setting menu is available from the main menubar. It controls the allocation of system resources to the various tasks.<p> The performance setting menu is available from the main menubar. It controls the allocation of system resources to the various tasks, as well as the behaviour of the offline weather system.<p>
<center> <center>
<img src="menu4.jpg"> <img src="menu4.jpg">
@ -179,10 +180,16 @@ From this, it is apparent that the two ranges should not be drastically differen
There are additional options to do asymmetric buffering, i.e. to 'cut' out a wedge in the rear of the aircraft in which the tile creation radius or the cloud visibility radius are lower. For example, setting the buffering ratio to 0.2 and the angle to 180 degrees corresponds to a very agressive buffering in which clouds in the rear hemisphere of the aircraft are almost absent and shown only to 20% of the set distance. This may increase performance by 20-30%, but only in straight flight - in fast turns, lots of clouds have to be shuffled from the buffer into the scenery and back, which is actually slower than never trying to cut a wedge at all. Also, agressive asymmetric buffering is not nice in external views as the reference is always the aircraft course.<p> There are additional options to do asymmetric buffering, i.e. to 'cut' out a wedge in the rear of the aircraft in which the tile creation radius or the cloud visibility radius are lower. For example, setting the buffering ratio to 0.2 and the angle to 180 degrees corresponds to a very agressive buffering in which clouds in the rear hemisphere of the aircraft are almost absent and shown only to 20% of the set distance. This may increase performance by 20-30%, but only in straight flight - in fast turns, lots of clouds have to be shuffled from the buffer into the scenery and back, which is actually slower than never trying to cut a wedge at all. Also, agressive asymmetric buffering is not nice in external views as the reference is always the aircraft course.<p>
The last option controls the amout of resources allocated to making clouds drift in the wind if dynamical weather is on. In order to avoid freezes, the weather dynamics system processes only a fixed number of clouds per frame inside the field of view. That means that faraway clouds do not necessarily move even with dynamical weather on. The slider indirectly controls the distance out to which clouds are being processed.<p> The buffering control can also optionally be tied to a target framerate. In this case, the visible range set with the slider is ignored and a control loop tries to adjust the visible range instead such that a 5-second average of the framerate is within 10% of a specified target framerate. Currently, the subsystem <i>only</i> adjusts the visible range of buffering - asymmetric buffering and/or tile loading range still needs to be specified manually. Also, the system cannot respond to unsolvable problems - if the framerate in the absence of clouds falls below 30, then no setting for the cloud range will bring it to 35. <p>
The next option controls the amout of resources allocated to making clouds drift in the wind if dynamical weather is on. In order to avoid freezes, the weather dynamics system processes only a fixed number of clouds per frame inside the field of view. That means that faraway clouds do not necessarily move even with dynamical weather on. The slider indirectly controls the distance out to which clouds are being processed.<p>
All performance setting menu-options work at runtime, but are processed over time rather than instantaneously, i.e. it takes 10-20 seconds till the new balance between buffered clouds and active clouds is reached after the slider is moved.<p> All performance setting menu-options work at runtime, but are processed over time rather than instantaneously, i.e. it takes 10-20 seconds till the new balance between buffered clouds and active clouds is reached after the slider is moved.<p>
The final options, weather pattern scales, deal with the long-range behaviour of the offline weather system. They are not parsed when the tile selection mode is set to <i>METAR</i>. The first slider controls the transition between different airmasses. In the default setting, the typical distance to encounter a different airmass when one flies in a 'High-pressure-core' tile is 200 km. The airmass slider allows to vary this distance between 200 and 800 km. <p>
Inside each tile, there are typically 4-8 different basic cloud patterns (distribution of layers) modelled, with a random pattern selected for each new tile of the given airmass classification. The <i>cloud patterns</i> slider adjusts the probability that the same cloud configuration is kept as long as a tile of the same airmass type is generated. Selecting a large scale in essence means that the theme of clouds will remain similar within each airmass, a small scale allows for more variation.<p>
<h2>4. Cloud models</h2> <h2>4. Cloud models</h2>
The package contains a number of different cloud models, both static ones for Cirrus and Cirrocumulus clouds as well as rotated ones for Altocumulus, Cirrostratus, Cumulus, Cumulonimbus, Stratus and Nimbostratus cloudlet models. Neither the cloud textures, nor the models nor the transformations are perfected, and any aspect can be improved, albeit at the cost of performance consumption.<p> The package contains a number of different cloud models, both static ones for Cirrus and Cirrocumulus clouds as well as rotated ones for Altocumulus, Cirrostratus, Cumulus, Cumulonimbus, Stratus and Nimbostratus cloudlet models. Neither the cloud textures, nor the models nor the transformations are perfected, and any aspect can be improved, albeit at the cost of performance consumption.<p>
@ -246,7 +253,7 @@ Effect volumes are always specified between a minimum and a maximum altitude, an
where <i>geometry</i> is a flag (1: circular, 2: elliptical and 3: rectangular), <i>lat</i> and <i>lon</i> are the latitude and longitude, <i>r1</i> and <i>r2</i> are the two size parameters for the elliptic or rectangular shape (for the circular shape, only the first is used), <i>phi</i> is the rotation angle of the shape (not used for circular shape), <i>alt_low</i> and <i>alt_high</i> are the altitude boundaries, <i>vis, rain, snow, turb</i> and <i>lift</i> are weather parameters which are either set to the value they should assume, or to -1 if they are not to be used, or to -2 if a function instead of a parameter is to be used and -3 if a function for wave lift is used. Since thermal lift can be set to negative values in a sink, a separate flag is provided in this case. <i>sat</i> finally determines the light saturation, a parameter between 0 (dark) and 1 (normal light) - it can be used to dim the light beneath cloud layers (which is not done automatically as objects don't cast shades in Flightgear, and given that most cloud models are rotated, their shade would look rather odd on any case).<p> where <i>geometry</i> is a flag (1: circular, 2: elliptical and 3: rectangular), <i>lat</i> and <i>lon</i> are the latitude and longitude, <i>r1</i> and <i>r2</i> are the two size parameters for the elliptic or rectangular shape (for the circular shape, only the first is used), <i>phi</i> is the rotation angle of the shape (not used for circular shape), <i>alt_low</i> and <i>alt_high</i> are the altitude boundaries, <i>vis, rain, snow, turb</i> and <i>lift</i> are weather parameters which are either set to the value they should assume, or to -1 if they are not to be used, or to -2 if a function instead of a parameter is to be used and -3 if a function for wave lift is used. Since thermal lift can be set to negative values in a sink, a separate flag is provided in this case. <i>sat</i> finally determines the light saturation, a parameter between 0 (dark) and 1 (normal light) - it can be used to dim the light beneath cloud layers (which is not done automatically as objects don't cast shades in Flightgear, and given that most cloud models are rotated, their shade would look rather odd on any case).<p>
In version 1.0, thermal lift and wave lift are implemented by function (wave lift is not yet automatically placed, but can be easily from Nasal). There is no easy way to implement any weather parameter by function in an effect volume, as this requires some amount of Nasal coding.<p> In version 1.1, thermal lift and wave lift are implemented by function (wave lift is not yet automatically placed, but can be easily from Nasal). There is no easy way to implement any weather parameter by function in an effect volume, as this requires some amount of Nasal coding.<p>
Both thermal lift and saturation require a more recent version of Flightgear than 2.0.0 in order to take effect.<p> Both thermal lift and saturation require a more recent version of Flightgear than 2.0.0 in order to take effect.<p>
@ -362,7 +369,7 @@ With default settings, the local weather package generates a 40x40 km weather ti
<li> Rain and snow may not start properly. For me, rain is only generated when I switch 'Shader effects' on and off in the menu on startup, otherwise neither moving the menu slider nor entering an effect volume generate rain. This seems to be a bug of some Flightgear versions, not of the local weather system.<p> <li> Rain and snow may not start properly. For me, rain is only generated when I switch 'Shader effects' on and off in the menu on startup, otherwise neither moving the menu slider nor entering an effect volume generate rain. This seems to be a bug of some Flightgear versions, not of the local weather system.<p>
<li> Especially with multiple overcast layers and weather fronts, loading and unloading weather tiles may take a long time / cause severe drops in framerate. It seems that a dual core processor is very valuable with this particular issue - try switching multiprocessor support on if needed, otherwise please refer to performance tuning to solve such problems. In general, overcast layers and tropical weather tiles do require a system on the high end of the performance scale to render properly.<p> <li> Especially with multiple overcast layers and weather fronts, loading and unloading weather tiles may take a long time / cause severe drops in framerate. It seems that a dual core processor is very valuable with this particular issue - try switching multiprocessor support on if needed, otherwise please refer to performance tuning to solve such problems. In more recent versions of Flightgear, an activated texture cache improves performance dramatically. In general, overcast layers and tropical weather tiles do require a system on the high end of the performance scale to render properly.<p>
<li> The local weather package is able to occasionally trigger errors like 'Warning:: Picked up error in TriangleIntersect'. These seem to be a problem in the core Flightgear code - the package does nothing but placing normal (rather simple) AC3D models into the scenery.<p> <li> The local weather package is able to occasionally trigger errors like 'Warning:: Picked up error in TriangleIntersect'. These seem to be a problem in the core Flightgear code - the package does nothing but placing normal (rather simple) AC3D models into the scenery.<p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -0,0 +1,106 @@
<PropertyList>
<config>
<asymmetric-buffering-flag type="bool" userarchive="y">0</asymmetric-buffering-flag>
<asymmetric-buffering-reduction type="double" userarchive="y">0.3</asymmetric-buffering-reduction>
<asymmetric-buffering-angle-deg type="double" userarchive="y">90.0</asymmetric-buffering-angle-deg>
<distance-to-load-tile-m type="double" userarchive="y">39000.0</distance-to-load-tile-m>
<distance-to-remove-tile-m type="double" userarchive="y">39500.0</distance-to-remove-tile-m>
<detailed-clouds-flag type="bool" userarchive="y">1</detailed-clouds-flag>
<dynamics-flag type="bool" userarchive="y">0</dynamics-flag>
<thermal-properties type="double" userarchive="y">1.0</thermal-properties>
<wind-model type="string" userarchive="y">constant</wind-model>
<buffer-flag type="bool" userarchive="y">1</buffer-flag>
<asymmetric-reduction type="double" userarchive="y">0.7</asymmetric-reduction>
<clouds-visible-range-m type="double" userarchive="y">30000.0</clouds-visible-range-m>
<clouds-in-dynamics-loop type="int" userarchive="y">250</clouds-in-dynamics-loop>
<debug-output-flag type="bool" userarchive="y">0</debug-output-flag>
<generate-thermal-lift-flag type="bool" userarchive="y">0</generate-thermal-lift-flag>
<dynamical-convection-flag type="bool" userarchive="y">0</dynamical-convection-flag>
<thread-flag type="bool" userarchive="n">1</thread-flag>
<presampling-flag type="bool" userarchive="y">1</presampling-flag>
<fps-control-flag type="bool" userarchive="y">0</fps-control-flag>
<target-framerate type="double" userarchive="y">25.0</target-framerate>
<large-scale-persistence type="double" userarchive="y">1.0</large-scale-persistence>
<small-scale-persistence type="double" userarchive="y">0.0</small-scale-persistence>
</config>
<tmp>
<tile-management type="string" userarchive="y">realistic weather</tile-management>
<tile-type type="string" userarchive="y">High-pressure</tile-type>
<tile-orientation-deg type="double" userarchive="y">260.0</tile-orientation-deg>
<windspeed-kt type="double" userarchive="y">8.0</windspeed-kt>
<gust-frequency-hz type="double" userarchive="n">0.0</gust-frequency-hz>
<gust-relative-strength type="double" userarchive="n">0.0</gust-relative-strength>
<gust-angular-variation-deg type="double" userarchive="n">0.0</gust-angular-variation-deg>
<tile-alt-offset-ft type="double" userarchive="n">0.0</tile-alt-offset-ft>
<asymmetric-tile-loading-flag type="bool" userarchive="y">0</asymmetric-tile-loading-flag>
<FL0-wind-from-heading-deg type="double" userarchive="y">260.0</FL0-wind-from-heading-deg>
<FL0-windspeed-kt type="double" userarchive="y">8.0</FL0-windspeed-kt>
<FL50-wind-from-heading-deg type="double" userarchive="y">262.0</FL50-wind-from-heading-deg>
<FL50-windspeed-kt type="double" userarchive="y">11.0</FL50-windspeed-kt>
<FL100-wind-from-heading-deg type="double" userarchive="y">264.0</FL100-wind-from-heading-deg>
<FL100-windspeed-kt type="double" userarchive="y">16.0</FL100-windspeed-kt>
<FL180-wind-from-heading-deg type="double" userarchive="y">265.0</FL180-wind-from-heading-deg>
<FL180-windspeed-kt type="double" userarchive="y">24.0</FL180-windspeed-kt>
<FL240-wind-from-heading-deg type="double" userarchive="y">269.0</FL240-wind-from-heading-deg>
<FL240-windspeed-kt type="double" userarchive="y">35.0</FL240-windspeed-kt>
<FL300-wind-from-heading-deg type="double" userarchive="y">273.0</FL300-wind-from-heading-deg>
<FL300-windspeed-kt type="double" userarchive="y">45.0</FL300-windspeed-kt>
<FL340-wind-from-heading-deg type="double" userarchive="y">274.0</FL340-wind-from-heading-deg>
<FL340-windspeed-kt type="double" userarchive="y">50.0</FL340-windspeed-kt>
<FL390-wind-from-heading-deg type="double" userarchive="y">273.0</FL390-wind-from-heading-deg>
<FL390-windspeed-kt type="double" userarchive="y">56.0</FL390-windspeed-kt>
<FL450-wind-from-heading-deg type="double" userarchive="y">272.0</FL450-wind-from-heading-deg>
<FL450-windspeed-kt type="double" userarchive="y">65.0</FL450-windspeed-kt>
<cloud-type type="string" userarchive="n">Altocumulus</cloud-type>
<alt type="double" userarchive="n">12000.0</alt>
<nx type="int" userarchive="n">5</nx>
<xoffset type="double" userarchive="n">800.0</xoffset>
<xedge type="double" userarchive="n">0.2</xedge>
<ny type="int" userarchive="n">15</ny>
<yoffset type="double" userarchive="n">800.0</yoffset>
<yedge type="double" userarchive="n">0.2</yedge>
<dir type="double" userarchive="n">0.0</dir>
<tri type="double" userarchive="n">1.0</tri>
<rnd-pos-x type="double" userarchive="n">400.0</rnd-pos-x>
<rnd-pos-y type="double" userarchive="n">400.0</rnd-pos-y>
<rnd-alt type="double" userarchive="n">300.0</rnd-alt>
<conv-strength type="double" userarchive="n">1.0</conv-strength>
<conv-size type="double" userarchive="n">15.0</conv-size>
<conv-alt type="double" userarchive="n">2000.0</conv-alt>
<bar-alt type="double" userarchive="n">3500.0</bar-alt>
<bar-n type="int" userarchive="n">150</bar-n>
<bar-dir type="double" userarchive="n">0.0</bar-dir>
<bar-dist type="double" userarchive="n">5.0</bar-dist>
<bar-size type="double" userarchive="n">10.0</bar-size>
<scloud-type type="string" userarchive="n">Altocumulus</scloud-type>
<scloud-subtype type="string" userarchive="n">small</scloud-subtype>
<scloud-alt type="double" userarchive="n">5000.0</scloud-alt>
<scloud-dir type="double" userarchive="n">0.0</scloud-dir>
<layer-type type="string" userarchive="n">Nimbus</layer-type>
<layer-rx type="double" userarchive="n">10.0</layer-rx>
<layer-ry type="double" userarchive="n">10.0</layer-ry>
<layer-phi type="double" userarchive="n">0.0</layer-phi>
<layer-alt type="double" userarchive="n">3000.0</layer-alt>
<layer-thickness type="double" userarchive="n">500.0</layer-thickness>
<layer-density type="double" userarchive="n">1.0</layer-density>
<layer-edge type="double" userarchive="n">10.0</layer-edge>
<layer-rain-flag type="bool" userarchive="n">1</layer-rain-flag>
<layer-rain-density type="double" userarchive="n">1.0</layer-rain-density>
<box-x-m type="double" userarchive="n">600.0</box-x-m>
<box-y-m type="double" userarchive="n">600.0</box-y-m>
<box-alt-ft type="double" userarchive="n">300.0</box-alt-ft>
<box-n type="int" userarchive="n">10</box-n>
<box-core-fraction type="double" userarchive="n">0.4</box-core-fraction>
<box-core-offset type="double" userarchive="n">0.2</box-core-offset>
<box-core-height type="double" userarchive="n">1.4</box-core-height>
<box-core-n type="int" userarchive="n">3</box-core-n>
<box-bottom-fraction type="double" userarchive="n">0.9</box-bottom-fraction>
<box-bottom-thickness type="double" userarchive="n">0.2</box-bottom-thickness>
<box-bottom-n type="int" userarchive="n">12</box-bottom-n>
</tmp>
</PropertyList>

View file

@ -415,8 +415,6 @@ return f_slow;
var interpolation_loop = func { var interpolation_loop = func {
var iNode = props.globals.getNode(lw~"interpolation", 1);
var cNode = props.globals.getNode(lw~"current", 1);
var viewpos = geo.aircraft_position(); var viewpos = geo.aircraft_position();
var sum_alt = 0.0; var sum_alt = 0.0;
@ -428,6 +426,15 @@ var sum_norm = 0.0;
var vis_before = getprop(lwi~"visibility-m"); var vis_before = getprop(lwi~"visibility-m");
# if applicable, do some work for fps sampling
if (fps_control_flag == 1)
{
fps_samples = fps_samples +1;
fps_sum = fps_sum + getprop("/sim/frame-rate");
}
# determine at which distance we no longer keep an interpolation point, needs to be larger for METAR since points are more scarce # determine at which distance we no longer keep an interpolation point, needs to be larger for METAR since points are more scarce
if (metar_flag == 1) if (metar_flag == 1)
@ -512,9 +519,9 @@ var alt1 = weather_dynamics.tile_convective_altitude[current_tile_index -1];
var alt2 = alt1 + 1500.0; var alt2 = alt1 + 1500.0;
var inc1 = 0.2; var inc1 = 0.1;
var inc2 = 5.0; var inc2 = 5.0;
var inc3 = 1.0; var inc3 = 0.5;
var alt_above_mean = altitude - current_mean_terrain_elevation; var alt_above_mean = altitude - current_mean_terrain_elevation;
@ -547,41 +554,58 @@ setprop(lwi~"turbulence",0.0);
# now check if an effect volume writes the property and set only if not # now check if an effect volume writes the property and set only if not
flag = props.globals.getNode("local-weather/effect-volumes/number-active-vis").getValue(); #flag = props.globals.getNode("local-weather/effect-volumes/number-active-vis").getValue();
if ((flag ==0) and (vis > 0.0)) flag = getprop("local-weather/effect-volumes/number-active-vis");
if ((flag ==0) and (vis > 0.0) and (getprop(lw~"lift-loop-flag") == 0))
{ {
cNode.getNode("visibility-m").setValue(vis); #cNode.getNode("visibility-m").setValue(vis);
setprop(lw~"current/visibility-m",vis);
compat_layer.setVisibility(vis); compat_layer.setVisibility(vis);
} }
flag = props.globals.getNode("local-weather/effect-volumes/number-active-turb").getValue(); #flag = props.globals.getNode("local-weather/effect-volumes/number-active-turb").getValue();
flag = getprop("local-weather/effect-volumes/number-active-turb");
if ((flag ==0)) if ((flag ==0))
{ {
cNode.getNode("turbulence").setValue(0.0); #cNode.getNode("turbulence").setValue(0.0);
setprop(lw~"current/turbulence",0.0);
compat_layer.setTurbulence(0.0); compat_layer.setTurbulence(0.0);
} }
flag = props.globals.getNode("local-weather/effect-volumes/number-active-lift").getValue(); #flag = props.globals.getNode("local-weather/effect-volumes/number-active-lift").getValue();
flag = getprop("local-weather/effect-volumes/number-active-lift");
if (flag ==0) if (flag ==0)
{ {
cNode.getNode("thermal-lift").setValue(0.0); #cNode.getNode("thermal-lift").setValue(0.0);
setprop(lw~"current/thermal-lift",0.0);
} }
# no need to check for these, as they are not modelled in effect volumes # no need to check for these, as they are not modelled in effect volumes
cNode.getNode("temperature-degc",1).setValue(T); #cNode.getNode("temperature-degc",1).setValue(T);
setprop(lw~"current/temperature-degc",T);
compat_layer.setTemperature(T); compat_layer.setTemperature(T);
cNode.getNode("dewpoint-degc",1).setValue(D); #cNode.getNode("dewpoint-degc",1).setValue(D);
setprop(lw~"current/dewpoint-degc", D);
compat_layer.setDewpoint(D); compat_layer.setDewpoint(D);
if (p>0.0) {cNode.getNode("pressure-sea-level-inhg",1).setValue(p); compat_layer.setPressure(p);} if (p>0.0)
{
#cNode.getNode("pressure-sea-level-inhg",1).setValue(p);
setprop(lw~"current/pressure-sea-level-inhg",p);
compat_layer.setPressure(p);
}
# now determine the local wind # now determine the local wind
var tile_index = props.globals.getNode(lw~"tiles").getChild("tile",4).getNode("tile-index").getValue(); #var tile_index = props.globals.getNode(lw~"tiles").getChild("tile",4).getNode("tile-index").getValue();
var tile_index = getprop(lw~"tiles/tile[4]/tile-index");
if (wind_model_flag ==1) # constant if (wind_model_flag ==1) # constant
{ {
@ -669,21 +693,33 @@ if (gust_frequency > 0.0)
var gust_relative_strength = getprop(lw~"tmp/gust-relative-strength"); var gust_relative_strength = getprop(lw~"tmp/gust-relative-strength");
var gust_angvar = getprop(lw~"tmp/gust-angular-variation-deg"); var gust_angvar = getprop(lw~"tmp/gust-angular-variation-deg");
var winddir_last = getprop(lwi~"wind-from-heading-deg");
var alt_scaling_factor = 1.2 * windspeed / 10.0; var alt_scaling_factor = 1.2 * windspeed / 10.0;
if (alt_scaling_factor < 1.0) {alt_scaling_factor = 1.0;} if (alt_scaling_factor < 1.0) {alt_scaling_factor = 1.0;}
# expected mean number of gusts in time interval (should be < 1) # expected mean number of gusts in time interval (should be < 1)
var p_gust = gust_frequency * interpolation_loop_time; var p_gust = gust_frequency * interpolation_loop_time;
winddir_change = 0.0;
if (rand() < p_gust) # we change the offsets for windspeed and direction if (rand() < p_gust) # we change the offsets for windspeed and direction
{ {
var alt_fact = 1.0 - altitude_agl/(boundary_alt * alt_scaling_factor); var alt_fact = 1.0 - altitude_agl/(boundary_alt * alt_scaling_factor);
if (alt_fact < 0.0) {alt_fact = 0.0}; if (alt_fact < 0.0) {alt_fact = 0.0};
windspeed_multiplier = (1.0 + ((rand()) * gust_relative_strength * alt_fact)); windspeed_multiplier = (1.0 + ((rand()) * gust_relative_strength * alt_fact));
winddir_change = alt_fact * (1.0 - 2.0 * rand() * gust_angvar); winddir_change = alt_fact * (1.0 - 2.0 * rand()) * gust_angvar;
winddir_change = winddir_change * 0.2; # Markov chain parameter, max. change per frame is 1/5
# if the Markov chain reaches the boundary, reflect
#print("Winddir: ", winddir, " winddir_last: ", winddir_last, " winddir_change: ", winddir_change);
if (weather_tile_management.relangle(winddir_last + winddir_change, winddir) > gust_angvar)
{winddir_change = -winddir_change;}
} }
windspeed_current = windspeed_current * windspeed_multiplier; windspeed_current = windspeed_current * windspeed_multiplier;
winddir = winddir + winddir_change; winddir = winddir_last + winddir_change;
} }
@ -692,13 +728,17 @@ if (gust_frequency > 0.0)
compat_layer.setWindSmoothly(winddir, windspeed_current); compat_layer.setWindSmoothly(winddir, windspeed_current);
iNode.getNode("wind-from-heading-deg").setValue(winddir); setprop(lwi~"wind-from-heading-deg", winddir);
iNode.getNode("wind-speed-kt").setValue(windspeed_current); setprop(lwi~"wind-speed-kt",windspeed_current);
cNode.getNode("wind-from-heading-deg").setValue(winddir); setprop(lw~"current/wind-from-heading-deg",winddir);
cNode.getNode("wind-speed-kt").setValue(windspeed_current); setprop(lw~"current/wind-speed-kt",windspeed_current);
#iNode.getNode("wind-from-heading-deg").setValue(winddir);
#iNode.getNode("wind-speed-kt").setValue(windspeed_current);
#cNode.getNode("wind-from-heading-deg").setValue(winddir);
#cNode.getNode("wind-speed-kt").setValue(windspeed_current);
if (getprop(lw~"interpolation-loop-flag") ==1) {settimer(interpolation_loop, interpolation_loop_time);} if (getprop(lw~"interpolation-loop-flag") ==1) {settimer(interpolation_loop, interpolation_loop_time);}
@ -777,6 +817,26 @@ if (getprop(lw~"wave-loop-flag") ==1)
lift = lift + getprop(lw~"current/wave-lift"); lift = lift + getprop(lw~"current/wave-lift");
} }
# compute a reduction in visibility when entering the cloudbase
var vis = getprop(lw~"interpolation/visibility-m");
if (alt > 0.9 * thermal.height)
{
var visibility_reduction = math.pow((alt - 0.9 * thermal.height)/(0.2 * thermal.height),0.1);
visibility_reduction = visibility_reduction * (1.0 - math.pow(d/(0.8*thermal.radius),14));
if (visibility_reduction > 1.0) {visibility_reduction = 1.0;} # this shouldn't ever happen
if (visibility_reduction < 0.0) {visibility_reduction = 0.0;}
vis = vis * (1.0 - 0.98 * visibility_reduction);
}
setprop(lw~"current/visibility-m",vis);
compat_layer.setVisibility(vis);
setprop(lw~"current/thermal-lift",lift); setprop(lw~"current/thermal-lift",lift);
compat_layer.setLift(lift); compat_layer.setLift(lift);
@ -1732,8 +1792,13 @@ settimer ( func {
setprop(lw~"tmp/presampling-status", "idle"); setprop(lw~"tmp/presampling-status", "idle");
# reset the random store
weather_tiles.rnd_store = rand();
# indicate that we are no longer running # indicate that we are no longer running
local_weather_running_flag = 0; local_weather_running_flag = 0;
} }
@ -1846,6 +1911,8 @@ var create_cumosys = func (blat, blon, balt, nc, size) {
if (detailed_clouds_flag == 1) if (detailed_clouds_flag == 1)
{nc = int(0.7 * nc);} {nc = int(0.7 * nc);}
nc = int(nc / cumulus_efficiency_factor);
if (thread_flag == 1) if (thread_flag == 1)
{setprop(lw~"tmp/convective-status", "computing"); {setprop(lw~"tmp/convective-status", "computing");
cumulus_loop(blat, blon, balt, nc, size);} cumulus_loop(blat, blon, balt, nc, size);}
@ -1861,7 +1928,7 @@ else
var cumulus_loop = func (blat, blon, balt, nc, size) { var cumulus_loop = func (blat, blon, balt, nc, size) {
var n = 25; var n = int(25/cumulus_efficiency_factor);
if (nc < 0) if (nc < 0)
{ {
@ -1951,7 +2018,7 @@ while (i < nc) {
# then decide if the thermal energy at the spot generates an updraft and a cloud # then decide if the thermal energy at the spot generates an updraft and a cloud
if (rand() < p) # we decide to place a cloud at this spot if (rand() < (p * cumulus_efficiency_factor)) # we decide to place a cloud at this spot
{ {
strength = (1.5 * rand() + (2.0 * p)) * t_factor2; # the strength of thermal activity at the spot strength = (1.5 * rand() + (2.0 * p)) * t_factor2; # the strength of thermal activity at the spot
if (strength > 1.0) if (strength > 1.0)
@ -2105,7 +2172,7 @@ while (i < nc) {
# check if to place a cloud with weight sqrt(p), the lifetime gets another sqrt(p) factor # check if to place a cloud with weight sqrt(p), the lifetime gets another sqrt(p) factor
if (rand() > math.sqrt(p)) if (rand() > math.sqrt(p * cumulus_efficiency_factor))
{i=i+1; continue;} {i=i+1; continue;}
@ -3168,8 +3235,8 @@ var set_wind_ipoint_metar = func (lat, lon, d0, v0) {
if (lat >0.0) {var dsign = -1.0;} else {var dsign = 1.0;} if (lat >0.0) {var dsign = -1.0;} else {var dsign = 1.0;}
var v1 = v0 * (1.0 + rand() * 0.2); var v1 = v0 * (1.0 + rand() * 0.1);
var d1 = d0 + dsign * 3.0 * rand(); var d1 = d0 + dsign * 2.0 * rand();
var v2 = v0 * (1.2 + rand() * 0.2); var v2 = v0 * (1.2 + rand() * 0.2);
var d2 = d0 + dsign * (3.0 * rand() + 2.0); var d2 = d0 + dsign * (3.0 * rand() + 2.0);
@ -3225,11 +3292,11 @@ if (getprop(lw~"config/generate-thermal-lift-flag") ==1) {generate_thermal_lift_
thread_flag = getprop(lw~"config/thread-flag"); thread_flag = getprop(lw~"config/thread-flag");
dynamics_flag = getprop(lw~"config/dynamics-flag"); dynamics_flag = getprop(lw~"config/dynamics-flag");
presampling_flag = getprop(lw~"tmp/presampling-flag"); presampling_flag = getprop(lw~"config/presampling-flag");
detailed_clouds_flag = getprop(lw~"config/detailed-clouds-flag"); detailed_clouds_flag = getprop(lw~"config/detailed-clouds-flag");
dynamical_convection_flag = getprop(lw~"config/dynamical-convection-flag"); dynamical_convection_flag = getprop(lw~"config/dynamical-convection-flag");
debug_output_flag = getprop(lw~"config/debug-output-flag"); debug_output_flag = getprop(lw~"config/debug-output-flag");
fps_control_flag = getprop(lw~"config/fps-control-flag");
} }
@ -3825,8 +3892,12 @@ setprop(lw~"METAR/layer[3]/cover-oct",0);
setprop(lw~"METAR/layer[3]/alt-agl-ft", 20000.0); setprop(lw~"METAR/layer[3]/alt-agl-ft", 20000.0);
setprop(lw~"METAR/available-flag",1); setprop(lw~"METAR/available-flag",1);
# set initial value for stored random number for small-scale cloud patterns
# set listener for worker threads weather_tiles.rnd_store = rand();
# set listeners
setlistener(lw~"tmp/thread-status", func {var s = size(clouds_path); compat_layer.create_cloud_array(s, clouds_path, clouds_lat, clouds_lon, clouds_alt, clouds_orientation); }); setlistener(lw~"tmp/thread-status", func {var s = size(clouds_path); compat_layer.create_cloud_array(s, clouds_path, clouds_lat, clouds_lon, clouds_alt, clouds_orientation); });
setlistener(lw~"tmp/convective-status", func {var s = size(clouds_path); compat_layer.create_cloud_array(s, clouds_path, clouds_lat, clouds_lon, clouds_alt, clouds_orientation); }); setlistener(lw~"tmp/convective-status", func {var s = size(clouds_path); compat_layer.create_cloud_array(s, clouds_path, clouds_lat, clouds_lon, clouds_alt, clouds_orientation); });
@ -3840,6 +3911,12 @@ setlistener(lw~"config/clouds-in-dynamics-loop", func {weather_dynamics.max_clou
setlistener(lw~"config/clouds-visible-range-m", func {weather_tile_management.cloud_view_distance = getprop(lw~"config/clouds-visible-range-m");}); setlistener(lw~"config/clouds-visible-range-m", func {weather_tile_management.cloud_view_distance = getprop(lw~"config/clouds-visible-range-m");});
setlistener(lw~"config/distance-to-load-tile-m", func {setprop(lw~"config/distance-to-remove-tile-m",getprop(lw~"config/distance-to-load-tile-m") + 500.0);}); setlistener(lw~"config/distance-to-load-tile-m", func {setprop(lw~"config/distance-to-remove-tile-m",getprop(lw~"config/distance-to-load-tile-m") + 500.0);});
setlistener(lw~"config/fps-control-flag", func {fps_control_flag = getprop(lw~"config/fps-control-flag");});
setlistener(lw~"config/target-framerate", func {target_framerate = getprop(lw~"config/target-framerate");});
setlistener(lw~"config/small-scale-persistence", func {weather_tiles.small_scale_persistence = getprop(lw~"config/small-scale-persistence");});
} }
@ -4152,12 +4229,10 @@ var windIpointArray = [];
var wind_model_flag = 1; var wind_model_flag = 1;
# a global determining the relative amount of different textures in detailed convective clouds # globals governing properties of the Cumulus system
var convective_texture_mix = 0.0; var convective_texture_mix = 0.0;
var cumulus_efficiency_factor = 1.0;
# a global keeping track of the mean cloud altitude when building a Cumulus from individual cloudlets
var cloud_mean_altitude = 0.0; var cloud_mean_altitude = 0.0;
# globals keeping track of the lifetime when building a Cumulus from individual cloudlets # globals keeping track of the lifetime when building a Cumulus from individual cloudlets
@ -4181,69 +4256,76 @@ var dynamical_convection_flag = 1;
var debug_output_flag = 1; var debug_output_flag = 1;
var metar_flag = 0; var metar_flag = 0;
var local_weather_running_flag = 0; var local_weather_running_flag = 0;
var fps_control_flag = 1;
# globals for framerate controlled cloud management
var fps_average = 0.0;
var fps_samples = 0;
var fps_sum = 0.0;
var target_framerate = 25.0;
# set all sorts of default properties for the menu # set all sorts of default properties for the menu
setprop(lw~"tmp/cloud-type", "Altocumulus"); # setprop(lw~"tmp/cloud-type", "Altocumulus");
setprop(lw~"tmp/alt", 12000.0); # setprop(lw~"tmp/alt", 12000.0);
setprop(lw~"tmp/nx",5); # setprop(lw~"tmp/nx",5);
setprop(lw~"tmp/xoffset",800.0); # setprop(lw~"tmp/xoffset",800.0);
setprop(lw~"tmp/xedge", 0.2); # setprop(lw~"tmp/xedge", 0.2);
setprop(lw~"tmp/ny",15); # setprop(lw~"tmp/ny",15);
setprop(lw~"tmp/yoffset",800.0); # setprop(lw~"tmp/yoffset",800.0);
setprop(lw~"tmp/yedge", 0.2); # setprop(lw~"tmp/yedge", 0.2);
setprop(lw~"tmp/dir",0.0); # setprop(lw~"tmp/dir",0.0);
setprop(lw~"tmp/tri", 1.0); # setprop(lw~"tmp/tri", 1.0);
setprop(lw~"tmp/rnd-pos-x",400.0); # setprop(lw~"tmp/rnd-pos-x",400.0);
setprop(lw~"tmp/rnd-pos-y",400.0); # setprop(lw~"tmp/rnd-pos-y",400.0);
setprop(lw~"tmp/rnd-alt", 300.0); # setprop(lw~"tmp/rnd-alt", 300.0);
setprop(lw~"tmp/conv-strength", 1); # setprop(lw~"tmp/conv-strength", 1);
setprop(lw~"tmp/conv-size", 15.0); # setprop(lw~"tmp/conv-size", 15.0);
setprop(lw~"tmp/conv-alt", 2000.0); # setprop(lw~"tmp/conv-alt", 2000.0);
setprop(lw~"tmp/bar-alt", 3500.0); # setprop(lw~"tmp/bar-alt", 3500.0);
setprop(lw~"tmp/bar-n", 150.0); # setprop(lw~"tmp/bar-n", 150.0);
setprop(lw~"tmp/bar-dir", 0.0); # setprop(lw~"tmp/bar-dir", 0.0);
setprop(lw~"tmp/bar-dist", 5.0); # setprop(lw~"tmp/bar-dist", 5.0);
setprop(lw~"tmp/bar-size", 10.0); # setprop(lw~"tmp/bar-size", 10.0);
setprop(lw~"tmp/scloud-type", "Altocumulus"); # setprop(lw~"tmp/scloud-type", "Altocumulus");
setprop(lw~"tmp/scloud-subtype", "small"); # setprop(lw~"tmp/scloud-subtype", "small");
setprop(lw~"tmp/scloud-lat",getprop("position/latitude-deg")); setprop(lw~"tmp/scloud-lat",getprop("position/latitude-deg"));
setprop(lw~"tmp/scloud-lon",getprop("position/longitude-deg")); setprop(lw~"tmp/scloud-lon",getprop("position/longitude-deg"));
setprop(lw~"tmp/scloud-alt", 5000.0); # setprop(lw~"tmp/scloud-alt", 5000.0);
setprop(lw~"tmp/scloud-dir", 0.0); # setprop(lw~"tmp/scloud-dir", 0.0);
setprop(lw~"tmp/layer-type","Nimbus"); # setprop(lw~"tmp/layer-type","Nimbus");
setprop(lw~"tmp/layer-rx",10.0); # setprop(lw~"tmp/layer-rx",10.0);
setprop(lw~"tmp/layer-ry",10.0); # setprop(lw~"tmp/layer-ry",10.0);
setprop(lw~"tmp/layer-phi",0.0); # setprop(lw~"tmp/layer-phi",0.0);
setprop(lw~"tmp/layer-alt",3000.0); # setprop(lw~"tmp/layer-alt",3000.0);
setprop(lw~"tmp/layer-thickness",500.0); # setprop(lw~"tmp/layer-thickness",500.0);
setprop(lw~"tmp/layer-density",1.0); # setprop(lw~"tmp/layer-density",1.0);
setprop(lw~"tmp/layer-edge",0.2); # setprop(lw~"tmp/layer-edge",0.2);
setprop(lw~"tmp/layer-rain-flag",1); # setprop(lw~"tmp/layer-rain-flag",1);
setprop(lw~"tmp/layer-rain-density",1.0); # setprop(lw~"tmp/layer-rain-density",1.0);
setprop(lw~"tmp/box-x-m",600.0); # setprop(lw~"tmp/box-x-m",600.0);
setprop(lw~"tmp/box-y-m",600.0); # setprop(lw~"tmp/box-y-m",600.0);
setprop(lw~"tmp/box-alt-ft",300.0); # setprop(lw~"tmp/box-alt-ft",300.0);
setprop(lw~"tmp/box-n",10); # setprop(lw~"tmp/box-n",10);
setprop(lw~"tmp/box-core-fraction",0.4); # setprop(lw~"tmp/box-core-fraction",0.4);
setprop(lw~"tmp/box-core-offset",0.2); # setprop(lw~"tmp/box-core-offset",0.2);
setprop(lw~"tmp/box-core-height",1.4); # setprop(lw~"tmp/box-core-height",1.4);
setprop(lw~"tmp/box-core-n",3); # setprop(lw~"tmp/box-core-n",3);
setprop(lw~"tmp/box-bottom-fraction",0.9); # setprop(lw~"tmp/box-bottom-fraction",0.9);
setprop(lw~"tmp/box-bottom-thickness",0.5); # setprop(lw~"tmp/box-bottom-thickness",0.5);
setprop(lw~"tmp/box-bottom-n",12); # setprop(lw~"tmp/box-bottom-n",12);
setprop(lw~"tmp/tile-type", "High-pressure"); # setprop(lw~"tmp/tile-type", "High-pressure");
setprop(lw~"tmp/tile-orientation-deg", 260.0); # setprop(lw~"tmp/tile-orientation-deg", 260.0);
setprop(lw~"tmp/windspeed-kt", 8.0); # setprop(lw~"tmp/windspeed-kt", 8.0);
setprop(lw~"tmp/gust-frequency-hz", 0.0); # setprop(lw~"tmp/gust-frequency-hz", 0.0);
setprop(lw~"tmp/gust-relative-strength",0.0); # setprop(lw~"tmp/gust-relative-strength",0.0);
setprop(lw~"tmp/gust-angular-variation-deg",0.0); # setprop(lw~"tmp/gust-angular-variation-deg",0.0);
setprop(lw~"tmp/tile-alt-offset-ft", 0.0); # setprop(lw~"tmp/tile-alt-offset-ft", 0.0);
setprop(lw~"tmp/tile-alt-median-ft",0.0); setprop(lw~"tmp/tile-alt-median-ft",0.0);
setprop(lw~"tmp/tile-alt-min-ft",0.0); setprop(lw~"tmp/tile-alt-min-ft",0.0);
setprop(lw~"tmp/tile-management", "realistic weather"); # setprop(lw~"tmp/tile-management", "realistic weather");
setprop(lw~"tmp/presampling-flag", 1); # setprop(lw~"tmp/asymmetric-tile-loading-flag", 0);
setprop(lw~"tmp/asymmetric-tile-loading-flag", 0);
setprop(lw~"tmp/last-reading-pos-del",0); setprop(lw~"tmp/last-reading-pos-del",0);
setprop(lw~"tmp/last-reading-pos-mod",0); setprop(lw~"tmp/last-reading-pos-mod",0);
setprop(lw~"tmp/thread-status", "idle"); setprop(lw~"tmp/thread-status", "idle");
@ -4251,47 +4333,48 @@ setprop(lw~"tmp/convective-status", "idle");
setprop(lw~"tmp/presampling-status", "idle"); setprop(lw~"tmp/presampling-status", "idle");
setprop(lw~"tmp/buffer-status", "idle"); setprop(lw~"tmp/buffer-status", "idle");
setprop(lw~"tmp/buffer-tile-index", 0); setprop(lw~"tmp/buffer-tile-index", 0);
setprop(lw~"tmp/FL0-wind-from-heading-deg",260.0); #setprop(lw~"tmp/FL0-wind-from-heading-deg",260.0);
setprop(lw~"tmp/FL0-windspeed-kt",8.0); #setprop(lw~"tmp/FL0-windspeed-kt",8.0);
setprop(lw~"tmp/FL50-wind-from-heading-deg",262.0); #setprop(lw~"tmp/FL50-wind-from-heading-deg",262.0);
setprop(lw~"tmp/FL50-windspeed-kt",11.0); #setprop(lw~"tmp/FL50-windspeed-kt",11.0);
setprop(lw~"tmp/FL100-wind-from-heading-deg",264.0); #setprop(lw~"tmp/FL100-wind-from-heading-deg",264.0);
setprop(lw~"tmp/FL100-windspeed-kt",16.0); #setprop(lw~"tmp/FL100-windspeed-kt",16.0);
setprop(lw~"tmp/FL180-wind-from-heading-deg",265.0); #setprop(lw~"tmp/FL180-wind-from-heading-deg",265.0);
setprop(lw~"tmp/FL180-windspeed-kt",24.0); #setprop(lw~"tmp/FL180-windspeed-kt",24.0);
setprop(lw~"tmp/FL240-wind-from-heading-deg",269.0); #setprop(lw~"tmp/FL240-wind-from-heading-deg",269.0);
setprop(lw~"tmp/FL240-windspeed-kt",35.0); #setprop(lw~"tmp/FL240-windspeed-kt",35.0);
setprop(lw~"tmp/FL300-wind-from-heading-deg",273.0); #setprop(lw~"tmp/FL300-wind-from-heading-deg",273.0);
setprop(lw~"tmp/FL300-windspeed-kt",45.0); #setprop(lw~"tmp/FL300-windspeed-kt",45.0);
setprop(lw~"tmp/FL340-wind-from-heading-deg",274.0); #setprop(lw~"tmp/FL340-wind-from-heading-deg",274.0);
setprop(lw~"tmp/FL340-windspeed-kt",50.0); #setprop(lw~"tmp/FL340-windspeed-kt",50.0);
setprop(lw~"tmp/FL390-wind-from-heading-deg",273.0); #setprop(lw~"tmp/FL390-wind-from-heading-deg",273.0);
setprop(lw~"tmp/FL390-windspeed-kt",56.0); #setprop(lw~"tmp/FL390-windspeed-kt",56.0);
setprop(lw~"tmp/FL450-wind-from-heading-deg",272.0); #setprop(lw~"tmp/FL450-wind-from-heading-deg",272.0);
setprop(lw~"tmp/FL450-windspeed-kt",65.0); #setprop(lw~"tmp/FL450-windspeed-kt",65.0);
setprop(lw~"tmp/ipoint-latitude-deg",getprop("position/latitude-deg")); setprop(lw~"tmp/ipoint-latitude-deg",getprop("position/latitude-deg"));
setprop(lw~"tmp/ipoint-longitude-deg",getprop("position/longitude-deg")); setprop(lw~"tmp/ipoint-longitude-deg",getprop("position/longitude-deg"));
# set config values # set config values
setprop(lw~"config/distance-to-load-tile-m",39000.0); # setprop(lw~"config/distance-to-load-tile-m",39000.0);
setprop(lw~"config/distance-to-remove-tile-m",39500.0); # setprop(lw~"config/distance-to-remove-tile-m",39500.0);
setprop(lw~"config/detailed-clouds-flag",1); # setprop(lw~"config/detailed-clouds-flag",1);
setprop(lw~"config/dynamics-flag",0); # setprop(lw~"config/dynamics-flag",0);
setprop(lw~"config/thermal-properties",1.0); # setprop(lw~"config/thermal-properties",1.0);
setprop(lw~"config/wind-model","constant"); # setprop(lw~"config/wind-model","constant");
setprop(lw~"config/buffer-flag",1); # setprop(lw~"config/buffer-flag",1);
setprop(lw~"config/asymmetric-reduction",0.7); # setprop(lw~"config/asymmetric-reduction",0.7);
setprop(lw~"config/clouds-visible-range-m",30000.0); # setprop(lw~"config/clouds-visible-range-m",30000.0);
setprop(lw~"config/asymmetric-buffering-flag",0); # setprop(lw~"config/asymmetric-buffering-flag",0);
setprop(lw~"config/asymmetric-buffering-reduction",0.3); # setprop(lw~"config/asymmetric-buffering-reduction",0.3);
setprop(lw~"config/asymmetric-buffering-angle-deg",90.0); # setprop(lw~"config/asymmetric-buffering-angle-deg",90.0);
setprop(lw~"config/clouds-in-dynamics-loop",250); # setprop(lw~"config/clouds-in-dynamics-loop",250);
setprop(lw~"config/debug-output-flag",0); # setprop(lw~"config/debug-output-flag",0);
setprop(lw~"config/generate-thermal-lift-flag", 0); # setprop(lw~"config/generate-thermal-lift-flag", 0);
setprop(lw~"config/dynamical-convection-flag", 0); # setprop(lw~"config/dynamical-convection-flag", 0);
setprop(lw~"config/thread-flag", 1); # setprop(lw~"config/thread-flag", 1);
# setprop(lw~"config/presampling-flag", 1);
# set the default loop flags to loops inactive # set the default loop flags to loops inactive

View file

@ -62,6 +62,35 @@ if ((local_weather.metar_flag == 1) and (getprop(lw~"METAR/station-id") != getpr
weather_tiles.set_METAR_weather_station(); weather_tiles.set_METAR_weather_station();
} }
# compute the averaged framerate and see if cloud visibility needs to be adjusted
if (local_weather.fps_control_flag == 1)
{
local_weather.fps_average = local_weather.fps_sum/local_weather.fps_samples;
# print("Average framerate: ", local_weather.fps_average);
local_weather.fps_sum = 0.0;
local_weather.fps_samples = 0;
if (local_weather.fps_average > 1.1 * local_weather.target_framerate)
{
var target_cloud_view_distance = cloud_view_distance * 1.1;
if (target_cloud_view_distance > 45000.0)
{target_cloud_view_distance = 45000.0;}
setprop(lw~"config/clouds-visible-range-m", target_cloud_view_distance);
}
if (local_weather.fps_average < 0.9 * local_weather.target_framerate)
{
var target_cloud_view_distance = cloud_view_distance * 0.9;
if (target_cloud_view_distance < 15000.0)
{target_cloud_view_distance = 15000.0;}
setprop(lw~"config/clouds-visible-range-m", target_cloud_view_distance);
}
}
foreach (var t; tNode) { foreach (var t; tNode) {
@ -441,7 +470,7 @@ if (getprop(lw~"tmp/tile-management") == "repeat tile")
else if (code == "cold_sector") {weather_tiles.set_cold_sector_tile();} else if (code == "cold_sector") {weather_tiles.set_cold_sector_tile();}
else if (code == "warm_sector") {weather_tiles.set_warm_sector_tile();} else if (code == "warm_sector") {weather_tiles.set_warm_sector_tile();}
else if (code == "tropical_weather") {weather_tiles.set_tropical_weather_tile();} else if (code == "tropical_weather") {weather_tiles.set_tropical_weather_tile();}
#else if (code == "test") {weather_tiles.set_4_8_stratus_tile;} else if (code == "test") {weather_tiles.set_4_8_stratus_tile();}
else else
{ {
print("Repeat tile not implemented with this tile type!"); print("Repeat tile not implemented with this tile type!");
@ -450,50 +479,50 @@ if (getprop(lw~"tmp/tile-management") == "repeat tile")
} }
else if (getprop(lw~"tmp/tile-management") == "realistic weather") else if (getprop(lw~"tmp/tile-management") == "realistic weather")
{ {
var rn = rand(); var rn = rand() * getprop(lw~"config/large-scale-persistence");
if (code == "low_pressure_core") if (code == "low_pressure_core")
{ {
if (rn > 0.2) {weather_tiles.set_low_pressure_core_tile();} if (rn > 0.1) {weather_tiles.set_low_pressure_core_tile();}
else {weather_tiles.set_low_pressure_tile();} else {weather_tiles.set_low_pressure_tile();}
} }
else if (code == "low_pressure") else if (code == "low_pressure")
{ {
if (rn > 0.2) {weather_tiles.set_low_pressure_tile();} if (rn > 0.1) {weather_tiles.set_low_pressure_tile();}
else if (rn > 0.1) {weather_tiles.set_low_pressure_core_tile();} else if (rn > 0.05) {weather_tiles.set_low_pressure_core_tile();}
else {weather_tiles.set_low_pressure_border_tile();} else {weather_tiles.set_low_pressure_border_tile();}
} }
else if (code == "low_pressure_border") else if (code == "low_pressure_border")
{ {
if (rn > 0.4) {weather_tiles.set_low_pressure_border_tile();} if (rn > 0.2) {weather_tiles.set_low_pressure_border_tile();}
else if (rn > 0.3) {weather_tiles.set_cold_sector_tile();} else if (rn > 0.15) {weather_tiles.set_cold_sector_tile();}
else if (rn > 0.2) {weather_tiles.set_warm_sector_tile();} else if (rn > 0.1) {weather_tiles.set_warm_sector_tile();}
else if (rn > 0.1) {weather_tiles.set_low_pressure_tile();} else if (rn > 0.05) {weather_tiles.set_low_pressure_tile();}
else {weather_tiles.set_high_pressure_border_tile();} else {weather_tiles.set_high_pressure_border_tile();}
} }
else if (code == "high_pressure_border") else if (code == "high_pressure_border")
{ {
if (rn > 0.4) {weather_tiles.set_high_pressure_border_tile();} if (rn > 0.2) {weather_tiles.set_high_pressure_border_tile();}
else if (rn > 0.3) {weather_tiles.set_cold_sector_tile();} else if (rn > 0.15) {weather_tiles.set_cold_sector_tile();}
else if (rn > 0.2) {weather_tiles.set_warm_sector_tile();} else if (rn > 0.1) {weather_tiles.set_warm_sector_tile();}
else if (rn > 0.1) {weather_tiles.set_high_pressure_tile();} else if (rn > 0.05) {weather_tiles.set_high_pressure_tile();}
else {weather_tiles.set_low_pressure_border_tile();} else {weather_tiles.set_low_pressure_border_tile();}
} }
else if (code == "high_pressure") else if (code == "high_pressure")
{ {
if (rn > 0.2) {weather_tiles.set_high_pressure_tile();} if (rn > 0.1) {weather_tiles.set_high_pressure_tile();}
else if (rn > 0.1) {weather_tiles.set_high_pressure_border_tile();} else if (rn > 0.05) {weather_tiles.set_high_pressure_border_tile();}
else {weather_tiles.set_high_pressure_core_tile();} else {weather_tiles.set_high_pressure_core_tile();}
} }
else if (code == "high_pressure_core") else if (code == "high_pressure_core")
{ {
if (rn > 0.2) {weather_tiles.set_high_pressure_core_tile();} if (rn > 0.1) {weather_tiles.set_high_pressure_core_tile();}
else {weather_tiles.set_high_pressure_tile();} else {weather_tiles.set_high_pressure_tile();}
} }
else if (code == "cold_sector") else if (code == "cold_sector")
{ {
if (rn > 0.3) {weather_tiles.set_cold_sector_tile();} if (rn > 0.15) {weather_tiles.set_cold_sector_tile();}
else if (rn > 0.2) else if (rn > 0.1)
{ {
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_warmfront1_tile();} {weather_tiles.set_warmfront1_tile();}
@ -502,13 +531,13 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_coldfront_tile();} {weather_tiles.set_coldfront_tile();}
} }
else if (rn > 0.1) {weather_tiles.set_low_pressure_border_tile();} else if (rn > 0.05) {weather_tiles.set_low_pressure_border_tile();}
else {weather_tiles.set_high_pressure_border_tile();} else {weather_tiles.set_high_pressure_border_tile();}
} }
else if (code == "warm_sector") else if (code == "warm_sector")
{ {
if (rn > 0.3) {weather_tiles.set_warm_sector_tile();} if (rn > 0.15) {weather_tiles.set_warm_sector_tile();}
else if (rn > 0.2) else if (rn > 0.1)
{ {
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_coldfront_tile();} {weather_tiles.set_coldfront_tile();}
@ -517,7 +546,7 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_warmfront4_tile();} {weather_tiles.set_warmfront4_tile();}
} }
else if (rn > 0.1) {weather_tiles.set_low_pressure_border_tile();} else if (rn > 0.05) {weather_tiles.set_low_pressure_border_tile();}
else {weather_tiles.set_high_pressure_border_tile();} else {weather_tiles.set_high_pressure_border_tile();}
} }
else if (code == "warmfront1") else if (code == "warmfront1")
@ -525,7 +554,12 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_warmfront2_tile();} {weather_tiles.set_warmfront2_tile();}
else if ((dir_index ==3) or (dir_index ==5)) else if ((dir_index ==3) or (dir_index ==5))
{
if (rand() > 0.15)
{weather_tiles.set_warmfront1_tile();} {weather_tiles.set_warmfront1_tile();}
else
{weather_tiles.set_high_pressure_border_tile();}
}
else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_cold_sector_tile();} {weather_tiles.set_cold_sector_tile();}
} }
@ -534,7 +568,12 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_warmfront3_tile();} {weather_tiles.set_warmfront3_tile();}
if ((dir_index ==3) or (dir_index ==5)) if ((dir_index ==3) or (dir_index ==5))
{
if (rand() > 0.15)
{weather_tiles.set_warmfront2_tile();} {weather_tiles.set_warmfront2_tile();}
else
{weather_tiles.set_high_pressure_border_tile();}
}
if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_warmfront1_tile();} {weather_tiles.set_warmfront1_tile();}
} }
@ -543,7 +582,12 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_warmfront4_tile();} {weather_tiles.set_warmfront4_tile();}
if ((dir_index ==3) or (dir_index ==5)) if ((dir_index ==3) or (dir_index ==5))
{
if (rand() > 0.15)
{weather_tiles.set_warmfront3_tile();} {weather_tiles.set_warmfront3_tile();}
else
{weather_tiles.set_low_pressure_border_tile();}
}
if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_warmfront2_tile();} {weather_tiles.set_warmfront2_tile();}
} }
@ -552,7 +596,12 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_warm_sector_tile();} {weather_tiles.set_warm_sector_tile();}
if ((dir_index ==3) or (dir_index ==5)) if ((dir_index ==3) or (dir_index ==5))
{
if (rand() > 0.15)
{weather_tiles.set_warmfront4_tile();} {weather_tiles.set_warmfront4_tile();}
else
{weather_tiles.set_low_pressure_tile();}
}
if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_warmfront3_tile();} {weather_tiles.set_warmfront3_tile();}
} }
@ -561,7 +610,12 @@ else if (getprop(lw~"tmp/tile-management") == "realistic weather")
if ((dir_index ==0) or (dir_index ==1) or (dir_index==2)) if ((dir_index ==0) or (dir_index ==1) or (dir_index==2))
{weather_tiles.set_cold_sector_tile();} {weather_tiles.set_cold_sector_tile();}
else if ((dir_index ==3) or (dir_index ==5)) else if ((dir_index ==3) or (dir_index ==5))
{
if (rand() > 0.15)
{weather_tiles.set_coldfront_tile();} {weather_tiles.set_coldfront_tile();}
else
{weather_tiles.set_high_pressure_border_tile();}
}
else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8)) else if ((dir_index ==6) or (dir_index ==7) or (dir_index==8))
{weather_tiles.set_warm_sector_tile();} {weather_tiles.set_warm_sector_tile();}
} }
@ -1379,8 +1433,7 @@ var lon_to_m = 0.0; #local_weather.lon_to_m;
var m_to_lon = 0.0; # local_weather.m_to_lon; var m_to_lon = 0.0; # local_weather.m_to_lon;
var lw = "/local-weather/"; var lw = "/local-weather/";
var cloud_view_distance = 20000.0; var cloud_view_distance = getprop(lw~"config/clouds-visible-range-m");
var modelArrays = []; var modelArrays = [];
var active_tile_list = []; var active_tile_list = [];

View file

@ -29,7 +29,10 @@ var current_code = getprop(lw~"tiles/code");
var dir_index = getprop(lw~"tiles/tmp/dir-index"); var dir_index = getprop(lw~"tiles/tmp/dir-index");
props.globals.getNode(lw~"tiles").getChild("tile",dir_index).getNode("code").setValue(current_code); props.globals.getNode(lw~"tiles").getChild("tile",dir_index).getNode("code").setValue(current_code);
#print(current_code, getprop(lw~"tiles/tmp/code"));
if (current_code != getprop(lw~"tiles/tmp/code"))
{weather_tiles.rnd_store = rand();}
# generate a handling array for models # generate a handling array for models
@ -95,7 +98,7 @@ calc_geo(blat);
local_weather.set_weather_station(blat, blon, alt_offset, 20000.0, 14.0, 12.0, 29.78); local_weather.set_weather_station(blat, blon, alt_offset, 20000.0, 14.0, 12.0, 29.78);
create_8_8_nimbus_var3(blat, blon, 2000.0 + alt_offset+local_weather.cloud_vertical_size_map["Nimbus"] * 0.5 * m_to_ft, 0.0); # create_8_8_nimbus_var3(blat, blon, 2000.0 + alt_offset+local_weather.cloud_vertical_size_map["Nimbus"] * 0.5 * m_to_ft, 0.0);
#create_2_8_sstratus_streak(blat, blon,5000.0,0.0); #create_2_8_sstratus_streak(blat, blon,5000.0,0.0);
@ -105,7 +108,7 @@ create_8_8_nimbus_var3(blat, blon, 2000.0 + alt_offset+local_weather.cloud_verti
# create_2_8_cirrocumulus(blat, blon, 6000.0, 0.0); # create_2_8_cirrocumulus(blat, blon, 6000.0, 0.0);
#create_detailed_stratocumulus_bank(blat, blon,5000.0+alt_offset,0.0); create_detailed_small_stratocumulus_bank(blat, blon,3000.0+alt_offset,0.0);
#create_4_8_altocumulus_perlucidus(blat, blon, 10000.0, 0.0); #create_4_8_altocumulus_perlucidus(blat, blon, 10000.0, 0.0);
@ -151,7 +154,7 @@ calc_geo(blat);
# get probabilistic values for the weather parameters # get probabilistic values for the weather parameters
var vis = 35000.0 + rand() * 20000.0; var vis = 30000.0 + rand() * 15000.0;
var T = 20.0 + rand() * 10.0; var T = 20.0 + rand() * 10.0;
var spread = 5.0 + 3.0 * rand(); var spread = 5.0 + 3.0 * rand();
var D = T - spread; var D = T - spread;
@ -164,11 +167,16 @@ local_weather.set_weather_station(blat, blon, alt_offset, vis, T, D, p * hp_to_i
var alt = spread * 1000; var alt = spread * 1000;
var strength = 0.0; var strength = 0.0;
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
if (rn > 0.66) if (rn > 0.8)
{ {
# cloud scenario 1: weak cumulus development and blue thermals # cloud scenario 1: weak cumulus development and blue thermals
@ -186,7 +194,7 @@ if (rn > 0.66)
} }
} }
else if (rn > 0.33) else if (rn > 0.6)
{ {
# cloud scenario 2: some Cirrocumulus patches # cloud scenario 2: some Cirrocumulus patches
@ -194,8 +202,10 @@ else if (rn > 0.33)
local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0); local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0);
create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 5000.0, alpha); create_2_8_cirrocumulus(blat, blon, alt + alt_offset + 5000.0, alpha);
create_2_8_cirrus(blat, blon, alt + alt_offset + 35000.0, alpha);
} }
else if (rn > 0.0) else if (rn > 0.4)
{ {
# cloud scenario 3: Cirrostratus undulatus over weak cumulus # cloud scenario 3: Cirrostratus undulatus over weak cumulus
@ -204,6 +214,27 @@ else if (rn > 0.0)
create_4_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 32000.0, alpha); create_4_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 32000.0, alpha);
} }
else if (rn > 0.2)
{
# cloud scenario 4: Cirrostratus undulatus streak
strength = rand() * 0.03;
local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0);
create_1_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 32000.0, alpha);
}
else if (rn > 0.0)
{
# cloud scenario 5: Cirrus
create_2_8_cirrus(blat, blon, alt + alt_offset + 35000.0, alpha);
create_1_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 28000.0, alpha);
create_1_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 28000.0, alpha);
}
# store convective altitude and strength # store convective altitude and strength
@ -261,9 +292,14 @@ var strength = 0.0;
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
# rn = 0.1;
if (rn > 0.75) if (rn > 0.8)
{ {
# cloud scenario 1: possible Cirrus over Cumulus # cloud scenario 1: possible Cirrus over Cumulus
strength = 0.2 + rand() * 0.4; strength = 0.2 + rand() * 0.4;
@ -285,7 +321,7 @@ if (rn > 0.75)
} }
} }
else if (rn > 0.5) else if (rn > 0.6)
{ {
# cloud scenario 2: Cirrostratus over weak Cumulus # cloud scenario 2: Cirrostratus over weak Cumulus
@ -295,7 +331,7 @@ else if (rn > 0.5)
create_2_8_cirrostratus(blat, blon, alt+alt_offset+25000.0, alpha); create_2_8_cirrostratus(blat, blon, alt+alt_offset+25000.0, alpha);
} }
else if (rn > 0.25) else if (rn > 0.4)
{ {
# cloud scenario 3: Cirrocumulus sheet over Cumulus # cloud scenario 3: Cirrocumulus sheet over Cumulus
@ -310,7 +346,7 @@ else if (rn > 0.25)
compat_layer.create_cloud(path, blat + get_lat(x,y,phi), blon+get_lon(x,y,phi), alt + alt_offset +24000,alpha); compat_layer.create_cloud(path, blat + get_lat(x,y,phi), blon+get_lon(x,y,phi), alt + alt_offset +24000,alpha);
} }
else if (rn > 0.0) else if (rn > 0.2)
{ {
# cloud scenario 4: Cirrostratus undulatus over weak Cumulus # cloud scenario 4: Cirrostratus undulatus over weak Cumulus
@ -319,6 +355,17 @@ else if (rn > 0.0)
create_4_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 25000.0, alpha); create_4_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 25000.0, alpha);
} }
else if (rn > 0.0)
{
# cloud scenario 5: some scattered Altocumuli over Cumulus
strength = 0.25 + rand() * 0.1;
local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0);
create_1_8_altocumulus_scattered(blat, blon, alt+alt_offset+10000.0, alpha);
create_1_8_cirrostratus_undulatus(blat, blon, alt + alt_offset + 25000.0, alpha);
}
# store convective altitude and strength # store convective altitude and strength
@ -375,6 +422,10 @@ var strength = 0.0;
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
if (rn > 0.875) if (rn > 0.875)
{ {
@ -476,6 +527,7 @@ else if (rn > 0.0)
create_4_8_altocumulus_perlucidus(blat, blon, alt + 10000.0 + alt_offset, alpha); create_4_8_altocumulus_perlucidus(blat, blon, alt + 10000.0 + alt_offset, alpha);
create_2_8_cirrus(blat, blon, alt + 30000.0 + alt_offset, alpha);
} }
@ -507,10 +559,8 @@ var lon = 0.0;
var alpha = getprop(lw~"tmp/tile-orientation-deg"); var alpha = getprop(lw~"tmp/tile-orientation-deg");
var phi = alpha * math.pi/180.0; var phi = alpha * math.pi/180.0;
if (getprop(lw~"tmp/presampling-flag") == 0)
{var alt_offset = getprop(lw~"tmp/tile-alt-offset-ft");} var alt_offset = getprop(lw~"tmp/tile-alt-offset-ft");
else
{var alt_offset = getprop(lw~"tmp/tile-alt-layered-ft");}
# get tile center coordinates # get tile center coordinates
@ -538,76 +588,87 @@ var strength = 0.0;
var rn = rand(); var rn = rand();
if (rn > 0.875) if (rand() < small_scale_persistence)
{ {rn = rnd_store;}
# cloud scenario 1: a low 4/8 stratus patches, thin patches above else
{rnd_store = rn;}
alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; # rn = 0.1;
create_4_8_stratus_patches(blat, blon, alt+alt_offset,alpha);
create_4_8_tstratus_patches(blat, blon, alt+alt_offset+6000,alpha);
}
else if (rn > 0.75)
{
# cloud scenario 2: a low 4/8 undulatus, thin patches above
alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; if (rn > 0.857)
create_4_8_sstratus_undulatus(blat, blon, alt+alt_offset,alpha);
create_2_8_tstratus(blat, blon, alt+alt_offset+7000,alpha);
}
else if (rn > 0.625)
{ {
# cloud scenario 3: low Stratocumulus # cloud scenario 1: low Stratocumulus, thin streaks above
strength = 0.05 + rand() * 0.1;
local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0);
# alt = alt + local_weather.cloud_vertical_size_map["Cumulus"] * 0.5 * m_to_ft;
create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha); create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_2_8_sstratus(blat, blon, alt+alt_offset+6000,alpha);
create_2_8_tstratus(blat, blon, alt+alt_offset+9000,alpha);
}
else if (rn > 0.5)
{
# cloud scenario 4: dense low Stratocumulus
# alt = alt + local_weather.cloud_vertical_size_map["Cumulus"] * 0.5 * m_to_ft; create_4_8_alttstratus_streaks(blat, blon, alt+alt_offset+4000.0,alpha);
create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_2_8_sstratus(blat, blon, alt+alt_offset+8000,alpha);
} }
else if (rn > 375) else if (rn > 0.714)
{ {
# cloud scenario 5: Cirrocumulus over 4/8 Stratus # cloud scenario 2: weak Cumulus, Stratus undulatus above
strength = 0.15 + rand() * 0.15;
local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0);
create_6_8_tstratus_undulatus(blat, blon, alt+alt_offset+4000.0,alpha);
create_2_8_alttstratus(blat, blon, alt+alt_offset+7000.0,alpha);
}
else if (rn > 0.571)
{
# cloud scenario 3: Stratocumulus banks with patches above
create_detailed_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_detailed_small_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_4_8_alttstratus_patches(blat, blon, alt+alt_offset+4000.0,alpha);
}
else if (rn > 0.428)
{
# cloud scenario 4: structured Stratus
alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft;
create_4_8_sstratus_patches(blat, blon, alt+alt_offset,alpha); create_4_8_sstratus_patches(blat, blon, alt+alt_offset,alpha);
create_4_8_cirrocumulus_bank(blat, blon, alt+alt_offset + 12000.0, alpha); create_2_8_alttstratus(blat, blon, alt+alt_offset+7000.0,alpha);
} }
else if (rn > 0.250) else if (rn > 0.285)
{ {
# cloud scenario 6: Cirrostratus over 4/8 Stratus undulatus # cloud scenario 5: Stratus blending with Cumulus with Cirrocumulus above
alt = alt + local_weather.cloud_vertical_size_map["Stratus"] * 0.5 * m_to_ft; strength = 0.1 + rand() * 0.1;
local_weather.create_cumosys(blat,blon, alt + alt_offset, get_n(strength), 20000.0);
create_6_8_stratus_undulatus(blat, blon, alt+alt_offset,alpha); create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha);
create_4_8_cirrostratus_undulatus(blat, blon, alt+alt_offset+24000,alpha); create_4_8_cirrocumulus_undulatus(blat, blon, alt+alt_offset + 12000.0,alpha);
} }
else if (rn > 0.125) else if (rn > 0.142)
{ {
# cloud scenario 7: thin stratus # cloud scenario 6: small Stratocumulus banks
create_4_8_alttstratus_streaks(blat, blon, alt+alt_offset,alpha); create_detailed_small_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_detailed_small_stratocumulus_bank(blat, blon, alt+alt_offset,alpha);
create_2_8_sstratus(blat, blon, alt+alt_offset+6000,alpha); create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha);
create_2_8_cirrostratus(blat, blon, alt+alt_offset + 25000.0,alpha);
} }
else if (rn > 0.0) else
{ {
# cloud scenario 8: thin stratus # cloud scenario 7: blended structured and unstructured Stratiform clouds
create_4_8_alttstratus_patches(blat, blon, alt+alt_offset,alpha); create_4_8_tstratus_patches(blat, blon, alt+alt_offset,alpha);
create_4_8_sstratus_patches(blat, blon, alt+alt_offset,alpha);
create_4_8_cirrostratus_undulatus(blat, blon, alt+alt_offset+25000,alpha); create_2_8_cirrostratus(blat, blon, alt+alt_offset + 25000.0,alpha);
} }
# store convective altitude and strength # store convective altitude and strength
append(weather_dynamics.tile_convective_altitude,alt); append(weather_dynamics.tile_convective_altitude,alt);
@ -666,7 +727,10 @@ var strength = 0.0;
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
if (rn > 0.75) if (rn > 0.75)
{ {
@ -784,18 +848,23 @@ var alt = spread * 1000.0 + local_weather.cloud_vertical_size_map["Nimbus"] * 0.
var strength = 0.0; var strength = 0.0;
create_8_8_nimbus(blat, blon, alt+alt_offset, alpha); create_8_8_nimbus_rain(blat, blon, alt+alt_offset, alpha,0.4 + rand()*0.2);
# and a precipitation layer below, more rain in the center of the tile # and a precipitation layer below, more rain in the center of the tile
local_weather.create_effect_volume(3, blat, blon, 20000.0, 20000.0, alpha, 0.0, alt + alt_offset, 3000.0, 0.3, -1, -1, -1,0 ,0.95); #local_weather.create_effect_volume(3, blat, blon, 20000.0, 20000.0, alpha, 0.0, alt + alt_offset, 3000.0, 0.3, -1, -1, -1,0 ,0.95);
local_weather.create_effect_volume(3, blat , blon, 16000.0, 16000.0, alpha, 0.0, alt + alt_offset - 300.0, 1500.0, 0.5, -1, -1, -1,0 ,0.8); #local_weather.create_effect_volume(3, blat , blon, 16000.0, 16000.0, alpha, 0.0, alt + alt_offset - 300.0, 1500.0, 0.5, -1, -1, -1,0 ,0.8);
# and some broken Stratus cover above # and some broken Stratus cover above
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
if (rn > 0.5){create_4_8_stratus_patches(blat, blon, alt+alt_offset+3000.0, alpha);} if (rn > 0.5){create_4_8_stratus_patches(blat, blon, alt+alt_offset+3000.0, alpha);}
else {create_4_8_stratus(blat, blon, alt+alt_offset+3000.0, alpha);} else {create_4_8_stratus(blat, blon, alt+alt_offset+3000.0, alpha);}
@ -851,6 +920,11 @@ var strength = 0.0;
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
#rn = 0.1; #rn = 0.1;
if (rn > 0.5) if (rn > 0.5)
@ -935,6 +1009,10 @@ var strength = 0.0;
var rn = rand(); var rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
if (rn > 0.8) if (rn > 0.8)
{ {
@ -1054,6 +1132,7 @@ var t_factor = 0.5 * (1.0-math.cos((t * sec_to_rad)-0.9));
var rn = rand(); var rn = rand();
if (rn > (t_factor * t_factor * t_factor * t_factor)) # call a normal convective cloud system if (rn > (t_factor * t_factor * t_factor * t_factor)) # call a normal convective cloud system
{ {
strength = 1.0 + rand() * 0.2; strength = 1.0 + rand() * 0.2;
@ -1067,6 +1146,11 @@ else
rn = rand(); rn = rand();
if (rand() < small_scale_persistence)
{rn = rnd_store;}
else
{rnd_store = rn;}
if (rn > 0.2) if (rn > 0.2)
{ {
# cloud scenario 1: 1-2 medium sized storms # cloud scenario 1: 1-2 medium sized storms
@ -2142,10 +2226,10 @@ var set_METAR_weather_station = func {
var gust_angvar = 0.5 * weather_tile_management.relangle(wind_range_from, wind_range_to); var gust_angvar = 0.5 * weather_tile_management.relangle(wind_range_from, wind_range_to);
if (gust_strength > 0.0) if ((gust_strength > 0.0) or (gust_angvar > 0.0))
{ {
var gust_relative_strength = (gust_strength - windspeed)/windspeed; var gust_relative_strength = (gust_strength - windspeed)/windspeed;
setprop(lw~"tmp/gust-frequency-hz", 1.0); setprop(lw~"tmp/gust-frequency-hz", 0.2 + rand()*0.8);
} }
else else
{ {
@ -2436,12 +2520,16 @@ var create_4_8_tstratus_patches = func (lat, lon, alt, alpha) {
var phi = alpha * math.pi/180.0; var phi = alpha * math.pi/180.0;
for (var i=0; i<16; i=i+1) for (var i=0; i<22; i=i+1)
{ {
var x = 2.0 * (rand()-0.5) * 18000; var x = 2.0 * (rand()-0.5) * 18000;
var y = 2.0 * (rand()-0.5) * 18000; var y = 2.0 * (rand()-0.5) * 18000;
var beta = (rand() -0.5) * 180.0; var beta = (rand() -0.5) * 180.0;
local_weather.create_streak("Stratus (thin)",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,300.0,4,950.0,0.2,500.0,6,950.0,0.2,500.0,alpha+beta,1.0);
var m = int(3 + rand() * 3);
var n = int(3 + rand() * 5);
local_weather.create_streak("Stratus (thin)",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,300.0,m,1000.0,0.2,500.0,n,1000.0,0.2,500.0,alpha+beta,1.0);
} }
@ -2452,12 +2540,14 @@ var create_4_8_sstratus_patches = func (lat, lon, alt, alpha) {
var phi = alpha * math.pi/180.0; var phi = alpha * math.pi/180.0;
for (var i=0; i<16; i=i+1) for (var i=0; i<22; i=i+1)
{ {
var x = 2.0 * (rand()-0.5) * 18000; var x = 2.0 * (rand()-0.5) * 18000;
var y = 2.0 * (rand()-0.5) * 18000; var y = 2.0 * (rand()-0.5) * 18000;
var beta = (rand() -0.5) * 180.0; var beta = (rand() -0.5) * 180.0;
local_weather.create_streak("Stratus (structured)",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,300.0,4,950.0,0.2,500.0,6,950.0,0.2,500.0,alpha+beta,1.0); var m = int(3 + rand() * 5);
var n = int(3 + rand() * 5);
local_weather.create_streak("Stratus (structured)",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,300.0,m,1000.0,0.2,500.0,n,1000.0,0.2,500.0,alpha+beta,1.0);
} }
@ -2726,6 +2816,17 @@ for (var i=0; i<25; i=i+1)
} }
var create_2_8_cirrus = func (lat, lon, alt, alpha) {
var phi = alpha * math.pi/180.0;
var x = 2.0 * (rand()-0.5) * 3000;
var y = 2.0 * (rand()-0.5) * 3000;
local_weather.create_streak("Cirrus",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,1500.0,3,12000.0,0.0, 4000.0, 3,12000.0,0.0,4000.0,alpha,1.0);
}
var create_2_8_alttstratus = func (lat, lon, alt, alpha) { var create_2_8_alttstratus = func (lat, lon, alt, alpha) {
@ -2757,6 +2858,25 @@ for (var i=0; i<2; i=i+1)
} }
var create_1_8_altocumulus_scattered = func (lat, lon, alt, alpha) {
var phi = alpha * math.pi/180.0;
local_weather.create_streak("Altocumulus",lat, lon, alt,1500.0,15,0.0,0.2,19000.0,15,0.0,0.2,19000.0,alpha ,0.0);
for (var i=0; i<6; i=i+1)
{
var x = 2.0 * (rand()-0.5) * 14000;
var y = 2.0 * (rand()-0.5) * 14000;
var tri = 1.0 + rand();
local_weather.create_streak("Altocumulus",lat+get_lat(x,y,phi), lon+get_lon(x,y,phi), alt,1500.0,10,750.0,0.1,800.0,4,550.0,0.1,500.0,alpha ,tri);
}
}
var create_1_8_cirrocumulus = func (lat, lon, alt, alpha) { var create_1_8_cirrocumulus = func (lat, lon, alt, alpha) {
var phi = alpha * math.pi/180.0; var phi = alpha * math.pi/180.0;
@ -2777,6 +2897,12 @@ for (var i = 0; i < 2; i = i + 1)
} }
var create_1_8_cirrostratus_undulatus = func (lat, lon, alt, alpha) {
local_weather.create_undulatus("Cirrostratus",lat, lon, alt,300.0,1,8000.0,0.0,400.0,40,1000.0,0.1,100.0, 1500.0, alpha,1.0);
}
var create_1_8_contrails = func (lat, lon, alt, alpha) { var create_1_8_contrails = func (lat, lon, alt, alpha) {
@ -2854,16 +2980,44 @@ var y = 2.0 * (rand()-0.5) * 6000;
var tri = 1.5 + 1.5*rand(); var tri = 1.5 + 1.5*rand();
var beta = (rand() -0.5) * 60.0; var beta = (rand() -0.5) * 60.0;
var m = int(7 + rand() * 7);
var n = int(9 + rand() * 7);
var alt_offset = 0.5 * local_weather.cloud_vertical_size_map["Cumulus"] * ft_to_m; var alt_offset = 0.5 * local_weather.cloud_vertical_size_map["Cumulus"] * ft_to_m;
local_weather.create_streak("Stratocumulus",lat+get_lat(x,y+7500,phi), lon+get_lon(x,y+7500,phi), alt + alt_offset,500.0,12,1000.0,0.1,400.0,15,1000.0,0.1,400.0,alpha+90.0+beta,tri); local_weather.create_streak("Stratocumulus",lat+get_lat(x,y+7500,phi), lon+get_lon(x,y+7500,phi), alt + alt_offset,500.0,m,1100.0,0.1,400.0,n,1100.0,0.1,400.0,alpha+90.0+beta,tri);
local_weather.create_streak("Stratocumulus",lat+get_lat(x,y-7500,phi), lon+get_lon(x,y-7500,phi), alt + alt_offset,500.0,12,1000.0,0.1,400.0,15,1000.0,0.1,400.0,alpha+270.0+beta,tri); local_weather.create_streak("Stratocumulus",lat+get_lat(x,y-7500,phi), lon+get_lon(x,y-7500,phi), alt + alt_offset,500.0,m,1100.0,0.1,400.0,n,1100.0,0.1,400.0,alpha+270.0+beta,tri);
local_weather.create_streak("Stratocumulus bottom",lat+get_lat(x,y+5250,phi), lon+get_lon(x,y+5250,phi), alt,0.0,10,700.0,0.2,400.0,15,700.0,0.0,400.0,alpha+90.0+beta,tri); local_weather.create_streak("Stratocumulus bottom",lat+get_lat(x,y+5250,phi), lon+get_lon(x,y+5250,phi), alt,0.0,m+1,700.0,0.2,400.0,n+1,700.0,0.0,400.0,alpha+90.0+beta,tri);
local_weather.create_streak("Stratocumulus bottom",lat+get_lat(x,y-5250,phi), lon+get_lon(x,y-5250,phi), alt,0.0,10,700.0,0.2,400.0,15,700.0,0.0,400.0,alpha+270.0+beta,tri); local_weather.create_streak("Stratocumulus bottom",lat+get_lat(x,y-5250,phi), lon+get_lon(x,y-5250,phi), alt,0.0,m+1,700.0,0.2,400.0,n+1,700.0,0.0,400.0,alpha+270.0+beta,tri);
}
var create_detailed_small_stratocumulus_bank = func (lat, lon, alt, alpha) {
var phi = alpha * math.pi/180.0;
var x = 2.0 * (rand()-0.5) * 12000;
var y = 2.0 * (rand()-0.5) * 12000;
var tri = 1.5 + 1.5*rand();
var beta = (rand() -0.5) * 60.0;
var m = int(5 + rand() * 5);
var n = int(6 + rand() * 5);
var alt_offset = 0.5 * local_weather.cloud_vertical_size_map["Cumulus"] * ft_to_m;
local_weather.create_streak("Stratocumulus",lat+get_lat(x,y+7500,phi), lon+get_lon(x,y+7500,phi), alt + alt_offset,500.0,m,1100.0,0.12,400.0,n,1100.0,0.12,400.0,alpha+90.0+beta,tri);
local_weather.create_streak("Stratocumulus",lat+get_lat(x,y-7500,phi), lon+get_lon(x,y-7500,phi), alt + alt_offset,500.0,m,1100.0,0.12,400.0,n,1100.0,0.12,400.0,alpha+270.0+beta,tri);
local_weather.create_streak("Stratocumulus bottom",lat+get_lat(x,y+7050,phi), lon+get_lon(x,y+7050,phi), alt,0.0,m,700.0,0.2,400.0,n,700.0,0.0,400.0,alpha+90.0+beta,tri);
local_weather.create_streak("Stratocumulus bottom",lat+get_lat(x,y-7050,phi), lon+get_lon(x,y-7050,phi), alt,0.0,m,700.0,0.2,400.0,n,700.0,0.0,400.0,alpha+270.0+beta,tri);
} }
@ -3012,6 +3166,9 @@ var lon_to_m = 0.0; # needs to be calculated dynamically
var m_to_lon = 0.0; # we do this on startup var m_to_lon = 0.0; # we do this on startup
var lw = "/local-weather/"; var lw = "/local-weather/";
var small_scale_persistence = getprop(lw~"config/small-scale-persistence");
var rnd_store = 0.0;
var elat = []; var elat = [];
var elon = []; var elon = [];
var erad = []; var erad = [];

View file

@ -10,6 +10,8 @@
<modal>false</modal> <modal>false</modal>
<text> <text>
<x>10</x> <x>10</x>
<y>570</y> <y>570</y>

View file

@ -2,7 +2,7 @@
<PropertyList> <PropertyList>
<!-- Weather tiles --> <!-- Weather config -->
<name>local_weather_config</name> <name>local_weather_config</name>
<width>400</width> <width>400</width>
@ -18,19 +18,19 @@
<text> <text>
<x>60</x> <x>60</x>
<y>340</y> <y>345</y>
<label>loading distance</label> <label>loading distance</label>
</text> </text>
<text> <text>
<x>10</x> <x>10</x>
<y>320</y> <y>325</y>
<label>25 km</label> <label>25 km</label>
</text> </text>
<slider> <slider>
<x>60</x> <x>60</x>
<y>320</y> <y>325</y>
<width>100</width> <width>100</width>
<height>20</height> <height>20</height>
<min>29000.0</min> <min>29000.0</min>
@ -43,14 +43,14 @@
<text> <text>
<x>170</x> <x>170</x>
<y>320</y> <y>325</y>
<label>55 km</label> <label>55 km</label>
</text> </text>
<checkbox> <checkbox>
<x>250</x> <x>250</x>
<y>350</y> <y>355</y>
<width>15</width> <width>15</width>
<height>15</height> <height>15</height>
<label>asymmetric range</label> <label>asymmetric range</label>
@ -62,13 +62,13 @@
<text> <text>
<x>220</x> <x>220</x>
<y>320</y> <y>325</y>
<label>0.5</label> <label>0.5</label>
</text> </text>
<slider> <slider>
<x>250</x> <x>250</x>
<y>320</y> <y>325</y>
<width>100</width> <width>100</width>
<height>20</height> <height>20</height>
<min>0.5</min> <min>0.5</min>
@ -81,32 +81,32 @@
<text> <text>
<x>360</x> <x>360</x>
<y>320</y> <y>325</y>
<label>1.0</label> <label>1.0</label>
</text> </text>
<text> <text>
<x>5</x> <x>5</x>
<y>280</y> <y>285</y>
<label>Cloud buffering settings</label> <label>Cloud buffering settings</label>
</text> </text>
<text> <text>
<x>60</x> <x>60</x>
<y>260</y> <y>265</y>
<label>visible range</label> <label>visible range</label>
</text> </text>
<text> <text>
<x>10</x> <x>10</x>
<y>240</y> <y>245</y>
<label>15 km</label> <label>15 km</label>
</text> </text>
<slider> <slider>
<x>60</x> <x>60</x>
<y>240</y> <y>245</y>
<width>100</width> <width>100</width>
<height>20</height> <height>20</height>
<min>15000.0</min> <min>15000.0</min>
@ -119,14 +119,14 @@
<text> <text>
<x>170</x> <x>170</x>
<y>240</y> <y>245</y>
<label>45 km</label> <label>45 km</label>
</text> </text>
<checkbox> <checkbox>
<x>250</x> <x>250</x>
<y>270</y> <y>275</y>
<width>15</width> <width>15</width>
<height>15</height> <height>15</height>
<label>asymmetric buffering</label> <label>asymmetric buffering</label>
@ -138,13 +138,13 @@
<text> <text>
<x>220</x> <x>220</x>
<y>240</y> <y>245</y>
<label>0.2</label> <label>0.2</label>
</text> </text>
<slider> <slider>
<x>250</x> <x>250</x>
<y>240</y> <y>245</y>
<width>100</width> <width>100</width>
<height>20</height> <height>20</height>
<min>0.2</min> <min>0.2</min>
@ -157,26 +157,26 @@
<text> <text>
<x>360</x> <x>360</x>
<y>240</y> <y>245</y>
<label>1.0</label> <label>1.0</label>
</text> </text>
<text> <text>
<x>170</x> <x>170</x>
<y>210</y> <y>215</y>
<label>angle:</label> <label>angle:</label>
</text> </text>
<text> <text>
<x>220</x> <x>220</x>
<y>210</y> <y>215</y>
<label>0.0</label> <label>0.0</label>
</text> </text>
<slider> <slider>
<x>250</x> <x>250</x>
<y>210</y> <y>215</y>
<width>100</width> <width>100</width>
<height>20</height> <height>20</height>
<min>0.0</min> <min>0.0</min>
@ -189,35 +189,71 @@
<text> <text>
<x>360</x> <x>360</x>
<y>210</y> <y>215</y>
<label>180</label> <label>180</label>
</text> </text>
<checkbox>
<x>30</x>
<y>185</y>
<width>15</width>
<height>15</height>
<label>tie range to framerate</label>
<property>/local-weather/config/fps-control-flag</property>
<binding>
<command>dialog-apply</command>
</binding>
</checkbox>
<text>
<x>200</x>
<y>180</y>
<label>10 fps</label>
</text>
<slider>
<x>250</x>
<y>180</y>
<width>100</width>
<height>20</height>
<min>10.0</min>
<max>40.0</max>
<property>/local-weather/config/target-framerate</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>355</x>
<y>180</y>
<label>40 fps</label>
</text>
<text> <text>
<x>5</x> <x>5</x>
<y>160</y> <y>150</y>
<label>Weather dynamics settings</label> <label>Weather dynamics settings</label>
</text> </text>
<text> <text>
<x>60</x> <x>55</x>
<y>140</y> <y>130</y>
<label>max. clouds in loop</label> <label>max. clouds in loop</label>
</text> </text>
<text> <text>
<x>10</x> <x>10</x>
<y>120</y> <y>110</y>
<label>100</label> <label>100</label>
</text> </text>
<slider> <slider>
<x>60</x> <x>60</x>
<y>120</y> <y>110</y>
<width>100</width> <width>100</width>
<height>20</height> <height>20</height>
<min>100</min> <min>100</min>
@ -230,12 +266,80 @@
<text> <text>
<x>170</x> <x>170</x>
<y>120</y> <y>110</y>
<label>400</label> <label>400</label>
</text> </text>
<text>
<x>5</x>
<y>80</y>
<label>Weather pattern scales</label>
</text>
<text>
<x>15</x>
<y>45</y>
<label>small</label>
</text>
<text>
<x>78</x>
<y>60</y>
<label>airmass</label>
</text>
<slider>
<x>60</x>
<y>45</y>
<width>100</width>
<height>20</height>
<min>0.5</min>
<max>2.0</max>
<property>/local-weather/config/large-scale-persistence</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>165</x>
<y>45</y>
<label>large</label>
</text>
<text>
<x>205</x>
<y>45</y>
<label>small</label>
</text>
<text>
<x>257</x>
<y>60</y>
<label>cloud patterns</label>
</text>
<slider>
<x>250</x>
<y>45</y>
<width>100</width>
<height>20</height>
<min>0.0</min>
<max>1.0</max>
<property>/local-weather/config/small-scale-persistence</property>
<binding>
<command>dialog-apply</command>
</binding>
</slider>
<text>
<x>355</x>
<y>45</y>
<label>large</label>
</text>
<group> <group>
<x>10</x> <x>10</x>

View file

@ -35,10 +35,18 @@
<value>Coldfront</value> <value>Coldfront</value>
<value>Warmfront</value> <value>Warmfront</value>
<value>Tropical</value> <value>Tropical</value>
<!--<value>Test tile</value>--> <value>Test tile</value>
<binding> <binding>
<command>dialog-apply</command> <command>dialog-apply</command>
</binding> </binding>
<!--<enable>
<not>
<equals>
<property>/local-weather/tmp/tile-management</property>
<value type="string">METAR</value>
</equals>
</not>
</enable>-->
</combo> </combo>
<text> <text>
@ -100,7 +108,7 @@
<width>50</width> <width>50</width>
<height>20</height> <height>20</height>
<min>0.0</min> <min>0.0</min>
<max>1.0</max> <max>2.0</max>
<property>/local-weather/tmp/gust-frequency-hz</property> <property>/local-weather/tmp/gust-frequency-hz</property>
<binding> <binding>
<command>dialog-apply</command> <command>dialog-apply</command>
@ -205,7 +213,7 @@
<width>15</width> <width>15</width>
<height>15</height> <height>15</height>
<label>terrain presampling</label> <label>terrain presampling</label>
<property>/local-weather/tmp/presampling-flag</property> <property>/local-weather/config/presampling-flag</property>
<binding> <binding>
<command>dialog-apply</command> <command>dialog-apply</command>
</binding> </binding>
@ -330,7 +338,7 @@
<y>0</y> <y>0</y>
<legend>Clear / End</legend> <legend>Clear / End</legend>
<!--<default>true</default>--> <!--<default>true</default>-->
<equal>true</equal> <!--<equal>true</equal>-->
<binding> <binding>
<command>nasal</command> <command>nasal</command>
<script>local_weather.clear_all()</script> <script>local_weather.clear_all()</script>
@ -341,7 +349,7 @@
<x>135</x> <x>135</x>
<y>0</y> <y>0</y>
<legend>Close</legend> <legend>Close</legend>
<equal>true</equal> <!--<equal>true</equal>-->
<key>Esc</key> <key>Esc</key>
<binding> <binding>
<command>dialog-close</command> <command>dialog-close</command>
@ -352,7 +360,7 @@
<x>200</x> <x>200</x>
<y>0</y> <y>0</y>
<legend>Show winds</legend> <legend>Show winds</legend>
<equal>true</equal> <!--<equal>true</equal>-->
<binding> <binding>
<command>dialog-show</command> <command>dialog-show</command>
<dialog-name>local_weather_winds</dialog-name> <dialog-name>local_weather_winds</dialog-name>

View file

@ -10,6 +10,8 @@ Started September 2000 by David Megginson, david@megginson.com
<PropertyList> <PropertyList>
<local-weather include="Environment/local-weather-defaults.xml"/>
<!-- General simulation preferences --> <!-- General simulation preferences -->
<sim> <sim>
<!-- show-aircraft option: show ALL aircraft regardless by default --> <!-- show-aircraft option: show ALL aircraft regardless by default -->