3D Visualization Tool for Meteorological Radar Data using WebGL

Heavy rain and storms are present in almost every part of the world. Foresee to avoid material and mainly life, losses is a continuous challenge to forecasters. Meteorologists have Meteorological Radar to help and improve now cast. The Meteorological Radar is able to identify rain and hail. It provide data at each sweep and meteorologist is able to evaluate the data and understand amount of rain. However, visualization tools help meteorologist to rapidly understand the whole process. Nowadays, the tools to visualize radar data are all 2D (plane based) tools. And they are all stand alone, desktop based applications. Usually the tool display one sweep at time that means meteorologist needs to open several sweeps. On the other side, there are very good 3D visualization tools but they need trainning and do not offer the proper treatment of the data to provide data information (latitude, longitude, reflectivity) on specific data point. It is proposed a 3D visualization tool for the Internet era that the radar data is presented in the browser using WebGL c ©. The tool is specific for radar data. WebGL c ©is a 3D rendering API to the Web, developed by the Khronos Group (www.khronos.org).


INTRODUCTION
Rain has two faces: as it is necessary to provide water and mantain life, it has its counter part that can bring flood, tragedy and losses.
Brazil, a tropical country suffers each year with floods in big cities as São Paulo and, as last year, tragedies in Rio de Janeiro and Paraná states, with material and mainly, lifes losses.
Meteorological Radar helps meteorologists nowcast and identify rain formation and path.Indeed, visualization tools available for the radar data provide image in 2D, that can provide specific visualization.
It is propose a tool to improve visualization for the Meteorological Radar data that can display 3D data in the Internet Browser.

Radar
Radar means "Radio Detection and Ranging".As [1] states, Radar has its roots in radio.During a U.S.Navy experiment for radio communication, Young and Taylor observed that the radio signal was interrupted by an airplane.They stated that it could be used to detect targets.During World War II, radar was developed and by the end of the War, it was used sucessfully mainly by the allied forces.
After war, part of the surplus military equipment became available for civilian use and those researchers interested in study weather using radar were some of the first to acquire those radars.
Since World War end, radar has been improved and developed.New components, antennas, transmitters, receivers, signal processors and software are been developed.

Radar operation
Radar basically consists in four components: the transmitter, the antenna, the receiver and a set of hardware and software elements to display the information to allow people to see what radar had detected.
The very basic information about the radar operation is: 1. the transmitter sends a high frequency signal pulse (the "burst"); 2. The signal (electromagnetic wave) travels with the Speed of Light (300000 km/s) and hits "targets"(airplane, cloud, ice, etc); 3. part of the signal returns back and reaches the radar antenna; 4. the antenna capture the small value signal and the receiver gets that signal, amplifies it; 5. The signal processor process the data captured and prepare it.
This signal that is capture back is called echo.A specific software display it in screen for visualization, detection or analysis.
Usually, radar antenna rotates about a vertical axis, scanning horizon in all directions.Even though the antenna may rotate and scan in speeds as much 70 • (10 RPM), the speed of light is faster that it and, for the eletromagnetic waves, seem that the antenna was stopped.
As the signal travels in the Light Velocity (300000 km/s), such velocity helps to identify the target altitude and speed.If the target is moving, because the velocity of the light is too big.
A tipical use for meteorological radar operation is the volume-scan mode: the antenna rotates, doing a full cycle (360 • ) at one elevation angle.Then, it till up a degree and do another full cycle.The target altitude is obtained by the time that the echo is captured after it was sent.

Doppler effect
But there is another magnitude that a specific type of Radar can detect: the velocity of the target.The principle by which a radar can evaluate the velocity of the target is the Doppler effect, in honor of the Austrian Physicist C. J. Doppler, that was the first that observe such phenomena with sound waves (as explained in [2] p274-278).
Doppler verified that an observer stopped could hear a different frequency when the source of the sound is moving.If the source is moving to the observer, the frequency becames greater than if the source is moving away from the observer.This effect occurs due the waves with wave length λ s from the source in movement reach the observer with different wave lengths, that means a different frequency.As consequence, based in the frequency that reachs the observer, the speed of the source can be calculated.
The equation of the Doppler effect: where: f o is the frequency that observer verifies c is the speed of light v o is the velocity of the observer (+ means that the source is approaching to the observer) v s is the velocity of the source (− means that the source is approaching to the observer) Based in the frequency that an echo reachs the radar, a radar of the type Doppler is able to detect the velocity of the source of the echo (cloud, bird, airplane).
Usually the radar is stationary, but the target is moving.The target acts as source for the radar and the shift in the frequency provides the radar with the information if the target is moving toward to radar or away from radar.
This type of radar is able to detect the wind between surface of the earth and heights up to the lower stratosphere.

Physical principles
As were stated above, radar generates a pulse aka burst of eletromagnetic waves and such waves when reachs a target, a small part of the waves come back to the radar and could be captured by antenna.
It is feasible because the energy is transported by the eletromagnetic waves.This energy is absorved by the target and reirradiate [3].
When a eletromagnetic wave traverse a molecule, it perturbs or agitates the movement of the electrons.This kind of perturbation lead the molecule to a excited state.The molecule wants to keep in the normal state and it emits a photon with the same frequency and energy of the electromagnetic wave that cause the process explained in [2, p. 312-315].In this situation, when the molecule come back to original state, it acts as an "emitter" of electromagnetic waves.However, the molecule emits waves in all directions.
In the case of light (that is electromagnetic wave), we can see the effect looking to the sky.The molecules of air, due the variations of density, scatter more intenselly the lower wave lenghts than the greaters wave lengths.As consequence, we see the sky in blue [3, p. 868].
In terms of radar, the scattering is called backscattering because it is the energy from the scattering but that cames back to the antenna.

Logarithmic Radar Reflectivity factor Z
The meteorological radar is not only used to detect where are storms and clouds, but measuring the strength of the returned power, it is able to estimate the rain rate.
How the targets is viewed by the radar depends of the form.Fortunely, many hydrometeors are aproximately spheres.And, the cross-sectional area of the target is equal of the geometric area: where: σ is the cross-sectional area r: is the radius of the sphere.
There is a value based in the relation D λ , where D is the diameter of the sphere and λ is the wave length of the radar.
This relation is important, because when the size of the sphere compared with the wave length is small, the sphere is in the Rayleigh 1 region."Small" it usually interpreted to D λ < 0.1.In the Rayleigh region the backscattering cross-secctional area of the sphere is proportional to the sixth power of the diameter.The expression for σ was calculated and given by [4]: where: σ is the cross-sectional area |K| is the magnitude of the parameter related to the complex index of refraction 2 .D is the diameter of the target.λ is the wave length of the frequency of the radar.
There are a number of targets which can be considered point targets, as spheres.Many of the weather echoes are not.See for instance, a rain that contains billions of raindrops.That the same for the cloud and its droplets.So, rain and cloud are not considered point targets.Mathematically, express simply that the total backscattering cross-secctional area of a meteorological target is the sum of all the individual backscattering cross-sectional areas: appling (3) in (4), have: 1 John William Strutt, Lord Rayleigh (1842-1919) English Physicist, discovered the Rayleigh scattering.Wins Nobel Prize in 1904 2 [4] gives two tables that list the appropriate values os |K| 2 for water, ice in various temperatures Defining a parameter called z, that is, radar reflectivy factor as The summation is carried out over an unit volume, that is the volume with volume equals 1m 3 .
Thus, we can define the logarithmic radar reflectivity factor Z as follows: where: Z is the logarithmic radar reflectivity factor measured in units of σ z is the linear radar reflectivity factor in 1mm 6 /m 3 .The unit for Z is the deciBelZ or dBZ.Using the logarithmic reflectivity has the advantages of compressing the range of values measured by the radar.For instance -30dBZ is for fog; +76.5 dBZ is for huge hail.
Z is one of the data provided by the Meteorological Radar.Such Z data is displayed by the proposed 3D Viewer.

Volume Data
Radar uses range gates (also called "bin") for collect data at specific distances from the radar.Such specific volumes are collected during the sweep.
The radar antenna rotates, completing a complete circunference, than it elevates for another angle in relation to the surface and then made another sweep.
Each sweep is made of "rays" and each ray is "formed" by the range gates or range bins.

PPI -Plan Position Indicator
PPI -Plan Position Indicator is the most common display for weather information.It displays the radar data in a map like format, usually with radar in the center.Range marks called range rings help the user to verify and estimate the distance around the position of the radar.Table color helps the user to estimates the data value is watched.
The data is provided by a sweep in azimuth via a specific elevation.An example of PPI can be seen in Figure 1 from Simepar (see section 2.1.6).This picture displays Echoes and the Range Rings marked with white circles and lines.
The radar is on the center of the picture.The Range Rings are displayed to help the user to have knowledge about the positions of the echoes.The echoes are colorized and a color table provides information and helps user the values of the Reflectivity.
There are others products that Meteorological Radar can provide, but the focus in on the PPI because it is used for comparation for the viewer.

WebGL
As stated by the KhronosGroup [6], WebGL is a royalty-free, cross-platform API that brings OpenGL ES 2.0 to the web as a 3D drawing context within HTML.It uses the OpenGL Shading Language, GLSL ES, and can be combined with other web content that is layered on top or underneath the 3D content.It is designed to provide 3D web applications in the Javascript programming language.
WebGL enables the Internet browser to display high quality grafhics via video card.It combines the OPENGL ES for the Shaders and Javascript provides vertices and colors to the shaders.
The choose for WebGL is because it allows 3D applications for the Internet Era.No need program installation or plugin use neither complicated software libraries installed.Only the Internet Browser that supports WebGL is sufficient to display high quality software.Thinking in Scientific Visualization, it helps researchers share results and views with minimal impact to the final user.
Unfortunely, not all Internet Browsers offer support to WebGL.The browsers that actually offers support are: • Google Chrome c version 18.0 • Mozilla Firefox c version 11.0

Shaders
OpenGL 2.0 specification [7] brings to Computer Graphics community a "new way" to write programs, changing from a fixed mode to a dynamic mode via shaders.The language to program shaders is the OpenGL Shading Language -OGSL.Since that specification, OpenGL Shading Language allows application developers to define the processing that occurs at key points of the OpenGL API, that before, was fixed, can be changed in the fundamental operations of the OpenGL graphics pipeline [8].
One of the main benefits of the OGSL is the runtime compilation.The developer write code and the code is compiled during runtime.It enables the flexibility to applications.
OpenGL ES -OpenGL for Embedded Systems -is an api that bring the 3D graphics to new devices.As stated by [9, p.9], OpenGL ES is an application programming interface (API) for advanced 3D graphics targeted at handheld and embedded devices such as cell phones, personal digital assistants (PDAs), consoles, appliances, vehicles, and avionics.
With OpenGL SL ES -OpenGL Shading Language for Embedded Systems, developers are able to write shaders for hand and mobile devices.
WebGL uses a small set of the OpenGL SLES to enable shader programs on the Internet browser.
The application should contain 2 programs, called shaders: • Vertex Shader

• Fragment Shader
They can or may "share" values between them using a special type of data called Uniforms values.
Vertex Shaders are programs that operates (as the name says) over each vertex of the application.
Fragment Shaders are programs that operates over the fragments of the application.Few examples of fragments are: The application should generate buffers with the vertex, texture and color and pass to the shaders via attributes.

Radar Data 3D Viewer
Render volumetric data is a challenge because it is computer intensive task.For a radar data, the challenge is render all the data as quick as can, because if does not render quickly, the render is not useful for the meterologists make analysis.It was verified that the viewer is quick to display (less than 1 minute for the big data from all elevations and to interact with the visualization tools, changing camera position and rotating angles. The Radar Data 3D Viewer is a system that renders the radar (Simepar Radar 2.1.6)data in the Internet Browser using WebGL.
The block diagram of the Viewer is show in Figure 4: The data from the radar should be prepared to be used in the Internet Browser.The viewer use Javascript Object Notation (Json) data format.
The data should contain the volume information (number of elevation, number of bins in each ray, number of rays per sweep, number of sweeps for the dataset).For each sweep, each ray should be provided with the data for each bin.For this specific version, the radar data is the Reflectivity (dbZ).

Create Grid
With the data, a Structured Grid [10, p.65] is created.For this version, each cell is a bin and is threated as point.The structured grid contains the data values as well.

Extract Vertex
The WebGL vertex shader needs the vertex values build as a buffer.The code prepares the vertex data for each bin from the Grid.

Apply color table
The Reflectivity is a scalar value.The most common scalar visualization is the Color Map or Color Table [10].For the Fragment Shader, the application applys a color based in the value from the grid.It extracts the color in RGB (Red, Green and Blue) values for the buffer that is passed as attribute for the Fragment Shader.

Calculate matrix
With the values from 4.3 and from 4.4, application creates buffers that will be passed as attributes to the Vertex and Fragment Shaders.But, for perspective and position depending of the camera position, is necessary calculate matrix.After calculate the matrix, it passes the matrix as uniform values for the Vertex Shader.

Render
In the Render phase, the data is rendered in the browser for the Vertex and Fragment Shader.
The Vertex Shader will apply the coordinates for each point (vertex).Each vertex means a bin for the application.
The color (defined by the color table 4.4) is applied by the Fragment Shader.

Tests and Results
The The data for each test was extracted from a Data Reader program, that reader the raw data from the radar file and extracts in a format (json) that the application is able to read.
All the tests were done with fixed 45 • of perspective angle for the camera.The application allows user to rotate around axes X, Y and Z.There are buttons to increment and decrement 5 • to rotate.
To be clear and easy to understand, the same color table in the PPI in Figure 1 was used and Figure 5 contains the color table used in the tests.

Figure 5. Color Table applied
The values in the right side are values of Reflectivity that the color represents.How greater is the value, greater is the intensity of the rain.

Elevation 1 -0.5 •
The first test, the viewer displays only one elevation and sweep.The elevation angle is 0.5 • .As explained above, the test displays fixed 45 • of perspective angle.Figure 6 displays the result.
The elevation is the same displayed in Figure 1.The radar is on the center and there are 360 rays with 800 bins each.
For comparation, Figure 7 displays the elevation rotated 90 • on the X axis.The picture is very similar and very coeherent with Figure 1.However, Figure 1 displays a picture from a software actually working in production environment that is planar (2D) and only one elevation per time.This test is with elevation at 3.0 • .Figure 9 displays the result.As expected there are less points appearing.In the atmosphere, the water (drops), hail, ice are detected in low altitudes.For each elevation increase, the radar ray reaches higher atmosphere layers with no targets because is too high.So, as consequence, in the viewer there is no data to display as farther from radar.This test is with elevation at 21.0 • .Figure 11 displays the result.The cone is very clear to see and not much data far from the radar due that the ray hits high atmosphere, that there are no targets (rain, hail).However, the information is very important to provide meteorologist with visualization about the targets at these levels.

Conclusions and proposes
The application proved that WebGL is very useful for Scientific Visualization too.It is able to render 3744000 points quickly and attends the needs from the users' point of view.By the time to render a picture, the application proved it can be used for nowcasting either for disasters prevention.Some improvements are suggested: • Improve the user interaction (color table, mouse navigation, grid and reference lines); • Insert some tools as plan cut and filters; • Insert georeference and apply map for position; • Insert other types of data, as spectral width and wind velocity.

Figure 4 .
Figure 4. Block diagram of 3D Viewer tests are done in Google Chrome c version 18.0.1025.142 in a notebook Lenovo c G460 with processor Intel c I5 with 4Gbytes of memory, with Nvidia c GeForce c 310M with 512 Mbytes of dedicated video memory.It was choosed a specific date, 04/01/2012, 19:50 UTC (16:50 Brazilian Time).That day, there were several storms and heavy rain in the range of the radar (200km).

Figure 12 .
Figure 12.All elevations at same time