zejn/arsoapi — pull request #3 by avian2 (2014-06-29 15:26:19+00:00)
Title: Automatic radar image format detection and a few other bits

Hi

This change adds a ```format_id``` field to the ```RadarPadavin``` model for tracking radar image format. Image formats are defined using subclasses of ```RadarImageFormat``` in ```formats.py```. A simple format autodetection was added and image processing functions updated so they use parameters from the ```RadarImageFormat``` object.

This allows correct processing of radar images when the database contains a history of images using different formats. It also adds support for the latest SIRAD color scheme and makes it easier to support any future format changes.

Schema migration should be easy: just add the ```format_id``` column to the table. Set to NULL for existing rows.

This pull request also adds a few extra unit tests and a tool for checking map alignment: ```/vreme/kml/radar.kml?align=1``` shows the cities and borders from the radar image overlaid on the Google map. Feel free to disable in production as this view is a bit CPU intensive.