XPLMSetWeatherAtAirport

XPLM_API void       XPLMSetWeatherAtAirport(
                         const char *         airport_id,
                         XPLMWeatherInfo_t *  in_info);

Set the current weather conditions at a given airport. Unlike XPLMSetWeatherAtLocation, this call will replace any existing weather records for that airport from other sources (i.e. downloaded METARs) instead of being used as just another weather sample.

Some notes on individual fields: - pressure_alt should be QNH as reported by a station at the specified airport, or 0 if you are passing sealevel pressure in ‘pressure_sl’ instead. - pressure_sl is ignored if pressure_alt is given. - wind_dir_alt, wind_spd_alt, turbulence_alt, wave_speed, wave_length are derived from other data and are UNUSED when setting weather. - Temperatures can be given either as a single temperature at the ground altitude (temperature_alt) OR, if the struct is V2 or higher, as an array of temperatures aloft (temp_layers). If you pass a value for temperature_alt higher than -273.15 (absolute zero), that will be used with the altitude value to calculate an offset from ISA temperature at all altitudes. Any layer in temp_layers for which you set the temperature higher than -273.15 (absolute zero) will use that temperature and all others will use the existing value for the location, or the calculated values from temperature_alt if you also passed that. It is advised to use a lower value than exactly -273.15 to avoid floating-point precision errors. These calculated temperatures during a read are also affected by the troposphere altitude and temperature, and the vertical radius of effect. Do not expect to get the exact values you set. - The same rules apply to dewpoint temperatures; either a single value at ground level in ‘dewpoint_alt’, or per-layer values in ‘dewp_layers’. - The troposphere altitude and temperature will be derived from existing data if you pass 0 or lower for troposphere_alt. Both altitude and temperature may be clamped to internally-defined ranges. - When setting both temperature and dewpoint from a single value (temperature_alt/dewpoint_alt), the rest of the atmosphere will be graded to fit between the given values and the troposphere.

This call is not intended to be used per-frame. It should be called only during the pre-flight loop callback.