Debian Codegraph @

Environment/metarinterpolator.xml

raw symbols SCIP
1 <?xml version="1.0" ?>
2 <!--
3 This file is part of FlightGear, the free flight simulator
4 http://www.flightgear.org/
5
6 Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17 -->
18 <!--
19 Interpolate the METAR weather values over time and write
20 the environment values in /environment/config/*
21 All filters are enabled if /environment/metar/valid=true
22 -->
23 <PropertyList>
24 <filter>
25 <!--
26 transfer the METAR QNH to the interpolation controller
27 limit the rate of change to approx 0.01hpa/sec
28 -->
29 <name>MetarController:pressure-sea-level-inhg</name>
30 <type>noise-spike</type>
31 <max-rate-of-change>0.006</max-rate-of-change>
32 <enable>
33 <condition>
34 <property>/environment/metar/valid</property>
35 <property>/environment/params/metar-updates-environment</property>
36 </condition>
37 </enable>
38 <input>/environment/metar/pressure-sea-level-inhg</input>
39 <output>/environment/config/boundary/entry/pressure-sea-level-inhg</output>
40 <output>/environment/config/aloft/entry/pressure-sea-level-inhg</output>
41 </filter>
42
43 <filter>
44 <!--
45 transfer the sea-level temperature to each layer of
46 interpolation controller. We have no idea here about
47 the temperature gradient, so just assume ISA.
48 -->
49 <name>MetarController:temperature-sea-level-degc</name>
50 <type>noise-spike</type>
51 <max-rate-of-change>0.01667</max-rate-of-change>
52 <enable>
53 <condition>
54 <property>/environment/metar/valid</property>
55 <property>/environment/params/metar-updates-environment</property>
56 </condition>
57 </enable>
58 <input>/environment/metar/temperature-sea-level-degc</input>
59 <output>/environment/config/boundary/entry[0]/temperature-sea-level-degc</output>
60 <output>/environment/config/boundary/entry[1]/temperature-sea-level-degc</output>
61 <output>/environment/config/aloft/entry[0]/temperature-sea-level-degc</output>
62 <output>/environment/config/aloft/entry[1]/temperature-sea-level-degc</output>
63 <output>/environment/config/aloft/entry[2]/temperature-sea-level-degc</output>
64 <output>/environment/config/aloft/entry[3]/temperature-sea-level-degc</output>
65 <output>/environment/config/aloft/entry[4]/temperature-sea-level-degc</output>
66 </filter>
67
68 <filter>
69 <!--
70 transfer the sea-level dewpoint to each layer of
71 interpolation controller. This is most certainly
72 wrong in most cases.
73 -->
74 <name>MetarController:dewpoint-sea-level-degc</name>
75 <type>noise-spike</type>
76 <max-rate-of-change>0.01667</max-rate-of-change>
77 <enable>
78 <condition>
79 <property>/environment/metar/valid</property>
80 <property>/environment/params/metar-updates-environment</property>
81 </condition>
82 </enable>
83 <input>/environment/metar/dewpoint-sea-level-degc</input>
84 <output>/environment/config/boundary/entry[0]/dewpoint-sea-level-degc</output>
85 <output>/environment/config/boundary/entry[1]/dewpoint-sea-level-degc</output>
86 <output>/environment/config/aloft/entry[0]/dewpoint-sea-level-degc</output>
87 <output>/environment/config/aloft/entry[1]/dewpoint-sea-level-degc</output>
88 <output>/environment/config/aloft/entry[2]/dewpoint-sea-level-degc</output>
89 <output>/environment/config/aloft/entry[3]/dewpoint-sea-level-degc</output>
90 <output>/environment/config/aloft/entry[4]/dewpoint-sea-level-degc</output>
91 </filter>
92
93 <filter>
94 <!--
95 transfer the visibility to each layer of
96 interpolation controller. We are not very creative here and
97 use the same visibility for all layers but top four which
98 are left untouched.
99 -->
100 <name>MetarController:visibility-m</name>
101 <type>exponential</type>
102 <filter-time>5</filter-time>
103 <enable>
104 <condition>
105 <property>/environment/metar/valid</property>
106 <property>/environment/params/metar-updates-environment</property>
107 </condition>
108 </enable>
109 <input>/environment/metar/min-visibility-m</input>
110 <output>/environment/config/boundary/entry[0]/visibility-m</output>
111 <output>/environment/config/boundary/entry[1]/visibility-m</output>
112 <output>/environment/config/aloft/entry[0]/visibility-m</output>
113 </filter>
114
115 <filter>
116 <!--
117 transfer the rain intensity to the target environment
118 -->
119 <name>MetarController:rain-norm</name>
120 <type>noise-spike</type>
121 <max-rate-of-change>1.0</max-rate-of-change>
122 <enable>
123 <condition>
124 <property>/environment/metar/valid</property>
125 <property>/environment/params/metar-updates-environment</property>
126 </condition>
127 </enable>
128 <input>/environment/metar/rain-norm</input>
129 <output>/environment/rain-norm</output>
130 </filter>
131
132 <filter>
133 <!--
134 transfer the snow intensity to the target environment
135 -->
136 <name>MetarController:snow-norm</name>
137 <type>noise-spike</type>
138 <max-rate-of-change>1.0</max-rate-of-change>
139 <enable>
140 <condition>
141 <property>/environment/metar/valid</property>
142 <property>/environment/params/metar-updates-environment</property>
143 </condition>
144 </enable>
145 <input>/environment/metar/snow-norm</input>
146 <output>/environment/snow-norm</output>
147 </filter>
148
149 <!-- interpolate the wind vector's components -->
150 <filter>
151 <name>MetarController:wind-from-north-fps</name>
152 <type>noise-spike</type>
153 <max-rate-of-change>1.0</max-rate-of-change>
154 <enable>
155 <condition>
156 <property>/environment/metar/valid</property>
157 <property>/environment/params/metar-updates-environment</property>
158 </condition>
159 </enable>
160 <input>/environment/metar/base-wind-from-north-fps</input>
161 <output>/environment/config/boundary/entry[0]/wind-from-north-fps</output>
162 </filter>
163
164 <filter>
165 <name>MetarController:wind-from-east-fps</name>
166 <type>noise-spike</type>
167 <max-rate-of-change>1.0</max-rate-of-change>
168 <enable>
169 <condition>
170 <property>/environment/metar/valid</property>
171 <property>/environment/params/metar-updates-environment</property>
172 </condition>
173 </enable>
174 <input>/environment/metar/base-wind-from-east-fps</input>
175 <output>/environment/config/boundary/entry[0]/wind-from-east-fps</output>
176 </filter>
177
178 <!-- Adjust the wind-vector for the layers -->
179 <!-- TODO: handle variable winds -->
180 <filter include="layer-heading-offset.xml"/>
181 <filter include="layer-heading-offset.xml">
182 <name>MetarController:layer:wind-from-heading-deg_0</name>
183 <enable>
184 <condition>
185 <property>/environment/metar/valid</property>
186 <property>/environment/params/metar-updates-environment</property>
187 <property>/environment/params/metar-updates-winds-aloft</property>
188 </condition>
189 </enable>
190 <input>
191 <offset>/environment/config/aloft/entry[0]/wind-heading-change-deg</offset>
192 </input>
193 <output>/environment/config/aloft/entry[0]/wind-from-heading-deg</output>
194 </filter>
195 <filter include="layer-heading-offset.xml">
196 <name>MetarController:layer:wind-from-heading-deg_1</name>
197 <enable>
198 <condition>
199 <property>/environment/metar/valid</property>
200 <property>/environment/params/metar-updates-environment</property>
201 <property>/environment/params/metar-updates-winds-aloft</property>
202 </condition>
203 </enable>
204 <input>
205 <offset>/environment/config/aloft/entry[1]/wind-heading-change-deg</offset>
206 </input>
207 <output>/environment/config/aloft/entry[1]/wind-from-heading-deg</output>
208 </filter>
209 <filter include="layer-heading-offset.xml">
210 <name>MetarController:layer:wind-from-heading-deg_2</name>
211 <enable>
212 <condition>
213 <property>/environment/metar/valid</property>
214 <property>/environment/params/metar-updates-environment</property>
215 <property>/environment/params/metar-updates-winds-aloft</property>
216 </condition>
217 </enable>
218 <input>
219 <offset>/environment/config/aloft/entry[2]/wind-heading-change-deg</offset>
220 </input>
221 <output>/environment/config/aloft/entry[2]/wind-from-heading-deg</output>
222 </filter>
223 <filter include="layer-heading-offset.xml">
224 <name>MetarController:layer:wind-from-heading-deg_3</name>
225 <enable>
226 <condition>
227 <property>/environment/metar/valid</property>
228 <property>/environment/params/metar-updates-environment</property>
229 <property>/environment/params/metar-updates-winds-aloft</property>
230 </condition>
231 </enable>
232 <input>
233 <offset>/environment/config/aloft/entry[3]/wind-heading-change-deg</offset>
234 </input>
235 <output>/environment/config/aloft/entry[3]/wind-from-heading-deg</output>
236 </filter>
237 <filter include="layer-heading-offset.xml">
238 <name>MetarController:layer:wind-from-heading-deg_4</name>
239 <enable>
240 <condition>
241 <property>/environment/metar/valid</property>
242 <property>/environment/params/metar-updates-environment</property>
243 <property>/environment/params/metar-updates-winds-aloft</property>
244 </condition>
245 </enable>
246 <input>
247 <offset>/environment/config/aloft/entry[4]/wind-heading-change-deg</offset>
248 </input>
249 <output>/environment/config/aloft/entry[4]/wind-from-heading-deg</output>
250 </filter>
251
252 <filter include="layer-speed-change.xml"/>
253 <filter include="layer-speed-change.xml">
254 <name>MetarController:layer:wind-speed-kt_0</name>
255 <enable>
256 <condition>
257 <property>/environment/metar/valid</property>
258 <property>/environment/params/metar-updates-environment</property>
259 <property>/environment/params/metar-updates-winds-aloft</property>
260 </condition>
261 </enable>
262 <input>
263 <offset>/environment/config/aloft/entry[0]/wind-speed-change-rel</offset>
264 </input>
265 <output>/environment/config/aloft/entry[0]/wind-speed-kt</output>
266 </filter>
267 <filter include="layer-speed-change.xml">
268 <name>MetarController:layer:wind-speed-kt_1</name>
269 <enable>
270 <condition>
271 <property>/environment/metar/valid</property>
272 <property>/environment/params/metar-updates-environment</property>
273 <property>/environment/params/metar-updates-winds-aloft</property>
274 </condition>
275 </enable>
276 <input>
277 <offset>/environment/config/aloft/entry[1]/wind-speed-change-rel</offset>
278 </input>
279 <output>/environment/config/aloft/entry[1]/wind-speed-kt</output>
280 </filter>
281 <filter include="layer-speed-change.xml">
282 <name>MetarController:layer:wind-speed-kt_2</name>
283 <enable>
284 <condition>
285 <property>/environment/metar/valid</property>
286 <property>/environment/params/metar-updates-environment</property>
287 <property>/environment/params/metar-updates-winds-aloft</property>
288 </condition>
289 </enable>
290 <input>
291 <offset>/environment/config/aloft/entry[2]/wind-speed-change-rel</offset>
292 </input>
293 <output>/environment/config/aloft/entry[2]/wind-speed-kt</output>
294 </filter>
295 <filter include="layer-speed-change.xml">
296 <name>MetarController:layer:wind-speed-kt_3</name>
297 <enable>
298 <condition>
299 <property>/environment/metar/valid</property>
300 <property>/environment/params/metar-updates-environment</property>
301 <property>/environment/params/metar-updates-winds-aloft</property>
302 </condition>
303 </enable>
304 <input>
305 <offset>/environment/config/aloft/entry[3]/wind-speed-change-rel</offset>
306 </input>
307 <output>/environment/config/aloft/entry[3]/wind-speed-kt</output>
308 </filter>
309 <filter include="layer-speed-change.xml">
310 <name>MetarController:layer:wind-speed-kt_4</name>
311 <enable>
312 <condition>
313 <property>/environment/metar/valid</property>
314 <property>/environment/params/metar-updates-environment</property>
315 <property>/environment/params/metar-updates-winds-aloft</property>
316 </condition>
317 </enable>
318 <input>
319 <offset>/environment/config/aloft/entry[4]/wind-speed-change-rel</offset>
320 </input>
321 <output>/environment/config/aloft/entry[4]/wind-speed-kt</output>
322 </filter>
323
324 <!-- Clouds -->
325 <filter include="clouds-altitude-interpolate.xml"/>
326 <filter include="clouds-altitude-interpolate.xml">
327 <name>MetarController:clouds:altitude_interpolate_0</name>
328 <params>
329 <from>/environment/metar/clouds/layer[1]/elevation-ft</from>
330 <to>/environment/clouds/layer[1]/elevation-ft</to>
331 </params>
332 </filter>
333 <filter include="clouds-altitude-interpolate.xml">
334 <name>MetarController:clouds:altitude_interpolate_1</name>
335 <params>
336 <from>/environment/metar/clouds/layer[2]/elevation-ft</from>
337 <to>/environment/clouds/layer[2]/elevation-ft</to>
338 </params>
339 </filter>
340 <filter include="clouds-altitude-interpolate.xml">
341 <name>MetarController:clouds:altitude_interpolate_2</name>
342 <params>
343 <from>/environment/metar/clouds/layer[3]/elevation-ft</from>
344 <to>/environment/clouds/layer[3]/elevation-ft</to>
345 </params>
346 </filter>
347 <filter include="clouds-altitude-interpolate.xml">
348 <name>MetarController:clouds:altitude_interpolate_3</name>
349 <params>
350 <from>/environment/metar/clouds/layer[4]/elevation-ft</from>
351 <to>/environment/clouds/layer[4]/elevation-ft</to>
352 </params>
353 </filter>
354
355 <filter include="clouds-thickness.xml"/>
356 <filter include="clouds-thickness.xml">
357 <name>MetarController:clouds:thickness_0</name>
358 <input>/environment/metar/clouds/layer[1]/thickness-ft</input>
359 <output>/environment/clouds/layer[1]/thickness-ft</output>
360 </filter>
361 <filter include="clouds-thickness.xml">
362 <name>MetarController:clouds:thickness_1</name>
363 <input>/environment/metar/clouds/layer[2]/thickness-ft</input>
364 <output>/environment/clouds/layer[2]/thickness-ft</output>
365 </filter>
366 <filter include="clouds-thickness.xml">
367 <name>MetarController:clouds:thickness_2</name>
368 <input>/environment/metar/clouds/layer[3]/thickness-ft</input>
369 <output>/environment/clouds/layer[3]/thickness-ft</output>
370 </filter>
371 <filter include="clouds-thickness.xml">
372 <name>MetarController:clouds:thickness_3</name>
373 <input>/environment/metar/clouds/layer[4]/thickness-ft</input>
374 <output>/environment/clouds/layer[4]/thickness-ft</output>
375 </filter>
376
377 <filter include="clouds-coverage.xml"/>
378 <filter include="clouds-coverage.xml">
379 <name>MetarController:clouds:coverage_0</name>
380 <params>
381 <from>/environment/metar/clouds/layer[1]/coverage-type</from>
382 <to>environment/clouds/layer[1]/coverage-type</to>
383 </params>
384 </filter>
385 <filter include="clouds-coverage.xml">
386 <name>MetarController:clouds:coverage_1</name>
387 <params>
388 <from>/environment/metar/clouds/layer[2]/coverage-type</from>
389 <to>environment/clouds/layer[2]/coverage-type</to>
390 </params>
391 </filter>
392 <filter include="clouds-coverage.xml">
393 <name>MetarController:clouds:coverage_2</name>
394 <params>
395 <from>/environment/metar/clouds/layer[3]/coverage-type</from>
396 <to>environment/clouds/layer[3]/coverage-type</to>
397 </params>
398 </filter>
399 <filter include="clouds-coverage.xml">
400 <name>MetarController:clouds:coverage_3</name>
401 <params>
402 <from>/environment/metar/clouds/layer[4]/coverage-type</from>
403 <to>environment/clouds/layer[4]/coverage-type</to>
404 </params>
405 </filter>
406 <filter>
407 <name>MetarController:cloud-visibility-m</name>
408 <type>exponential</type>
409 <filter-time>5</filter-time>
410 <enable>
411 <condition>
412 <property>/environment/metar/valid</property>
413 <property>/environment/params/metar-updates-environment</property>
414 </condition>
415 </enable>
416 <input>/environment/metar/clouds/layer[0]/visibility-m</input>
417 <output>/environment/clouds/layer[0]/visibility-m</output>
418 </filter>
419 <filter>
420 <name>MetarController:cloud-alpha</name>
421 <type>noise-spike</type>
422 <max-rate-of-change>0.2</max-rate-of-change>
423 <enable>
424 <condition>
425 <property>/environment/metar/valid</property>
426 <property>/environment/params/metar-updates-environment</property>
427 </condition>
428 </enable>
429 <input>/environment/metar/clouds/layer[0]/alpha</input>
430 <output>/environment/clouds/layer[0]/alpha</output>
431 </filter>
432 <!--
433 Place snow line at estimated climatic snow line.
434 -->
435 <filter>
436 <name>MetarController:climatic-snow-line</name>
437 <type>gain</type>
438 <gain>1.0</gain>
439 <enable>
440 <condition>
441 <property>/environment/params/metar-updates-snow-level</property>
442 <property>/environment/params/metar-updates-environment</property>
443 <not><property>/environment/metar/snow-cover</property></not>
444 </condition>
445 </enable>
446 <input>
447 <expression>
448 <sum>
449 <product>
450 <property>/position/latitude-deg</property>
451 <property>/position/latitude-deg</property>
452 <value>-1</value>
453 </product>
454 <product>
455 <value>8.255</value>
456 <property>/position/latitude-deg</property>
457 </product>
458 <value>5504</value>
459 </sum>
460 </expression>
461 </input>
462 <output>/environment/snow-level-m</output>
463 <min>-425</min>
464 <max>7500</max>
465 </filter>
466 <!--
467 Lower the snow line when a station below the current snow line reports
468 snow cover.
469 -->
470 <filter>
471 <name>MetarController:snow-level</name>
472 <type>gain</type>
473 <gain>1.0</gain>
474 <enable>
475 <condition>
476 <property>/environment/params/metar-updates-snow-level</property>
477 <property>/environment/params/metar-updates-environment</property>
478 <property>/environment/metar/snow-cover</property>
479 <property>/environment/metar/valid</property>
480 <less-than>
481 <expression>
482 <difference>
483 <product>
484 <property>/environment/metar/station-elevation-ft</property>
485 <value>0.3048</value>
486 </product>
487 <property>/environment/snow-level-m</property>
488 </difference>
489 </expression>
490 <value>0</value>
491 </less-than>
492 </condition>
493 </enable>
494 <input>
495 <expression>
496 <sum>
497 <product>
498 <property>/environment/metar/station-elevation-ft</property>
499 <value>0.3048</value>
500 </product>
501 <value>-50.0</value>
502 </sum>
503 </expression>
504 </input>
505 <output>/environment/snow-level-m</output>
506 <min>-425</min>
507 <max>7500</max>
508 </filter>
509 <!--
510 Windsock effects: flex and light-map
511 -->
512 <filter>
513 <name>MetarController:layer:wind-sock-pos</name>
514 <type>gain</type>
515 <gain>6.7</gain>
516 <reference>15</reference>
517 <input>/environment/wind-speed-kt</input>
518 <output>/sim/environment/windsock-pos</output>
519 <min>-90</min>
520 <max>0</max>
521 </filter>
522 <filter>
523 <name>MetarController:layer:wind-sock-light</name>
524 <type>gain</type>
525 <input>
526 <expression>
527 <table>
528 <property>/sim/time/sun-angle-rad</property>
529 <entry><ind>0.0</ind><dep>0.0</dep></entry>
530 <entry><ind>1.56999</ind><dep>0.0</dep></entry>
531 <entry><ind>1.57</ind><dep>1.0</dep></entry>
532 </table>
533 </expression>
534 </input>
535 <output>/sim/environment/windsock-light</output>
536 </filter>
537 <min>0.0</min>
538 <max>1.0</max>
539 </PropertyList>