- Page contents:
- System requirements
- Installing the software on a Linux/Unix machine
- Installing the software on a Windows machine
- Creating animations
- Downloading a ready-made sample animation
System requirements:
- The software requires you to have an interpreter for the
Python programming language installed on your
computer. This is almost certain to be the case on a Linux/Unix
machine. It can be freely-downloaded for a number
of platforms, including Linux/Unix, Windows and Mac OS X. You do
not need know anything about Python to run the program.
- Windows users will need a program such as WinZip for unpacking Linux/Unix tar
files.
- The software creates a JavaScript HTML page - based on the following tutorial - which can be viewed on any web-browser (with JavaScript support enabled).
Installing the software on a Linux/Unix machine:
- 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).
- 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
- 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:
- Click on the following link: tools-for-animating-sky-camera-images.tar
- 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
- 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.
- 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.
- 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.
- 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.
- 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:- the Python program is run from an arbitrary directory, using absolute paths for both program_file_path and source_dir_name
- the Python program is run from its own directory and using a relative path for source_dir_name
- 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:- python /home/mst/python-programs/create_sky_camera_animation.py /home/mst/sky-camera-images
- python create_sky_camera_animation.py ../sky-camera-images
- 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:- python d:\python-programs\create_sky_camera_animation.py d:\sky-camera-images
- python create_sky_camera_animation.py ..\sky-camera-images
- python ..\python-programs\create_sky_camera_animation.py .
Downloading a ready-made sample animation
- Download sample-sky-camera-animation.tar,
following the instructions above for unpacking a tar file on a Linux/Unix or Windows system.
- This will automatically generate a sub-directory SAMPLE-SKY-CAMERA-ANIMATION, which will
contain all of the files that you need.
- Direct your web-browser to the SAMPLE-SKY-CAMERA-ANIMATION/animation.html
file and click on PLAY.