Board index FlightGear Development Tutorials and missions

Weather support (previously via PM)

Interactive in-sim tutorials and missions

Weather support (previously via PM)

Postby Hooray » Fri Apr 25, 2014 8:25 am

@Thorsten: currently, simply using the METAR string seems to be the most straightforward option to save/load a weather scenario, any better ideas for the AW side of things ?

And the other issue is, currently the focus is obviously helicopters because that's where the manpower is, but LOWI is kinda well-developed and it should be straightforward to come up with a simple single-engine CAT3 approach for the Seneca- what about turbulence there, is there any reliable way to ensure that we'll see lots of turbulence, or even Foehn winds ?

How difficult would it be for an external system to talk to AW to get some reproducible weather scenario (even if that involves loading stuff from an XML file, or calling a few APIs) ?

Thorsten wrote:You'd have the best control over weather just defining your own specific tile (see the various tiles in weather_tiles.nas - a minimal structure might be

Code: Select all
####################################
# my own tile
####################################

var set_my_own_tile = func {

setprop(lw~"tiles/code","myown");

tile_start();

var x = 0.0;
var y = 0.0;
var lat = 0.0;
var lon = 0.0;

var alpha = getprop(lw~"tmp/tile-orientation-deg");
var phi = alpha * math.pi/180.0;
var alt_offset = getprop(lw~"tmp/tile-alt-offset-ft");

# get tile center coordinates

var blat = getprop(lw~"tiles/tmp/latitude-deg");
var blon = getprop(lw~"tiles/tmp/longitude-deg");
calc_geo(blat);

# first weather info for tile center (lat, lon, visibility, temperature, dew point, pressure)

local_weather.set_weather_station(blat, blon, alt_offset, 45000.0, 14.0, 12.0, 29.78);

var alt_offset = getprop(lw~"tmp/tile-alt-offset-ft");

# draw some clouds

create_2_8_altocumulus_streaks(blat, blon, 12000+alt_offset, alpha) ;
create_6_8_stratus(blat, blon, 3000+alt_offset, alpha) ;

# set visibility and light attenuation as a function of altitude

local_weather.set_atmosphere_ipoint(blat, blon, 45000.0, 3000.0, 45000.0, 0.0, 15000.0, 17000.0, 0.8, 12000.0, 17000.0);

append(weather_dynamics.tile_convective_altitude,3000.0);
append(weather_dynamics.tile_convective_strength,0.0);

tile_finished();

}


which controls all clouds/visibility. Turbulence can be coded into that as an effect volume spanning the whole tile (as e.g. for the coldfront). Wind is read from the menu, so the properties need to be set accordingly.

METAR strings give you a lower level of control (you can't control the precise clouds being drawn and the vertical structure of the atmosphere that way).

How difficult would it be for an external system to talk to AW to get some reproducible weather scenario (even if that involves loading stuff from an XML file, or calling a few APIs) ?


Well, the way AW is made, it knows lots of stuff internally about the atmosphere which you usually don't have available. It has interfaces to connect to sources of real online weather info (like METAR or aloft winds which we currently don't fetch online), but it doesn't have a general interface getting all internal parameters from xml (and I think it'd be easier to just write a tile definition in Nasal if you want to set all internals than to come up with a parser). But in principle one could generalize the METAR tile definition if we can agree what set of properties are available.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Return to Tutorials and missions

Who is online

Users browsing this forum: No registered users and 1 guest