THE NERC MST RADAR FACILITY AT ABERYSTWYTH

NERC MSTRF: sky-camera image animation

This page describes a simple piece of software for creating animations of sky-camera images, which can be viewed using a standard web-browser.
System requirements:
Installing the software on a Linux/Unix machine:
  1. Download tools-for-animating-sky-camera-images.tar to the directory where you want the software, e.g /home/mst/python-programs (this example directory name will be used below for the purposes of illustrating how to run the program).

  2. From the directory where you have downloaded the tar file, unpack the contents using the command:
    tar xvf tools-for-animating-sky-camera-images.tar

    This will generate two new files:
    create_sky_camera_animation_attachments.tar
    create_sky_camera_animation.py


    These files have been write-protected to prevent you from accidentally changing them. The file with the ".py" extension has been made executable, i.e. the command ls -l will show their permissions as:
    -r--r--r-- create_sky_camera_animation_attachments.tar
    -r-xr-xr-x create_sky_camera_animation.py


  3. You may now delete the original tar file, tools-for-animating-sky-camera-images.tar, although this is not essential. Do NOT unpack or delete the new tar file, create_sky_camera_animation_attachments.tar.

Installing the software on a Windows machine:
  1. Click on the following link: tools-for-animating-sky-camera-images.tar

  2. This should launch a File Download pop-up window which will ask you something along the lines of, Would you like to open the file or save it to your computer?. Choose the Open option. If you have WinZip installed, this will launch a pop-up window which shows the contents of the tar file:
    create_sky_camera_animation.py
    create_sky_camera_animation_attachments.tar


    Choose the Extract option, directing the output to a suitable directory, e.g. d:\python-programs (this example directory name will be used below for the purposes of illustrating how to run the program).

Creating animations
  1. Download the required tarred image file(s) from the BADC. You will need to be registered for access to the NERC MST Radar Facility dataset to be able to do this.

  2. Unpack the individual jpg image files from the tar file(s) as described here. You can delete the tar image files after this step, although this is not essential.

  3. The Python program will animate all jpg image files that it finds in a given source directory, source_dir_name (e.g. /home/mst/sky-camera-images on a Linux/Unix machine or d:\sky-camera-images on a Windows machine). Therefore ensure that all files in the source directory are for contiguous time steps. Create a separate directory for each group of images to be animated. The program will ignore all files which do not conform to the standard (jpg) sky-camera image naming convention - including the tar files.

  4. The Python program will generate the following files in the source directory:
    animation.html
    logo_mst.png
    logo_nerc.png
    page-style.css

    Direct your web-browser to the animation.html file and click on PLAY.

  5. Irrespective of the platform on which the Python code is being run, it is invoked with the following general syntax:
    python program_file_path source_dir_name


    where program_file_path is the (absolute or relative) path name of the create_sky_camera_animation.py file, and source_dir_name is the (absolute or relative) name of the source image directory. The three examples below demonstrate how to the run the program given the following scenarios:
    1. the Python program is run from an arbitrary directory, using absolute paths for both program_file_path and source_dir_name
    2. the Python program is run from its own directory and using a relative path for source_dir_name
    3. the Python program is run from source_dir_name and using a relative path for program_file_path. Note, in this case, the final '.' in the commands, which denotes the current directory location.

    On a Linux/Unix machine, assuming that the Python program is stored in a directory /home/mst/python-programs and that the sky-camera image files are stored in a directory /home/mst/sky-camera-images, enter:
    1. python /home/mst/python-programs/create_sky_camera_animation.py /home/mst/sky-camera-images
    2. python create_sky_camera_animation.py ../sky-camera-images
    3. python ../python-programs/create_sky_camera_animation.py .

    On a Windows machine you will need to open a Command Prompt window, through Start - Programs - Accessories. Assuming that the Python program is stored in a directory d:\python-programs and that the sky-camera image files are stored in a directory d:\sky-camera-images, enter:
    1. python d:\python-programs\create_sky_camera_animation.py d:\sky-camera-images
    2. python create_sky_camera_animation.py ..\sky-camera-images
    3. python ..\python-programs\create_sky_camera_animation.py .


Downloading a ready-made sample animation
  1. Download sample-sky-camera-animation.tar, following the instructions above for unpacking a tar file on a Linux/Unix or Windows system.

  2. This will automatically generate a sub-directory SAMPLE-SKY-CAMERA-ANIMATION, which will contain all of the files that you need.

  3. Direct your web-browser to the SAMPLE-SKY-CAMERA-ANIMATION/animation.html file and click on PLAY.

Internal Links:
Return to the top of the page
Registering for access to NERC MST Radar Facility data
Archiving convention for sky-camera images
A sky-camera event log
Software for creating sky-camera animations
A sample sample-sky animation.
External Links:
The Python programming language
WinZip: an archiving/compression tool for Windows
A JavaScript animation tutorial.