MSS automation

Issue #514 resolved
Daniel Kunkel created an issue

During SouthTRAC I asked Jörn for a type of automation within mss to create for instance a number of the same plots for several flights or several forecast steps. This is particularly useful during hindcasting when compiling an overview over flights of a campaign. (But of course would also be very useful during forecasting, I always first check several variables to get an idea of the meteorological situation).

A first quick solution has already been provided as an external plotting script for top view like plots.

Comments (12)

  1. Joern Ungermann

    Next steps would be usage of a JSON file for configuration (preferably the mss-settings.json), more reuse of mss frontend functionality, and support for vertical cross-sections. The script should also be added as executable script to mss, if it can be executed without modification.

    This feature might also be added as a menu entry to the main menu to download all configured plots to a selected folder for the current flighttrack file.

    A typical task on campaign is to prepare a presentation/operator plan for the current flight-track and update it with the most recent meteorological forecast over the course of several days, where this automation would be very useful.

  2. Daniel Kunkel reporter

    Jörn, I can run the script, however, I succeed only when plotting the layers given in the example. If I want to plot other layers for hsec and vsec, I get the following error:

    Traceback (most recent call last):
      File "retriever.py", line 234, in <module>
        _main()
      File "retriever.py", line 224, in _main
        img = PIL.Image.open(image_io)
      File "/home/dkunkel/anaconda2/envs/mssenv/lib/python3.7/site-packages/PIL/Image.py", line 2687, in open
        % (filename if filename else fp))
    OSError: cannot identify image file <_io.BytesIO object at 0x7f2d45cac5f0>
    CRITICAL: MSS Version: 1.9.0
    CRITICAL: Python Version: 3.7.5 (default, Oct 25 2019, 15:51:11) 
    [GCC 7.3.0]
    CRITICAL: Platform: Linux-4.15.0-66-generic-x86_64-with-debian-buster-sid (('64bit', ''))
    CRITICAL: Fatal error: Traceback (most recent call last):
      File "retriever.py", line 234, in <module>
        _main()
      File "retriever.py", line 224, in _main
        img = PIL.Image.open(image_io)
      File "/home/dkunkel/anaconda2/envs/mssenv/lib/python3.7/site-packages/PIL/Image.py", line 2687, in open
        % (filename if filename else fp))
    OSError: cannot identify image file <_io.BytesIO object at 0x7f2d45cac5f0>
    

  3. Reimar Bauer

    As a site note anaconda2 is for python2.x used

    mss-1.7.6 was the last version with python2* support.

    Interesting that the env is enabling python3.7.

  4. Reimar Bauer

    This feature may need in further versions of MSS a migration process.

    I am thinking on a much wider implementation, which is may be something for gsoc2020.
    I am thinking about a kind of implementation of that feature as the blender project has done it.
    There any kind of action I did by keyboard or mouse is shown in the status bar as python syntax. They have an editor integrated where those lines can be added.

    With common python syntax they can be extended and used to improve the manual actions.

    They also can be executed from the terminal using the blender api.

    I think this ideas to have such an API makes also refactoring because of changes we did in MSS much easier.

  5. Joern Ungermann

    Hi Daniel, sorry for answering so late. I think you are using an anaconda2 environment with a py3 environment. That is not in principle a problem, but a new install might be in order somewhen :-)

    The program is obviously not very user friendly. Can you attach your config file? I suspect a typo or similar and in this case you will not get a good error message at the current point in time.

    @Reimar This feature serves a very real need and we can discuss offline how to cleanly implement this. This is a rapid prototype I created for seeing how much effort it is to create such an offline downloader. If it is useful, I would propose to integrate it into MSS in a dark corner and extened/replace it, maybe with GSOC.

  6. Joern Ungermann

    I just pushed a slightly updated version, that actually prints WMS error messages to the terminal before shutting down more gracefully. You JSON file might also help, but this might help you debug without modifying the source code.

  7. Reimar Bauer

    Added draft for automatic plot retriever script. Should work for vertical and horizontal cross-sections. Should be instensively tested. Copy/paster should be reduced by refactoring msui code. At least a bit.

    Fix issue #514

    → <<cset b4b775b6254a>>

  8. Log in to comment