Forums
Possibility of non-existent METAR generation - Printable Version

+- Forums (https://www.fsxwx.com/mybb)
+-- Forum: Categories (https://www.fsxwx.com/mybb/forumdisplay.php?fid=3)
+--- Forum: Discussions (https://www.fsxwx.com/mybb/forumdisplay.php?fid=5)
+--- Thread: Possibility of non-existent METAR generation (/showthread.php?tid=74)



Possibility of non-existent METAR generation - alexpro - 2016-03-05

Good time of the day!
My English is not very good, excuse me if I said something wrong...

Is there any possibility to generate some "fake" METAR if no actual METAR available?
For example:
I use two airports as home: UKCS and UKCW (Severodonetsk and Lugansk, Ukraine).
UKCW included in stock airports in FSX/P3D, UKCS is not present but can be added as third-party addon.

There is no METAR for UKCW available unfortunately for now, because of this airport is actually destroyed. There is no METAR for UKCS because of this airport is non-functional more than five last years...

There is a problem using Pro ATC X without METAR on these airports: it doesn't "see" actual wind and pressure during departure, and it always assigns default runway during arrival due to absence of available METAR.

Thanks in advance, with best regards, Alexey.


Possibility of non-existent METAR generation - fsxwx - 2016-03-06

Although I understand the need for having these fake stations, I'm sorry to say that I probably won't implement such a feature in a foreseeable future because it looks like huge effort for a really specific (and seldom) use case.


Possibility of non-existent METAR generation - alexpro - 2016-03-07

FSXWX generates weather for UKCW pretty well and very close to real weather around.

I found the solution, and it was quite simple, although uncomfortable, for example:

We have wind 200 degrees and 5 knots and pressure 1010 HPa. I edit file with METARs and insert there a string:
UKCW 070900Z 20005KT Q1010

And that's all - this enough for Pro ATC X "see" weather. It's is inconvenient to edit files during flight of course, but acceptable. Maybe I could implement such feature, but I completely don't know where I can get actual weather information in certain simulator area.


Possibility of non-existent METAR generation - fsxwx - 2016-03-11

Haha, indeed, you found a valid workaround. :-)
The airport database I use for the placement of wx stations is independent from FSX's internal one, i.e. airports like UKCW are indeed 'known' to FSXWX.

Hm, so maybe I should have another look at this. If it is less effort than I initially though, then I will consider implementing it.


Possibility of non-existent METAR generation - alexpro - 2016-04-04

Good time of the day!

Before I begin, once again, I want to thank you for the wonderful weather engine

I can find a workaround for getting METAR export for Pro ATC X from FSXWX.
As I said before, my English is not very good, so my explanation may be not clear. But I'll try...

I found that FSXWX writes METAR data in %TEMP% directory in file FSXWXmetar.txt. This file have own format which is not recognized by Pro ATC X. I wrote unix bash shell script for extract METAR data from FSXWXmetar.txt and put it to another file. I installed cygwin on my system, using default installation and add "dos2unix" package.

In Pro ATC X I use weather option "Use OPUS weather", and set path to OPUS weather as F:\Weather.

I wrote cmd script for executing unix shell script with cygwin's bash.exe

I wrote windows power shell script for catch creation or changing %TEMP%\FSXWXmetar.txt and call cmd script for creating fake OPUS weather file. I used solution found on stackoverflow.com as a template

And at last, I wrote cmd script for shortcut to call powershell script.

My temporary files path is F:\TEMP

***metar.sh
cd /cygdrive/f/Temp
awk -F\; '{print $3}' FSXWXmetar.txt >/cygdrive/F/Weather/OpusWeather.txt
unix2dos /cygdrive/F/Weather/OpusWeather.txt
***end of metar.sh

***metar.cmd
F:\cygwin64\bin\bash.exe metar.sh
***end of metar.cmd

***metar.ps1
### SET FOLDER TO WATCH + FILES TO WATCH + SUBFOLDERS YES/NO
$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "F:\Temp"
$watcher.Filter = "FSXWXmetar.txt"
$watcher.IncludeSubdirectories = $false
$watcher.EnableRaisingEvents = $true

### DEFINE ACTIONS AFTER A EVENT IS DETECTED
$action = { $command="F:\FSXWX\metar.cmd"
iex $command
$command="echo changed"
iex $command
}
### DECIDE WHICH EVENTS SHOULD BE WATCHED + SET CHECK FREQUENCY
$created = Register-ObjectEvent $watcher "Created" -Action $action
$changed = Register-ObjectEvent $watcher "Changed" -Action $action

while ($true) {sleep 5}
***end of metar.ps1

***FSXWX-metar.cmd
powershell -File metar.ps1
***end of FSXWX-metar.cmd

How it works.
I put all scripts in F:\FSXWX directory, where placed fsxwx.exe.
I created shortcut for invoke FSXWX-metar.cmd on desktop.

Before running simulator and FSXWX I run shortcut. Script will wait for file %TEMP%\FSXWXmetar.txt will created or changed, and make a fake OpusWeather.txt file.
In this file I can insert non-existent fake METARs for airports such as UKCW, UKCS, ZULS and similar airports which does not have a real METARs. So, Pro ATC X is recognized weather in such airports and give proper runway for takeoff or landing.

I can try to implement export METAR feature to FSXWX if you don't mind. I have experience programming on C, C++ under Linux, I think I can handle this job.


Possibility of non-existent METAR generation - alexpro - 2017-02-24

Good time of the day.
Excuse me for bad English...

Going back to the old question...
As I see it, the theme of missing METARs nobody cares, unfortunately. My solution above works perfectly but there is one hitch. I can't get weather information for missing-METAR airport before I would be over it. Is there any possibility to get weather information while I go up to the airport for 70-100 NM, if no METAR available? This need to ensure that I was able to generate a non-existent METAR before ATC decides which runway to land is assigned.

Thanks for attention and great weather engine.


Possibility of non-existent METAR generation - fsxwx - 2017-05-18

Hi, thank you very much for you effort. I actually do care, but haven't had any time lately.

But I can assure you that it's still on my to-be-implemented-feature-list.


Possibility of non-existent METAR generation - alexpro - 2017-05-20

I wrote simple C++ program, which reads airport coordinates from airports.xml file created by mkrwys utility. My program used SimConnect_WeatherRequestInterpolatedObservation() function for get current weather in airport area and creates very simple METAR which enough for properly runway assignment. And in addition program does the same as scripts described in above post - adds non-existent METARS to result weather file.

If that interests you, I can give you program and source code.
SimConnect part is really simple, and maybe my way of METAR generation isn't quite right, but in all my cases all seems to work OK.