gut-space / svarog

📡 A ground stations network for receiving satellite transmissions, using VHF, UHF, and more.
MIT License
10 stars 0 forks source link

Rate observations #31

Closed fivitti closed 3 years ago

fivitti commented 3 years ago

Functionality for rate observations. Rate algorithms are stored in "quality_ratings" directory. Each algorithm must to implement "rate" method which accept image. Image is read now by Matplotlib package which native support only PNG format, but we already have this dependency and it is compatible with OpenCV.

Rate algorithm is assigned to satellite the same way as recipe, by name in configuration. Rate is send to server as float from 0 (bad) to 1 (good). Rate is referenced to product entry. I create also view which aggregate the rating for observations by average.

On www page the rating is display as chessman (Bootstrap has small icon set). After hover user can show the rating in percentage. On observation view we display aggregate rating in details list and product rating on each imagery.

tomaszmrugalski commented 3 years ago

I've started reviewing but ran out of time today. Will continue tomorrow. I've found one issue so far. On my local DB some observations didn't have score and the template crashed:

    <div class="container">{% block content %}{% endblock %}</div>
    File "/home/thomson/devel/aquarius/server/templates/obs.html", line 78, in block "content"
    <i class="product-rating {{ file_.rating | rating_icon }}" title="{{ file_.rating | percentage }}"></i>
    File "/home/thomson/devel/aquarius/server/app/template_globals.py", line 35, in rating_icon
    if value < 0.2:
    TypeError: '<' not supported between instances of 'NoneType' and 'float'

I plan to fix this tomorrow and continue my review. Apologies it taking so long.

tomaszmrugalski commented 3 years ago

This looks ready to go! well done.