Autosubmit

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:

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:

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:

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:

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:

Here is an example of such a file (note that the template contains some more comments and help descriptions, this is the short form):

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.

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.

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.

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:

Additional day:

 

>> download autosubmit.py <<

github repository