Hey dude, before you start reading the “Old version …” and the “New version …” please check the last section. We developed a very simple tool to do such auto-submissions!
Please note: https!
In November 2018 we moved from http to https (for www.wetterturnier.de). This also requires small adjustments for the autosubmit routines! If you use the “old school” wget command please notice that the “–no-check-certificate” option is required to be able to submit your bet. If you are using the small python-script please check your submission file and the URL is set to:
1 |
url = https://wetterturnier.de/autosubmit/ |
Thanks and have fun!
Old version of the URL’s
For our model output statistics people we developed an extended version of the “autosubmit” script. On the old system the URL’s looked something like this:
1 2 3 4 5 |
wget "http://prognose.met.fu-berlin.de/fehler/form.php" --post-data "stadt=b&aa=USERNAME&bb=PASSWORD&cc=8&dd=6&ww=4&xx=17&ee=250&ff=260&... #optional argument: #td=YYYY-mm-dd #(admin/automaton-only, old tournament date) |
where “aa”, “bb”, “cc” were the parameters. Note that these URL’s will still work by only replacing the main URL which would lead to something like this:
1 |
wget --no-check-certificate "https://wetterturnier.de/fehler/form.php" --post-data "stadt=b&aa=USERNAME&bb=PASSWORD&cc=8&dd=6&ww=4&xx=17&ee=250&ff=260&... |
New version of the URL’s
However, for better readability and a more flexible approach the same script has now a new (simpler) syntax. URL’s will now look like this:
1 2 3 4 |
wget --no-check-certificate "https://wetterturnier.de/autosubmit/" --post-data "city=IBK&user=USERNAME&password=PASSWORD&RR_1=3.2&N_1=8.0&N_2=5.0&RR_2=2.4&... #optional argument: #tdate=YYYY-mm-dd |
Main differences:
- main URL changed to www.wetterturnier.de/autosubmit
- city used slightly different. “i” or “w” no more allowed. Instead “IBK”=”Innsbruck” or “VIE”=”Vienna” have to be used
- Parameters are now readable (and – in case – simply extendable). The form is always <NAME>_<DAY> where <NAME> represents the wetterturnier parameter name (e.g., “N”, “TTm”, or “Wv”) and <DAY> the forecast day. If the tournament takes place on a Friday, then “1” means Saturday, “2” means Sunday.
- much better server-side output. Check the output wget generates. The server script tells you if there is something going wrong (e.g., login wrong, parameters not interpretable or unknown).
BUT there is a new, very easy and intuitively to use tool now!
However, a lot of stuff can go wrong with the URL’s as they are not as easy to read at all. Therefore, I wrote a small python script which does the submission for you. The only thing needed is a small ASCII-text file. The python code also returns error codes fetched from either wget or the server side autosubmit script on wetterturnier.de (e.g., if login was incorrect).
Script Usage:
1 |
python autosubmit.py -f MyFile.txt |
Here is an example of such a file (note that the template contains some more comments and help descriptions, this is the short form):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# ----------------------------------------------- # General # ----------------------------------------------- [general settings] url = https://wetterturnier.de/autosubmit/ logfile = autosubmit_%city%_%user%_%tdate%.txt user = USERNAME password = PASSWORD city = BER #tdate = YYYY-mm-dd # ----------------------------------------------- # Parameter settings. # ----------------------------------------------- [parameters] RR_1 = 3.2 RR_2 = 2.4 fx_1 = 0 fx_2 = 25 N_1 = 8 N_2 = 5 |
NEW: the optional “tdate” setting can be given, e.g. to send a belated automaton/MOS submission. This is only allowed for “Wetterturnier Admin” users (all MOSes have this capability)! The privileges get checked during the procedure and if the user sending the data is no admin, AUTOSUBMIT ERRORCODE 403 (like “FORBIDDEN“) is returned.
Additionally, if your “tdate” was no valid tournament day, e.g. if you had a typo in it, AUTOSUBMIT ERRORCODE 404 (like “NOT FOUND“) is returned.
The python script can be found here (version 0.3) or on sferics’ github including the template as shown above (autosubmit_example.txt). It has been developed for “python 2.7.6” using base packages “optparse“, “ConfigParser“, “subprocess“, and “re“.
UPDATE: There is now also a version for Python3 (autosubmit3.py) which has to be used with “autosubmit_example3.txt“. Both can be found on github or in the zip-Package.
There are a few extra options, please call with option “–help” to get the (minimalistic) usage of the script.
1 |
python autosubmit.py --help |
What happens if a parameter is missing
The script automatically checks if (for a given city) a parameter was not set. You’ll get a warning message and the script will stop – the data wont be stored in the database at all as we can’t judge bets where one or more forecasts are missing.
1 2 3 4 5 6 |
PARSING POST PARAMETERS ======================= Parsing parameters. Found city Innsbruck (IBK,ID 4) for input IBK [!] Parameter "FF" missing for forecast day "1". If not all parameters are sent we cannot store your forecast/bet! AUTOSUBMIT ERRORCODE 15 |
What happens if a day is missing
Here, the same holds as for “a parameter is missing”. The script won’t store any data, as we can’t judge bets with missing forecasts at all.
1 2 3 4 5 6 |
PARSING POST PARAMETERS ======================= Parsing parameters. Found city Innsbruck (IBK,ID 4) for input IBK [!] While checking parameters: The wetterturnier expects to get data for the next 2 days. Day "2" seems not to be delivered! Stop! AUTOSUBMIT ERRORCODE 15 |
What if my script sends more data than expected?
Well, that’s no problem at all. The idea is that the wetterturnier takes what it needs. if you are delivering more data or more forecast days these days will be dropped. This gives you a note, but the necessary forecast values will be stored.
Additional parameter:
1 2 3 4 |
IGNORED PARAMETERS ------------------ Ignored: day_1 ZZ: Forecast parameter ZZ for day 1 ignored. This was not requested for this city. Everything fine. This is just a note that you are sending more data than necessary. Ignored: day_2 YY: Forecast parameter YY for day 2 ignored. This was not requested for this city. Everything fine. This is just a note that you are sending more data than necessary. |
Additional day:
1 2 3 |
IGNORED PARAMETERS ------------------ Ignored: day_3: Forecasts for day 3 ignored. They were not requested. Everything fine. This is just a note that you are sending more data than necessary. |