Cancel specular highlights due to sun at night
[fg:toms-fgdata.git] / Environment / metarinterpolator.xml
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     <enable>
183       <condition>
184         <property>/environment/metar/valid</property>
185         <property>/environment/params/metar-updates-environment</property>
186         <property>/environment/params/metar-updates-winds-aloft</property>
187       </condition>
188     </enable>
189     <input>
190       <offset>/environment/config/aloft/entry[0]/wind-heading-change-deg</offset>
191     </input>
192     <output>/environment/config/aloft/entry[0]/wind-from-heading-deg</output>
193   </filter>
194   <filter include="layer-heading-offset.xml">
195     <enable>
196       <condition>
197         <property>/environment/metar/valid</property>
198         <property>/environment/params/metar-updates-environment</property>
199         <property>/environment/params/metar-updates-winds-aloft</property>
200       </condition>
201     </enable>
202     <input>
203       <offset>/environment/config/aloft/entry[1]/wind-heading-change-deg</offset>
204     </input>
205     <output>/environment/config/aloft/entry[1]/wind-from-heading-deg</output>
206   </filter>
207   <filter include="layer-heading-offset.xml">
208     <enable>
209       <condition>
210         <property>/environment/metar/valid</property>
211         <property>/environment/params/metar-updates-environment</property>
212         <property>/environment/params/metar-updates-winds-aloft</property>
213       </condition>
214     </enable>
215     <input>
216       <offset>/environment/config/aloft/entry[2]/wind-heading-change-deg</offset>
217     </input>
218     <output>/environment/config/aloft/entry[2]/wind-from-heading-deg</output>
219   </filter>
220   <filter include="layer-heading-offset.xml">
221     <enable>
222       <condition>
223         <property>/environment/metar/valid</property>
224         <property>/environment/params/metar-updates-environment</property>
225         <property>/environment/params/metar-updates-winds-aloft</property>
226       </condition>
227     </enable>
228     <input>
229       <offset>/environment/config/aloft/entry[3]/wind-heading-change-deg</offset>
230     </input>
231     <output>/environment/config/aloft/entry[3]/wind-from-heading-deg</output>
232   </filter>
233   <filter include="layer-heading-offset.xml">
234     <enable>
235       <condition>
236         <property>/environment/metar/valid</property>
237         <property>/environment/params/metar-updates-environment</property>
238         <property>/environment/params/metar-updates-winds-aloft</property>
239       </condition>
240     </enable>
241     <input>
242       <offset>/environment/config/aloft/entry[4]/wind-heading-change-deg</offset>
243     </input>
244     <output>/environment/config/aloft/entry[4]/wind-from-heading-deg</output>
245   </filter>
246
247   <filter include="layer-speed-change.xml"/>
248   <filter include="layer-speed-change.xml">
249     <enable>
250       <condition>
251         <property>/environment/metar/valid</property>
252         <property>/environment/params/metar-updates-environment</property>
253         <property>/environment/params/metar-updates-winds-aloft</property>
254       </condition>
255     </enable>
256     <input>
257       <offset>/environment/config/aloft/entry[0]/wind-speed-change-rel</offset>
258     </input>
259     <output>/environment/config/aloft/entry[0]/wind-speed-kt</output>
260   </filter>
261   <filter include="layer-speed-change.xml">
262     <enable>
263       <condition>
264         <property>/environment/metar/valid</property>
265         <property>/environment/params/metar-updates-environment</property>
266         <property>/environment/params/metar-updates-winds-aloft</property>
267       </condition>
268     </enable>
269     <input>
270       <offset>/environment/config/aloft/entry[1]/wind-speed-change-rel</offset>
271     </input>
272     <output>/environment/config/aloft/entry[1]/wind-speed-kt</output>
273   </filter>
274   <filter include="layer-speed-change.xml">
275     <enable>
276       <condition>
277         <property>/environment/metar/valid</property>
278         <property>/environment/params/metar-updates-environment</property>
279         <property>/environment/params/metar-updates-winds-aloft</property>
280       </condition>
281     </enable>
282     <input>
283       <offset>/environment/config/aloft/entry[2]/wind-speed-change-rel</offset>
284     </input>
285     <output>/environment/config/aloft/entry[2]/wind-speed-kt</output>
286   </filter>
287   <filter include="layer-speed-change.xml">
288     <enable>
289       <condition>
290         <property>/environment/metar/valid</property>
291         <property>/environment/params/metar-updates-environment</property>
292         <property>/environment/params/metar-updates-winds-aloft</property>
293       </condition>
294     </enable>
295     <input>
296       <offset>/environment/config/aloft/entry[3]/wind-speed-change-rel</offset>
297     </input>
298     <output>/environment/config/aloft/entry[3]/wind-speed-kt</output>
299   </filter>
300   <filter include="layer-speed-change.xml">
301     <enable>
302       <condition>
303         <property>/environment/metar/valid</property>
304         <property>/environment/params/metar-updates-environment</property>
305         <property>/environment/params/metar-updates-winds-aloft</property>
306       </condition>
307     </enable>
308     <input>
309       <offset>/environment/config/aloft/entry[4]/wind-speed-change-rel</offset>
310     </input>
311     <output>/environment/config/aloft/entry[4]/wind-speed-kt</output>
312   </filter>
313
314   <!-- Clouds -->
315   <filter include="clouds-altitude-interpolate.xml"/>
316   <filter include="clouds-altitude-interpolate.xml">
317     <params>
318       <from>/environment/metar/clouds/layer[1]/elevation-ft</from>
319       <to>/environment/clouds/layer[1]/elevation-ft</to>
320     </params>
321   </filter>
322   <filter include="clouds-altitude-interpolate.xml">
323     <params>
324       <from>/environment/metar/clouds/layer[2]/elevation-ft</from>
325       <to>/environment/clouds/layer[2]/elevation-ft</to>
326     </params>
327   </filter>
328   <filter include="clouds-altitude-interpolate.xml">
329     <params>
330       <from>/environment/metar/clouds/layer[3]/elevation-ft</from>
331       <to>/environment/clouds/layer[3]/elevation-ft</to>
332     </params>
333   </filter>
334   <filter include="clouds-altitude-interpolate.xml">
335     <params>
336       <from>/environment/metar/clouds/layer[4]/elevation-ft</from>
337       <to>/environment/clouds/layer[4]/elevation-ft</to>
338     </params>
339   </filter>
340
341   <filter include="clouds-thickness.xml"/>
342   <filter include="clouds-thickness.xml">
343     <input>/environment/metar/clouds/layer[1]/thickness-ft</input>
344     <output>/environment/clouds/layer[1]/thickness-ft</output>
345   </filter>
346   <filter include="clouds-thickness.xml">
347     <input>/environment/metar/clouds/layer[2]/thickness-ft</input>
348     <output>/environment/clouds/layer[2]/thickness-ft</output>
349   </filter>
350   <filter include="clouds-thickness.xml">
351     <input>/environment/metar/clouds/layer[3]/thickness-ft</input>
352     <output>/environment/clouds/layer[3]/thickness-ft</output>
353   </filter>
354   <filter include="clouds-thickness.xml">
355     <input>/environment/metar/clouds/layer[4]/thickness-ft</input>
356     <output>/environment/clouds/layer[4]/thickness-ft</output>
357   </filter>
358
359   <filter include="clouds-coverage.xml"/>
360   <filter include="clouds-coverage.xml">
361     <params>
362       <from>/environment/metar/clouds/layer[1]/coverage-type</from>
363       <to>environment/clouds/layer[1]/coverage-type</to>
364     </params>
365   </filter>
366   <filter include="clouds-coverage.xml">
367     <params>
368       <from>/environment/metar/clouds/layer[2]/coverage-type</from>
369       <to>environment/clouds/layer[2]/coverage-type</to>
370     </params>
371   </filter>
372   <filter include="clouds-coverage.xml">
373     <params>
374       <from>/environment/metar/clouds/layer[3]/coverage-type</from>
375       <to>environment/clouds/layer[3]/coverage-type</to>
376     </params>
377   </filter>
378   <filter include="clouds-coverage.xml">
379     <params>
380       <from>/environment/metar/clouds/layer[4]/coverage-type</from>
381       <to>environment/clouds/layer[4]/coverage-type</to>
382     </params>
383   </filter>
384   <filter>
385     <name>MetarController:cloud-visibility-m</name>
386     <type>exponential</type>
387     <filter-time>5</filter-time>
388     <enable>
389       <condition>
390         <property>/environment/metar/valid</property>
391         <property>/environment/params/metar-updates-environment</property>
392       </condition>
393     </enable>
394     <input>/environment/metar/clouds/layer[0]/visibility-m</input>
395     <output>/environment/clouds/layer[0]/visibility-m</output>
396   </filter>
397   <filter>
398     <name>MetarController:cloud-alpha</name>
399     <type>noise-spike</type>
400     <max-rate-of-change>0.2</max-rate-of-change>
401     <enable>
402       <condition>
403         <property>/environment/metar/valid</property>
404         <property>/environment/params/metar-updates-environment</property>
405       </condition>
406     </enable>
407     <input>/environment/metar/clouds/layer[0]/alpha</input>
408     <output>/environment/clouds/layer[0]/alpha</output>
409   </filter>
410 <!-- replace weather-utility.nas 
411     # Put the snow line slightly below the station's elevation, 
412     # so the station is completely covered with snow
413 -->
414   <filter>
415     <name>MetarController:snow-level</name>
416     <type>gain</type>
417     <gain>1.0</gain>
418     <input>
419       <condition>
420         <property>/environment/metar/valid</property>
421         <property>/environment/metar/snow-cover</property>
422       </condition>
423       <expression>
424         <sum>
425           <product>
426             <property>/environment/metar/station-elevation-ft</property>
427             <value>0.3048</value>
428           </product>
429           <value>-50.0</value>
430         </sum>
431       </expression>
432     </input>
433     <input>3200</input>
434     <output>/environment/snow-level-m</output>
435     <max>3200</max>
436   </filter>
437 </PropertyList>