TSI: further info
TSI: principle
The TSI consist of a webcam looking downwards to a dome shaped mirror.
Images of the camera are analysed for red, green and blue ratios in the built-in linux machine.
The resulting numbers, the image and the analysed image mask with detected sky-, thin and opaque
cloud areas are stored in the TSI's ring memory.
Data acquisition
Data is received here in cologne every 20sec from the TSI via wget
in a bash script
and stored in an ascii file. The data of this file comes in the form:
dd.mm.yyyy hh:mm:ss t_raw_ms opq thn sun_flag sol_azi sol_ele
With
-
dd.mm.yyyy hh:mm:ss
date and time in UTC
-
t_raw_ms
time in millisecons since 1.1.1970 0:00:00 UTC
-
opq, thn
percentage of opaque and thin clouds
-
sun_flag
flag wether sun is shining or not
-
sol_azi, sol_ele
solar azimuth and elevation as calculated by the instrument
Panorama
The panorama is calculated with the transformation
pan(x,y) = raw( cx - R*y/w * sin(2π*x/w) , cx + R*y/w * cos(2π*x/w) )
Where:
-
raw(i,j)
is the color of a pixel with coordinates i,j
in the raw image
-
pan(x,y)
is the color of a pixel with coordinates x,y
in the panorama
-
cx,cy
are the coordinates of zenith in the raw image
-
R
is the radius of the horizon in the raw image
-
w,h
are width and height of the panorama
The transformation is done in a bash script with image magick using the fx command and 'look up tables' (lut).
The commands are:
convert -size $wpan'x'$hpan xc: -channel G -fx "($cx-$rad*j/$hpan*sin(2*pi*i/$wpan))/$wraw" -separate lutX.png
convert -size $wpan'x'$hpan xc: -channel R -fx "($cy+$rad*j/$hpan*cos(2*pi*i/$wpan))/$hraw" -separate lutY.png
...
convert lutX.png lutY.png raw.jpg -fx "u[2].p{ u*$wraw , v*$hraw }" pan.jpg
convert raw.jpg pan.jpg -geometry +0+$(($hraw-$hpan)) -composite raw.jpg
The first two convert
commands generate the look up tables. They are executed only once a day.
The third convert
command generates the panorama using the look up table,
the forth convert
command copies the panorama to the bottom border of the original image.
The parameters are:
-
$wpan
and $hpan
desired width and height of the panorama.
-
$cx
and $cy
position of zenith in the image
-
$rad
radius of the mirror in the image
-
i,j
are by default the coordinates in the source image
-
v.p
is by default the pixel in the second image of the argument list
-
The second line copies the panorama finally to the lower border of the original image