Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

DHI – LOCAL AREA WEATHER RADAR

LAWR Documentation
Gustav Wieds Vej 10
DK-8000 Aarhus
Denmark

Tel: +45 8620 5100


E-mail: nej@dhigroup.com
Web: http://radar.dhigroup.com

ii
DOCUMENT CHANGE LOG

Change Control Procedures

Each change or set of changes made to this document will result in an increment to the version
number of the document. Minor changes will increment the decimal point of the version
number. The change log will record this process and for each version number of the document
identify any modification(s) which caused the version number to be raised.

Version Date Reason for Change

1.0 08-07-00 Creation of Document


1.1 24-08-00 Update of Project
2.0 24-09-01 Updated to 3rd generation
2.1 12-02-04 Software update
3.0 02-10-04 Software update
3.1 07-03-05 Software update
3.2 25-05-09 Software update
3.2 19-02-10 Matlab code examples
3.2 21-06-10 Linux code examples
4.0 20-04-12 New processing (radar equation)
4.1 25-01-13 Text update
4.2 04-07-13 Text update and corrections

iii
iv
CONTENTS
1 LAWR INTRODUCTION ................................................................................................................................ 1
1.1 SYSTEM LAYOUT ................................................................................................................................................. 1
1.2 TECHNICAL SPECIFICATIONS................................................................................................................................... 2
2 LAWR INSTALLATION .................................................................................................................................. 3
2.1 ANTENNA UNIT .................................................................................................................................................. 3
2.1.1 Magnetron ........................................................................................................................................... 4
2.1.2 Clutter Fence (optional) ........................................................................................................................ 4
2.2 PC RACK ........................................................................................................................................................... 5
2.2.1 Signal Processor PC (DOS) configuration .............................................................................................. 6
2.2.2 Communicator PC (Windows) configuration ........................................................................................ 7
2.2.3 Cable Connections ................................................................................................................................ 9
2.3 CONFIGURATION OF SOFTWARE PRIOR TO START UP................................................................................................... 9
3 LAWR SOFTWARE.......................................................................................................................................11
3.1 LAWR SYSTEM FILES ......................................................................................................................................... 12
3.1.1 Folder Structure for LAWR files .......................................................................................................... 13
4 SIGNAL SAMPLING AND PROCESSING METHODS DESCRIPTION .................................................................15
4.1 ATTENUATION CORRECTION................................................................................................................................ 16
4.2 VOLUME CORRECTION ....................................................................................................................................... 17
4.3 NOISE CUT-OFF ................................................................................................................................................ 18
4.4 CLUTTER REMOVAL ........................................................................................................................................... 18
4.4.1 Primary Clutter Removal .................................................................................................................... 19
4.4.2 Variance Based Clutter Removal ........................................................................................................ 19
4.4.3 Secondary Clutter Removal ................................................................................................................ 19
4.5 MEDIAN FILTER ................................................................................................................................................ 19
5 CONFIGURATION OF LAWR PARAMETERS..................................................................................................21
5.1 RADAR CONSTANT ............................................................................................................................................ 21
5.2 COUNTS TO DBM CONVERSION ............................................................................................................................ 22
5.3 THRESHOLD EN-ROUTE INTEGRATION .................................................................................................................... 23
5.4 CORRECTION FOR AVERAGING IN LOG SPACE........................................................................................................... 23
5.5 GRASS OVER CLUTTER ........................................................................................................................................ 23
5.6 ATTENUATION CORRECTION PARAMETER C1 AND ALFA ............................................................................................ 23
5.7 NOISE LEVEL CUT-OFF ........................................................................................................................................ 23
5.8 AD CONVERTER MAPPING FACTOR ...................................................................................................................... 24
5.9 ROTATION OF LAWR IMAGE:.............................................................................................................................. 24
5.10 TX DELAY: .................................................................................................................................................. 24
6 GRAPICAL USER INTERFACE (GUI) ..............................................................................................................25
6.1 LAWR GUI – PART I ........................................................................................................................................ 25
6.2 LAWR GUI – PART II ....................................................................................................................................... 27
6.3 LAWR GUI – PART III ...................................................................................................................................... 29
6.4 LAWR GUI – PART IV ...................................................................................................................................... 29
7 OPERATIONAL PROCEDURES ......................................................................................................................32
7.1 UPDATE/GENERATION OF NEW CLUTTER MAPS ....................................................................................................... 32
7.2 RESTART SYSTEM .............................................................................................................................................. 32
7.3 UPDATE LAWR SOFTWARE ................................................................................................................................ 32

v
8 REFERENCES .............................................................................................................................................. 33
9 APPENDIX A-D ........................................................................................................................................... 33
APPENDIX A. LAWR CARTESIAN IMAGE FORMATS ....................................................................................... 34
A.1 ORIENTATION OF THE CARTESIAN IMAGE .......................................................................................................... 35
A.2 CARTESIAN IMAGE FORMAT SPECIFICATION ...................................................................................................... 36
APPENDIX B. LAWR POLAR IMAGE FORMAT ................................................................................................ 38
B.1 POLAR IMAGE FORMAT SPECIFICATION ............................................................................................................ 38
APPENDIX C. CODE EXAMPLES FOR READING LAWR FILES ........................................................................... 39
C.1 FORTRAN CODE FOR READING P00 FILES ..................................................................................................... 39
C.2 MATLAB CODE FOR READING P00 FILES (500X500 METER) ................................................................................... 42
C.3 MATLAB CODE FOR READING L00 FILES .............................................................................................................. 43
C.4 MAKEFILE FOR COMPILING LAWR IMAGE READER (P00) ......................................................................................... 44
C.5 C++ CODE FOR READING LAWR (P00) IN LINUX .................................................................................................... 45
APPENDIX D. DESIGN BACKGROUND ............................................................................................................ 46
10 NOTES: ...................................................................................................................................................... 48

vi
LAWR introduction

1 LAWR INTRODUCTION
The Local Area Weather Radar (LAWR) was developed by DHI in
1999 as a cost-effective tool for providing spatially distributed
rainfall intensities in an area relatively close to the radar. The
range of the radar is typically 60 km (radius) for forecast, if which
only the inner 20 km range should be used for quantitative
precipitation estimation.

This documentation covers the system layout, installation


requirements, signal processing, data processing, data format along
with a review of the GUI (graphical user interface) of the 3rd
generation LAWR.

1.1 System layout


LAWR is based on a standard marine Furuno X-Band radar (FAR-
2127) modified for remote control and two high-end PCs handling
the advanced signal processing and communication to the outside
world.

The layout of the system and the included components is outlined


in Figure 1.1 along with a range of optional add-on modules
(within the dashed frame).

Figure 1.1 Design layout of Local Area Weather Radar system. The elements
contained by the dashed frame are optional add-ons and all require an
internet connection to the LAWR installation

All hardware components used in the LAWR system are standard


components except for the A/D converter which is designed and
developed by DHI. The system uses the raw video signal from the
radar which is being processed by the signal processing PC (DOS
operating system). The reason for using DOS is a high demand for

1
LAWR introduction

speed since every 5 minutes 691 MB of data need to be processed


before being pushed to the Communicator PC (Windows).

A review of the sampling strategy and signal processing is found


in Section 0.

1.2 Technical specifications


The technical specifications of the LAWR are listed in Table 1.1.

Table 1.1 The LAWR specifications. Values are from /1/ and /2/ except the
range, spatial resolution and temporal resolution.
Parameter LAWR City-LAWR
(1525/2127 model) (1834 model)
Peak Power 25 kW 4 kW
Band X-band X-band
Frequency 9.41 GHz ±30MHz 9.41 GHz ±30MHz
Wave length 3.2 cm 3.2 cm
Pulse length 1.2 s 0.8 s
Bin length 180 m 120 m
2.5 m slotted 0.4 m radome
Antenna
waveguide array
Receiver Logarithmic receiver Logarithmic receiver
Vertical opening ± 10 ± 10
angle
Horizontal opening 0.95 4
angle
Samples pr. rotation 360 450
Range 60/20 km 30/15 km
(forecast/QPE)
500x500 m (60 km range) 250x250 m (30 km range)
250x250 m (30 km range) 125x125 m (15 km range)
Spatial resolution
300x300 m (15 km range) 150x150 m (7.5 km range)
100x100 m (15 km range) 50x50 m (7.5 km range)
Temporal resolution 1 or 5 minutes 1 or 5 minutes
Single layer and Single layer and
Scanning strategy
continuous scanning continuous scanning

The Furuno radar is modified by installation of a control board


allowing the processing unit to operate the radar controls. From the
standard slave output connector of the Furuno radar, the Signal
Processor PC collects the "raw" video and directional information.
The same connection holds the cables for remote operation of the
radar.

Local operation of the system is done using a single monitor and


keyboard. The Signal Processor PC, the Communicator PC and the
radar share monitor using a KVM switch box and the two PC’s
share keyboard in the same way.

Remote operation of the system is possible using remote control


software like TeamViewer or similar.

2
LAWR Installation

2 LAWR INSTALLATION
The installation of a LAWR normally takes one day and is carried
out by specially trained DHI staff together with the client.
Construction of potential housing or mast must be completed prior
to the installation and is not included in the installation handled by
DHI.

The LAWR system consists of two units and the necessary cables:
 PC Rack with receiver, two computers, modem etc., cf.
Section 2.1
 Antenna unit with magnetron, cf. Section 2.1

2.1 Antenna Unit


The radar antenna should be installed in such a way that there are
no obstacles interfering with the radar beam from the antenna.
Please see additional information regarding the antenna installation
in the Furuno Operators manual /1/.

The antenna geometry is given in Figure 2.1.

Figure 2.1 LAWR antenna unit geometry /1/. Measurements are in mm.

If possible the radar antenna should be installed on a flat roof for


easy access and installation of a potential clutter fence. In order to
have good working conditions around the antenna it is
recommended to build a small steel structure about 2 m high, as
illustrated in Figure 2.2. This will enable traffic on the roof
without interfering with the radar antenna.

3
LAWR Installation

Figure 2.2 Examples of steel structures for mounting the antenna unit.

NOTE: There must be a ground connection on the roof for the


antenna unit!

2.1.1 Magnetron

The signal is generated by a magnetron, which is recommended


replaced every 6 months. The magnetron is located in the antenna
unit and shown in Figure 2.3.

Figure 2.3 Magnetron location in the transceiver.

2.1.2 Clutter Fence (optional)

In some cases the effects of ground clutter can be reduced by


installing a mechanical clutter fence deflecting the lower 10° part
of the beam as illustrated in Figure 2.4. An example of such clutter
fence can see in Figure 2.5.

4
LAWR Installation

Figure 2.4 Principle of clutter fence.

Figure 2.5 Example of installed clutter fence at the Hvidovre LAWR in Denmark.

The clutter fence is made from stainless steel and is custom made
for each installation. The poles for mounting the net, as seen in
Figure 2.5, are normally glued onto the roof, so that the roof is
kept intact and no drilling is required. The clutter fence requires a
flat roof and minimum 3 meter free space around the radar
installation.

2.2 PC Rack
The transceiver, screen, keyboard and the two PC’s are all
mounted in a 19” rack as illustrated in Figure 2.6. The rack must
be installed in a room suitable for PC operation and with 230 VAC
power and preferably network/phone line. The temperature
environment for the rack must be kept in the range +10° C to +35°

5
LAWR Installation

C. From this room the system is connected to the antenna. The


distance cannot exceed 100 meters, but 30 meters is standard.

Figure 2.6 Example of rack containing the LAWR system except the antenna
unit.

The rack contains two PC’s: Signal Processor PC and


Communicatior PC

2.2.1 Signal Processor PC (DOS) configuration

The Operating system for this computer is DOS 6.0. The machine
is setup using a ghost image that includes all files needed for the
operating system, the files needed to run the radar program and the
network card driver.

The PC must be configured with following:

Names:
Computer name: Radar-S
Password: radar
Workgroup: RADARGR
Domain: RADAR

Protocols:
Internet Protocol TCP/IP
NWLink IPX/SPX/NetBIOS Compatible Transport Protocol

Network:
Ip: 192.168.1.2
Mac: 255.255.255.0

6
LAWR Installation

Disable DHCP

2.2.2 Communicator PC (Windows) configuration

This computer operates Windows XP Professional. The disk is


divided into two partitions:
 C: 10 GB (NTFS)
 D: Remaining space (NTFS)

The PC must be configured with following:

Names:
Computer name: radar-c
Workgroup: RADARGR
Domain: RADAR

Users:
 User 1:
o Name: radar
o Password: radar
o Group: Administrators
 User 2:
o Name: radarftp
o Password: radarFTP
o Group: ADMIN

Protocols:
 Internet Protocol TCP/IP
 NWLink IPX/SPX/NetBIOS Compatible Transport
Protocol

Network:
 Ip: 192.168.1.3
 Mac:255.255.255.0
 Disable DHCP

Other required Windows settings:


 Language: English UK
 Decimal separator: dot
 Short Date: yyyy-mm-dd
 C-drive must be shared
 Enable time synchronization to time.windows.com or other
time server available.
 Disable automatic installation of Windows updates.
Updates should be installed manually under supervision
since they can affect above settings.

7
LAWR Installation

A shortcut must be added to the desktop pointing to the radar


system program file (RadarCtrl2.exe). In properties for this
shortcut the following string must be added last in the target line:
“2 D” as shown in Figure 2.7. The numeral “2” specifies the
number of the com port used to control the other PC and “D” is the
location where data is to be written, in this case the root folder of
drive “D:\”.

Figure 2.7 Screen dump of the property of the program shortcut.

It is recommended to compress the RadarArchive folder in order to


maximize the disk space available. To enable the compression:
right click on the RadarArchive folder, select Properties, select
Advanced and tick the “Compress contents to save disk space”
option as illustrated in Figure 2.8. When the folder is compressed
the folder name and the files within will be written in blue. The
compression has no effect on the stored data.

8
LAWR Installation

Figure 2.8 Screen dump of the advanced dialog of the folder property which
needs to be accessed to compress the radar archive folder.

2.2.3 Cable Connections

Following cable connections are used and are provided by DHI as


part of the installation:

1. Antenna to Furuno transceiver: Black shielded connector


length 15/30 m. Connection to antenna is done by DHI.
Connects to the Furuno transceiver with a plug.
2. Antenna to Ground. At the antenna there must be a ground
connection. The ground wire is approximately 30 cm long
3. 19" Rack to power outlet: Approximately 1.5 m, installed
by DHI.
4. Connection to Internet (RJ45)
5. Connection to phone line (option) standard RJ11 phone
line connector, 2 m.

2.3 Configuration of software prior to start up


Upon first power up the radar need to be configured for the
location.

 Provide the radar with the chosen prefix of four letters:


 File menu  Define radar name and the 20 character
radar description.
 Restart the control program to make the configuration
active
 Adjust parameters in radar.cfg if other values than default
parameters are to be used
 Generate new primary and secondary Clutter Map, cf.
Section 7.1

9
LAWR Installation

 Adjust the Cut off factors and Clutter Scaling if required


(in the GUI)

10
LAWR software

3 LAWR SOFTWARE
There are two main software components handling the LAWR
operation.
 RadarPol
 RadarCtrl2

Signal Processor
Communicator PC
PC

RadarPol.exe RadarCtrl2.exe

AutoExec.Bat Doit.bat

Figure 3.1 Software on a LAWR installation. The files required by the system are
listed in Table 3.1 (marked with *)

There are two bat files that on start up or re-boot starts the software components
in the right order with parameters as outlined in Figure 3.2 and the
content of the referred files are given below in Table 3.1.

Figure 3.2 Overview of the LAWR software and the file generation processes. In
the DOIT.BAT file there are two commands deleting scanner.rbt and
reload.sys – if these file are present the scanner is either reloaded or
rebooted.

11
LAWR software

The Signal Processor PC runs MS-DOS version 6. The two PCs


are linked together using network connection. The client on the
DOS PC is Microsoft Network Client 3.0 and the network is
started automatically by the autoexec.bat file. The autoexec.bat
mounts the C: drive from the Communicator PC as the D: drive on
the Signal Processor PC. Next autoexe.bat calls DOIT.BAT
located on Communicator PC’s C: drive in directory
C:\RADARDAT.

DOIT.BAT copies the latest version of the scanner software


(radarpol.exe) from “C:\radardos” (on the Communicator PC),
and invokes it. The scanner software is a protected mode program
controlling the AD converter and generating the polar radar image.
The program also pushes the data to “C:\radardat” (on the
Communicator PC). The “C:\radardat” index must exist.
As the Signal PC mounts a drive from the Communicator, the
Communicator must be up and running before the Signal PC can
complete its boot. Furthermore, the Furuno radar must be running
(not only in standby) since the scanner software test scans when
installing.

Normally, the two PCs are powered up simultaneously. Upon


completion of the boot sequence the Communicator PC launches
the program RadarCtrl2.exe. This program will:
1. Power on the radar
2. Wait for 3 minutes
3. Start the radar
4. Reset the Signal Processor PC.

3.1 LAWR system files


The files marked with an asterisk (*) in Table 3.1 must be present
in order for the LAWR to operate – the rest of the files are
automatically generated.

Table 3.1 LAWR files and their content. XXXX is the radar name which is
assigned through the user interface. XXX(X) indicates that there are
multiple files each in a different resolution. The last letter in the
brackets is substituted with the corresponding number.* indicates
required system files all other files are automatically generated.

File name Folder File Content


Scanner
autoexe.bat* Standard startup file for DOS
PC
Bat file (DOS) scheduling the tasks. The program
reads the radar.cfg file and creates the config.txt
where the parameters used by the radarpol.exe
DOIT.BAT* RadarDat
program read from the radar.cfg file is stored. It
furthermore synchronizes the Scanner PC clock to
match that of the Communicator PC.
Provides control options of the LAWR system by a
RadarCtrl2.exe* RadarDos
GUI
radarpol.exe* RadarDos Scanner program

12
LAWR software

Configuration parameters used by the scanner


Radar.cfg RadarDat
software radarpol.exe
Texts file with signal processing parameters is
config.txt* RadarDat copied from the Communicator PC to the Signal
Processor PC by the autoexe.bat file at startup.
Automatically created logfile. Manual additions can
LAWRLOGFILE.txt* RadarDat be made by opening the file in the folder and writing
in it.
magnetron.cht RadarDat Binary file of the magnetron condition
Background image. BMP file must have a resolution
chart.bmp* RadarDat of 240x240 pixels. The sub-resolutions are created
automatically
Text file with RGB values defining a custom colour
color.pal RadarDat palette. If the file is missing the default blue colour
scheme is applied.
Primary clutter map in polar coordinates of the whole
clutter.map RadarDat
image.
Secondary clutter map in Cartesian coordinates of
XXX(X).map RadarDat the whole image. (240x240 pixels, 60 km radius, 500
m grid)
Secondary clutter map in Cartesian coordinates of
XXX(X).x00 RadarDat the other resolution’s image. Is the XX(X).r00 file
subtracted the clutter map.
bmp image of the last image overlaid the chart.bmp
XXX(X).bmp RadarDat
(background). One file for each selected resolution.
bmp image of 240 by 240 pixel, 60 km radius, 500 m
XXXXX.bmp RadarDat
grid, no background (extra X in prefix)
jpeg image of 240 x240 pixels, 60 km radius, 500 m
XXXXS.jpg: RadarDat
grid in 480x480 pixel (extra S in prefix)
bmp image of 240x240 pixels, 60 km radius, 500 m
XXXXS.bmp: RadarDat
grid in 480 x480 pixel (extra S in prefix)
Temporary file of the raw data in the Cartesian
DAT(A).r00 RadarDat
coordinates
Standard output format. A binary file with the
Cartesian data and one file for each resolution.
- XXXX.p00, 240x240 pixels each pixel is 500x500
m,
- XXX1.p00, 240x240 pixels each pixel is 250x250
m,
XXX(X).p00 RadarDat
- XXX2.p00, 100x100 pixels each pixel is 300x300
m,
- XXX3.p00, 300x300 pixels each pixels is100x100
m.
Data format description for file reading can be found
in Appendix A.
Binary file with the polar data. Data format
XXXX.L00 RadarDat description for file reading can be found in Appendix
A.
Binary file with the variance in polar coordinates.
XXXX.V00 RadarDat Data format description for file reading can be found
in Appendix A.
Variance file in polar coordinates. All files from the
DATV.V00 RadarDat Scanner PC are named DATA or DATV and are
renamed during the signal processing.

3.1.1 Folder Structure for LAWR files

The software used by the LAWR and the generated data files are
located in the folder structure outlined in Figure 3.3.

13
LAWR software

Figure 3.3 Folder structure on the Figure 3.4 Data storage


Communicator PC. The RadarArchive structure within the
folder is blue because it has been
RadarArchive folder
applied compression settings
(recommended, cf. Figure 2.8).

The folders contain:


• HourImage: Data files from the last hour – is continuously
being updated (contains XXX(X).p00 and XXXX.V00 files)
• RadarArchive: All data files older than one hour. The
structure is automatically created and has a folder for each year
(yyyy), which contains a folder for each month (mm), which
again contains a folder for each day (dd) as shown in Figure
3.4.
• radardat: Holds latest image in all resolutions, cluttermaps
and configuration files. The folder is used to store temporary
data during processing.
• radardos: The RadarCtrl2.exe program which operates the
radar and provides user access to a number of features. The
GUI is described in Section 0. The chart.bmp (background
image file) must be stored in the same folder as
RadarCtrl2.exe.

14
Signal sampling and processing Methods Description

4 SIGNAL SAMPLING AND PROCESSING METHODS


DESCRIPTION
The main output signal from the radar transceiver is the video
signal. This signal represents the received power along a scanline,
that is, a line with given azimuth and elevation. The azimuth is
given by 360 directions in the models FR-1525 and FAR-2127.
The LAWR is a single layer radar and therefore the elevation is 0.

The AD converter samples with a frequency of 20 MHz resulting


in 8000 samples in each scan-line. The AD converter converts the
analogue signal (ranging from 0 to -9 V) to a 10 bit digital signal
with a value range of 0-1024. These values are stored in the polar
data files (*.L00). As part of the signal processing the polar data
are resampled to Cartesian data files (*.P00) with an 8 bit
resolution with a value range of 0-254.

The spatial footprint of the LAWR also called bin or gate is


depending on the pulse length. The radial bin size can be estimated
as:

Bin Length= (Pulse Length [μs] ∙ Speed of Light [m/s])/2 (4.1)

A pulse length of 1.2 μs corresponds to a bin length of 180 m (the


factor of 2 in the denominator is due to the pulse travelling both
out and back). For each bin the value and the variance are
estimated on basis of 16 pulses.
The primary part of the signal processing is handled by the Signal
Processor PC, where the digitalized voltage signal (raw video
signal) is processed into reflectivity values.

During the signal processing a number of schemes is applied to the


data in order to handle well-known radar obstacles, like clutter and
attenuation. The signal processing is outlined in Figure 4.1. The
major processes will be reviewed in detail in this chapter.

15
Signal sampling and processing Methods Description

Figure 4.1 Flow chart of LAWR signal processing. * indicates an optional process
which can be toggled on or off by the user via the GUI

4.1 Attenuation Correction


Any radar will be subject to attenuation since electromagnetic
radiation passing through a medium will be reduced. The
attenuation depends on frequency, wavelength and the medium
travelled through. The LAWR being an X-band radar is subject to
attenuation by rainfall as result of the wavelength. In order to
correct for the loss of energy as result of attenuation the Scanner
program applies an attenuation correction to each scan-line. The
attenuation correction is as follows:

 r 1

  Z i 
Z r = Z g,r 1  i 0 
 C1  n samples 
 
 
where:
Zr: Adjusted reflectivity value at range r
Zg,r: Uncorrected reflectivity at range r
nsamples: Number of samples in a single scan line, typical
value is 8000
α, C1: Empirical constants where typical values are 1.5 and
200, respectively

The α and C1 can be adjusted in the radar.cfg file in the C:\radardat


folder. The attenuation correction must not change the properties
of the rain event when observed from both sides as shown in
Figure 4.2. If too much correction is applied the rainfall intensities
will be over-enhanced with increasing range from the radar and
vice versa in case of inadequate correction.

16
Signal sampling and processing Methods Description

Figure 4.2 Illustration of LAWR attenuation correction principle. The cloud


symbolizes a rainfall event observed at two different time steps -
before and after passing over the radar.

4.2 Volume Correction


The relatively large vertical opening angle of 10° results in a rapid
increasing beam volume with range as illustrated in Figure 4.3.
The consequence of this is that a small number of drops in the
sample volume at very close range, where the beam volume is very
small, are most often observed, while the same number of drops at
further ranges will result in a value below the cut-off as result of
the integration over a larger volume.

Figure 4.3 Illustration of the beam filling issue which is handled by the volume
correction.

17
Signal sampling and processing Methods Description

The volume correction is handled using the Radar equation:

2 ( ) (4.2)

Where Cradar=10*log10(cradar) and Pr is received power in dBm.


Cradar is defined in Section 5.1.

Figure 4.4 The volume correction corresponds to 2 ( )

4.3 Noise cut-off


There are two parameters for adjusting the noise cut-off level, both
are given in the radar.cfg file. The Grass parameter should be
adjusted to remove the majority (~2/3) of noise in a dry weather
image, while the Cut-Off-Min should remove the remaining. The
effect can be seen by reloading the scanner (GUI) and wait for 10
minutes and then inspect the raw image (GUI).

Figure 4.5 Illustration of the Grass and Cut Off Min parameters. A single scan
line is shown. Red is Cut-Off-Min and blue is Grass

4.4 Clutter Removal


Clutter is echoes in the radar images not originating from
precipitation. In order to reduce the effects of clutter, the LAWR
system has been equipped with three clutter removing schemes:
Primary (polar data), Variance based (polar data) and Secondary

18
Signal sampling and processing Methods Description

clutter removal (Cartesian data). The order of the processes can be


found in Figure 3.2.

4.4.1 Primary Clutter Removal

The primary clutter removal is carried out by the Scanner program


on the Signal Processor PC using the "Primary clutter map" file.
This map is a polar image of the dry-weather echoes observed by
the LAWR. When a scan cycle has been completed, the clutter is
subtracted from the collected image. The process is carried out en-
route on each scan line and the process is outlined in Figure 4.6.

Figure 4.6 Principle of clutter map subtraction for a single scan line.

4.4.2 Variance Based Clutter Removal

The variance based clutter removal is handled by the RadarCtrl2


program. The Scanner program generates a "variance" image
concurrently with the normal image.

The variance of the raw signal changes dramatically when it starts


to rain and the variance in the signal from areas with rain is quite
higher that variance from areas with no rain. This is used to
remove artifacts (over enhancement) from the attenuation and
volume correction processes. The variance based clutter removal is
optional and can be toggled on/off in the GUI.

4.4.3 Secondary Clutter Removal

The secondary clutter removal is handled by the RadarCtrl2


program. This process is similar to the primary clutter removal
process except that it operates on the images re-sampled into
Cartesian coordinates (rectangular grid). During dry weather an
image is stored as a mask (same file format as the *.p00 files).
This mask is then subtracted from each scanned image. Input file
for this process is XXX(X).r00, output file is XXX(X).X00

4.5 Median Filter


The RadarCtrl2 program applies a median filter of the binary
image for use in the forecast. The median filter is used to remove
residual clutter, i.e. all pixel values are replaced by the median of

19
Signal sampling and processing Methods Description

its neighbors within 3x3 pixels. A median filter is one of the better
edge preserving smoothing filters and it has proved sufficient in
most cases.

One effect of the median filter is that nearly all - single or


diagonally adjoining pixels having an echo are removed and reset
with a value of zero. The result is a significantly more stable
velocity field estimate.

20
Configuration of LAWR Parameters

5 CONFIGURATION OF LAWR PARAMETERS


The LAWR signal processing configuration is handled by 11
parameters defined in the radar.cfg file located in
“C:\radardat” folder on the Communicator PC. The parameters are
updated by changing this file, saving it and reload/restart the
Signal Processor PC (scanner). The parameters in the radar.cfg file
are read in the order shown in Figure 5.1 and explained in the
following sections and when relevant default values are provided.

Figure 5.1 Example of LAWR configuration file – the radar.cfg file.

5.1 Radar constant


The radar constant C for the LAWR (Furuno FAR-2127) can be
calculated from the radar equation /5/. The first term describes the
characteristics of the radar with regard to wavelength, pulse length,
antenna and transmitted power. The second term describes the
antenna gain and the third term describes losses in the radar system
(for example attenuation, radome, cable). The 2.69 1020 constant
accounts for conversion of the various units (degree to radian and
similar) and the complex refraction index |K2|.

[ ] og (2 ∙ ) 2

For the FAR-2127 the parameters are:


Gain: 32 dB
ɸ: 0.95
Ɵ: 10
Λ: 0.032 m
Pt: 12.5 kW
: 1.2 (sec)
L: unknown – assumed 1 dB

21
Configuration of LAWR Parameters

With clutter fence (10 opening) this leads to a C = 89.9 dB


without clutter fence (20 opening) C=83.8 dB.

The equation for estimating the radar constant assumes a circular


antenna and no significant losses in the signal while it travels in
the atmosphere - neither is the case in reality. Research on the
LAWR has proven that the loss is in the order of 10 dB and by
adjusting the radar constant accordingly to 77 dB light rainfall is
acceptable observed.

Default value: 77 dB.

5.2 Counts to dBm conversion


The two parameters describe the mapping from counts to dBm.
The constants are unique to each radar. The constants shown here
are derived from the first calibration are delivered by DHI.

Receiver Sensitivity RF Vs. A/D


900
A/D Converter value

y = 9.972x + 982.15
700 R² = 0.9998

500

300

100
-90 -70 -50 -30 -10 10
RF Signal (dBm)

Figure 5.2, Calibration curve (FAR2127)

Since the constants compensates for energy losses in the entire


receiving system, any change in these components should be
followed by a calibration.

Default values: should only be used if no calibration is available


 FAR-2127:
o dbm = 0.10028 * counts -98.49
 FR-1525:
o dbm := 0.1194 * counts -114.27

22
Configuration of LAWR Parameters

5.3 Threshold en-route integration


This value controls the threshold for rain rate to be included in
attenuation calculation. Use the calibration curve to get the A/D
converter value corresponding to the desired dBm.

Default value: 100

5.4 Correction for averaging in log space


General correction factor added to the radar constant. May be used
to compensate for local conditions. Typical literature value range
0.1 - 2.4 db /4/.

Default value: 1

5.5 Grass over clutter


This constant is added to the dry weather clutter image. Due to
atmospheric condition, the clutter echo varies a littele. The
constant helps reducing unwanted dry-weather echo. Value range:
0-10.

Default value: 1

5.6 Attenuation Correction parameter C1 and alfa


Please see Section 4.1 explanation of the attenuation correction.

C1 parameter value range: 600-900 and alfa parameter value


range: 1.5-3.0

Default C1 value: 800

Default alfa value: 1

5.7 Noise level cut-off


The cut-off min is the minimum power level the radar receiver can
detect given in dBm. If set too low, noise will appear in the image
and the general level will be pulled down.

Default value: -85 dBm

23
Configuration of LAWR Parameters

5.8 AD Converter Mapping Factor


Maximum value from A/D converter. Depends on the A/D
converter installed. At present all radars uses the DHI A/D
converter (1023).

Default value: 1024

5.9 Rotation of LAWR image:


Rotation of the image in degrees, where positive is clockwise from
due North. In case of disagreement with clutter echoes and the
physical location of clutter the LAWR must be adjusted by this
parameter in order that they match.

Default value: 0

5.10 TX delay:
In cases of a cable exceeding 15 meters there is a delay in the
signal which is adjusted by this factor. If there is a blank circle in
the vicinity of the radar (inner ~120 m) this factor needs to be
applied.

Default value: 0

24
Grapical USer interface (GUI)

6 GRAPICAL USER INTERFACE (GUI)


The GUI for the LAWR system is integrated in the RadarCtrl2
program and is shown in Figure 6.1.

Figure 6.1 LAWR GUI ver 10.1

In the top left area there are three options: File, Option and About:
 File: exit – close the program
 Option:
o Reset Magnetron statistics: clear the file and
thereby
the graph in GUI – Part IV.
o Define radar name: The four letter name described
in
Section 2.3.
o Zero Clutter Maps: clearing of existing clutter maps
– either primary, secondary or all cf. Section 4.4.
 About: Information on software version

The rest of the LAWR GUI is reviewed in the following sections.

6.1 LAWR GUI – Part I


During start-up a button with “Cancel Start up” is active which can
be used in connection with a restart of the RadarCtrl2 software to
avoid the Signal Processor PC to reboot. If the system detects a
*.pal file (user palette – see Table 3.1) a button marked “Ignore
User Palette” is active. By pressing it the standard blue palette
becomes active.

25
Grapical USer interface (GUI)

Figure 6.2 LAWR GUI with image panels and control buttons.

The four tabs at the top enable graphical view of different data:
 Processes image: The final Cartesian image
 Clutter map: Secondary clutter map of the 500x500 meter
resolution
 Raw Image: Raw polar data without clutter filter
 Primary clutter map: Primary clutter map in polar
coordinates
 Velocity: Cross correlation velocities calculated between
the two last images when Do Forecast is checked

Below the images the distribution of the values are shown as a


histogram.

To the right of the panel a number of control buttons are located:

 Read Image: (Re-)reads the last image the Signal Processor


PC has pushed to the Communicator PC. This activates the
processing that is automatically performed for every image
at minutes 01, 06, 11, …, 56
 Restart Scanner: Resets the Signal Processor PC (forcing it
to re-boot and reload setting from the Communicator
PC)
 Reload Scanner: Forces the Scanner program to restart
after current scan cycle is completed and re-read the
configuration files on the Communicator PC. The time of
the Signal Processor PC is synchronized to match the
Communicator PC’s clock

26
Grapical USer interface (GUI)

 New primary cluttermap: Generates a new primary


cluttermap (use only in complete dry weather!). The
current primary cluttermap can be seen on the tab marked
"Primary cluttermap"
 Cutoff: Lowest value (dBZ) shown in no-rain situation –
Has no effect on the data - only used for the web images
and the processed image in the GUI. Typical values are 8-
16 – must be higher than Cutoff-low.
 Cutoff-low: Lowest value (dBZ) shown in rain situation.
The transient is based on (Cutoff – AverageImage) until
CutOff-Low is reached. Has no effect on the data - only
used for the web images and the processed image in the
GUI. Typical values are 2-8 often around half of Cutoff.

The cut-off values are adjusted until no noise is evident in the


processed image – to update the image with the new cut-off value
– press Read Image button.
 STC length: Sets the Signal Time Correction. Linear
suppression of signal for this number of bins. The bin at
STC is suppressed 1/STC, the next 2/STC and so on.
 Do Forecast: Activate the build in cross-correlation
forecaster.
 Sync time scanner: Instructs the scanner PC to synchronise
its clock against the Communicator PC clock when the next
scan starts.

6.2 LAWR GUI – Part II

Figure 6.3 LAWR GUI – Part II

27
Grapical USer interface (GUI)

The top part is used to control what images are stored in the data
archive and to toggle on/off the Median filter, cf. Section 4.5. The
HourImage folder always holds all files for the last hour.

The Radar Control Block in Figure 6.3:


 Stand By TX: Starts or stops the radar scanning
 Start: Power on the Furuno radar
 Stop: Power off the Furuno radar

The “Watch Status and Control” gives information on the system


state – when all three are green everything is running.
 Health Watch Active: (Re-)Starts the system automatically
if the last image is older than 40 minutes. When manually
operating the radar Health watch active MUST BE IN OFF
MODE to prevent it from turning on the radar
automatically.

The lower part of GUI – Part II:


 Bang suppression: Apply clutter mark at a circle around the
radar. The unit is bins. 1 Bin = 120 m from the radar (in
centre of image).
 Clutter map scaling: Both clutter maps are multiplied by
this factor. It is used to reduce the effect of temperature
dependant clutter.
 Use variance clutter removal: Enables/disables the
variance clutter filter, cf. Section 4.4.2 with a user defined
threshold value.
 Signal scaling: Read only. Informs that the dBZ value in
the p00 files have been scaled by a factor of 4.
 Interpolation: All image values having a clutter value
higher than the Ok-level are replaced by the neighbouring
cell having a clutter value less than Ok-level. All four
directions are used one by one.
 Secondary clutter map: Creates a new secondary clutter
map, cf. 4.4.2. Use it only on dry days with no precipitation
shown on the image.

28
Grapical USer interface (GUI)

6.3 LAWR GUI – Part III

Figure 6.4 LAWR GUI – Part III

The five tabs in this block hold:


 Event Log: History of changes, startup, new clutter maps
and so forth. Manual additions can be added by the user by
writing in the file located in C:\radardat – not by typing in
the Event Log tab in the GUI.
 Sub image 1-3: These three tabs holds the p00 images of
the additional output images – equal to the Processed
image tab on the left.
 Variance: Variance image. High variance value (dark blue)
is normally associated with rain while lower values is no
rain areas.

6.4 LAWR GUI – Part IV


Consist of six tabs: Scanline, Magnetron, Volume Correction, Raw
scanline, Forecast and Rainfall Height:
 Scanline: plots the signal as function of range for a user
defined scanline (azimuth). The scanline is identified by
the angular value. The last 5 scanlines are shown.

29
Grapical USer interface (GUI)

Figure 6.5 LAWR GUI – PART IV: Scanline tab


 Magnetron: The average value of the signal over the whole
area (V) is plotted as function of time. High values are
indication of periods with rain and periods with low values
are dry periods. The magnetron condition is an expression
of the power level of the magnetron and is advised
monitored since it can be used to detect at poor,
malfunctioning or worn out magnetron which must be
replaced.

Figure 6.6 LAWR GUI – PART IV: Magnetron tab

 Volume Correction: Plots the volume correction factor as


function of range based on the values given in the
configuration file (radar.cfg).
 Raw scanline: Switches at next image to scope mode where
the raw scan lines are displayed. Used for calibration and
diagnostic purposes. The normal operation is suspended
when this tab is visible. A build-in facility automatically
switches back to normal operation after 15 minutes, if no
curser activity has been detected on this tab.
 Forecast: Activates the build-in cross-correlation
forecaster. The results of the forecast is stored in p00
format, as *.f(XX) files (for example *.f05, *.f10 and
*.f55).
 Rainfall Height: Computes the top of the rainfall in the
vertical extent.

30
Grapical USer interface (GUI)

Figure 6.7 LAWR GUI – Part IV: Rainfall Heigth

31
Operational procedures

7 OPERATIONAL PROCEDURES
In the following are the most frequent operational tasks described.
In case of system errors or error messages please restart the system
before contacting DHI for further support.

7.1 Update/Generation of new clutter maps


Generation of new primary and secondary clutter maps is done in
the LAWR GUI. The process of making a complete new set clutter
maps is:
1. Select “Option”  “Zero Clutter Maps”  “All”
2. Press: “Restart Scanner” to generate images without clutter
map
3. Wait +5 minutes to full image cycle is completed
4. Press: “New Primary Clutter Map”, see Section 6.1
5. Press: “Reload Scanner”, see Section 6.1
6. Wait +10 minutes
7. Press: “Secondary Clutter Map - New Map”, see Section 6.2
8. Wait 10 minutes
9. Press: “Read Image” to view the result in the “Processed
image” tab

7.2 Restart System


1. Close RadarCtrl2 program
2. Restart Windows PC normally
3. Wait min 5 minutes and check data is updated

7.3 Update LAWR software


Close down the RadarCtrl2 program. Replace RadarPol.exe and
RadarCtrl2.exe with the new versions. Restart Communicator PC.
If required adjust configuration parameters in radar.cfg file.

Create new clutter maps as outlined in Section 7.1.

32
References

8 REFERENCES
/1/ Furuno: Furuno’s Operators Manual Marine Radar/ARPA, FAR-28x7 Series,
Model FAR-21x7 (-BB)Series, Jan 2009, www.furuno.co.jp
/2/ Furuno: Furuno’s Specifications of NavNet vx2, www.furuno.co.jp
/3/ Battan, L. J. Radar Observations of the atmosphere, The University of Chicago
Press, 1973
/4/ Marshall, J. S. and W. Hitschfeld, Interpretation of the fluctuating echo from
randomly distributed scatterers. Can. J. Phys., 31, 962–994. 1953
/5/ Rinehart, R., Radar for meteorologist, 4th Edition, Rinehart publishing. 2004

9 APPENDIX A-D

33
Appendix A-D

APPENDIX A. LAWR CARTESIAN IMAGE FORMATS


The P00 image format that we use was originally designed by
Ericsson with the purpose of storing radar images. In order to
make the image files as small as possible on the HDD and in
RAM, values are stored as Bytes, that is, integers [0; 255].

The designers realized that integer values in the range [0; 255]
were different from the value range of radars. To remedy this, they
decided to include a rule for conversion from the byte range to the
“physical value range” in the format specification. They chose a
formula that scales the byte values linearly. Values above 253
must be discarded (set to zero).

When reading from the image the following formula is used:

Physical value = (byte value – offset) * slope + ordinal

When writing to the image the following formula is used:

Byte value = (Physical value – ordinal) / slope + offset

The conversion factors are specified in the header of each image.

As user of the format we are free to choose what “physical value


range” we want to cover with the images by setting the conversion
parameters in the header of the images, and use the formulas above
for read and write operations.

The LAWR radar produces values in the range from 0 to 64 dBZ,


it has thus been decided that a slope = 0.25 is be the best choice,
and no offsets are needed, which means, ordinal = 0 and offset = 0.

34
Appendix A-D

A.1 Orientation of the Cartesian Image


The LAWR files (p00) are not coordinate based, but based on
numbered cells in a rectangular grid with origin in upper left
corner as illustrated in Figure 9.1. The system is 1-based and the
radar is located in the intersection of 120,121 / 120,121.

IMPORTANT: The LAWR notation is column (i), rows (j).

Figure 9.1 Orientation of Cartesian LAWR data

35
Appendix A-D

A.2 Cartesian Image Format Specification


The total length of the header is 99 Bytes. The total length of the
image data (without header) depends on the resolution of the
image as specified in the header parameters East_uppb and
North_uppb, and can be computed as: East_uppb * North_uppb

All integer and real values in ASCII format are left padded with
blanks, whereas strings are right padded with blanks.

Please note the following relation is used for reading


Physical quantity = (Byte – Store_offset)*Store_slope + Store_ord

Offset Type Format Length Name Content


0-based

0 Char Ascii 1 Signal 'X' mark a radar image


1 Integer Binary 3 Tot_bytes Total number of bytes in file. First Byte is the most
important (Big Endian).
4 Integer Binary 3 Trailer_offset Offset in file of a trailer. Zero means no trailer. First
Byte is the most important.
Currently not in use.
7 Integer Binary 2 Trailer_size Number of Bytes in the trailer. Zero means no
trailer. First Byte is the most important.
Currently not in use.
9 Char Ascii 1 Img_type Nature of image. 'O' = Observed
'P' = Predicted / forecasted
10 Integer Ascii 3 Mm_predict Time in minutes to add to the time of observation to
get the prediction time in minutes (zero if Img_type
is not P)
13 Integer Ascii 4 Pixel_size Pixel size Xxxx (X km and xxx meter)
17 Integer Ascii 14 Date_time Date and time of reception of data
(YYYYMMDDHHMMSS)
31 String Ascii 20 Rad_name Name of radar
51 Integer Ascii 3 East_uppb Number of elements = max index in east direction
of picture
54 Integer Ascii 3 North_uppb Number of elements = max index in north direction
of picture
57 Integer Ascii 3 Hei_uppb Max index in height direction. Used when multiple
images are saved in one file.
Currently not in use (always 0)
60 Real Ascii 4 Store_slope Factor for conversion to physical value (X.xx)
64 Real Ascii 6 Store_ord Offset for conversion to physical value ( XX.xx)
Value is in “Physical quantity” units
70 Real Ascii 6 Store_offset Offset for conversion to physical value ( XX.xx)
Value is in Byte units
76 String Ascii 8 Store_quant Physical quantity
84 Real Ascii 14 Geo_coord Geographical coordinates. Long/Lat of centre of
image: EEE.mmmNNN.mmm =E m' N m'
Currently not in use due to poor precision.
98 Byte Binary 1 Spare Spare byte
Currently not in use (always 0).
99 … Integer Binary X*Y Pixel Values Byte values (0-255)

36
Appendix A-D

37
Appendix A-D

APPENDIX B. LAWR POLAR IMAGE FORMAT


The polar format is a proprietary format designed by DHI.

B.1 Polar Image Format Specification

Offset Type Length Name Content


0-
based

0 Integer *2 1034 Header Comma separated header with the content listed
(Ascii interpretation) below in
1034 Integer*2 1034*records Data Reflectivity values. Record length depends on radar
(Ascii interpretation) type (360 for LAWR and 450 for City-LAWR)

Table B.1 Content of header. The string is comma separated

Position Name Content

1 Configuration Date, time and information on program version and compilation date. The date and time must be
extracted from the first substring – underlined part in example: “Ú20200902280000
Configuration: Version 7.2.0 /DHI/NEJ 04-03-20085 min”. Date format is yyyymmddHHMM
(2) Time Step Temporal resolution (5 or 1 minute). The comma is missing and this value is therefore part of the
first substring shown above – the temporal value is marked with bold.
2 Range Maximum range in km
3 Used Range Used maximum range in km (60 km for LAWR and 30 km for City-LAWR)
4 Samples Number of samples in each scanline (8000 for LAWR and 4000 for City-LAWR)
5 Records Number of rotations equal the number of scanlines (360 for LAWR and 450 for City-LAWR)
6 Bin Length Length of the bin in samples (16 for LAWR and 4 for City-LAWR)
7 C2 parameter C2 parameter of the Volume Correction (eq. 5.2)
8 C3 parameter C3 parameter of the Volume Correction (eq. 5.2)
9 Max Correction Maximum volume correction value to be applied
10 Grass Noise cut off
11 C1 parameter C1 parameter of the Attenuation Correction (eq. 5.1)
12 α parameter α parameter of the Attenuation Correction (eq. 5.1)
13 Cut off min Cut off min
14 Mapping AD converter mapping factor
15 Rotation Rotation of the LAWR in degrees. Specified clockwise from due North.
TriggOfs TX delay parameter. If no Tx Delay parameter is given in the radar.cfg file no entry is written in
16
the header

38
Appendix A-D

APPENDIX C. CODE EXAMPLES FOR READING LAWR FILES


C.1 FORTRAN CODE FOR READING P00 FILES

program main
C*************************************************************************
C Demonstration Intel FORTRAN 77 program for reading LAWR radar images
C NEJ/DHI 2004
C*************************************************************************

implicit none

c Variables
Integer Delta
Integer IY,IM,ID,IH,IN
character*20 Rad_name
Integer East_uuppb
Integer north_uppb
character*255 Filename
c the size of RImage must minimum match the size of the biggest image: 300*3000 -1 = 89999
c If you only uses 240X240 the size is min: (0:57599)
character*1 RImage(0:89999)

Integer i,j,idum
c Function
Integer GetValue

Filename="C:\RadarData\Genoa\2004\03\30\AMGA0030.p00"
call ReadRadarImage240X240(66,Filename,
& Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb,RImage)
write(*,*)Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb
write(*,*) GetValue(10,109,RImage,East_uuppb)

Filename="C:\RadarData\Genoa\2004\03\30\AMG20030.p00"
call ReadRadarImage100X100(66,Filename,
& Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb,RImage)
write(*,*)Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb
write(*,*) GetValue(30,54,RImage,East_uuppb)
end

C*************************************************************************
C This routine reads the standard 240 by 240 image XXXX.P00 DX = 500 m
C*************************************************************************
subroutine ReadRadarImage240X240(IU,Filename,
& Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb,RImage)

39
Appendix A-D

character*13 SpareBytes
Integer Delta
Integer IY,IM,ID,IH,IN
character*20 Rad_name
Integer East_uuppb
Integer north_uppb
character*3 hei_uppb
character*4 store_slope
character*6 store_ord
character*6 store_offset
character*8 store_quant
character*14 geo_coord
character*1 Filler
character*255 Filename
character*1 RImage(0:57599)
integer cxmax,cymax
Integer IU
open (IU,file=trim(Filename))
read (IU,100)SpareBytes,Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,
& north_uppb,hei_uppb,store_slope,store_ord,store_offset,
& store_quant,geo_coord,Filler ,RImage
close(IU)
return
100 format(A13,I4,I4,4(I2),A22,I3,I3,A3,A4,A6,A6,A8,A14,A1,57600(A1))
end
C*************************************************************************
C This routine reads the standard 100 by 100 image XXX2.P00 DX=300 m
C*************************************************************************
subroutine ReadRadarImage100X100(IU,Filename,
& Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb,RImage)
character*13 SpareBytes
Integer Delta
Integer IY,IM,ID,IH,IN
character*20 Rad_name
Integer East_uuppb
Integer north_uppb
character*3 hei_uppb
character*4 store_slope
character*6 store_ord
character*6 store_offset
character*8 store_quant
character*14 geo_coord
character*1 Filler
character*255 Filename
character*1 RImage(0:9999)
integer cxmax,cymax
Integer IU
open (IU,file=trim(Filename))
read (IU,100)SpareBytes,Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,

40
Appendix A-D

& north_uppb,hei_uppb,store_slope,store_ord,store_offset,
& store_quant,geo_coord,Filler ,RImage
close(IU)
return
100 format(A13,I4,I4,4(I2),A22,I3,I3,A3,A4,A6,A6,A8,A14,A1,10000(A1))
end
C*************************************************************************
C This routine reads the standard 300 by 300 image XXX3.P00 DX = 100 m
C*************************************************************************
subroutine ReadRadarImage100X100(IU,Filename,
& Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,north_uppb,RImage)
character*13 SpareBytes
Integer Delta
Integer IY,IM,ID,IH,IN
character*20 Rad_name
Integer East_uuppb
Integer north_uppb
character*3 hei_uppb
character*4 store_slope
character*6 store_ord
character*6 store_offset
character*8 store_quant
character*14 geo_coord
character*1 Filler
character*255 Filename
character*1 RImage(0:9999)
integer cxmax,cymax
Integer IU
open (IU,file=trim(Filename))
read (IU,100)SpareBytes,Delta,IY,IM,ID,IH,IN,Rad_name,East_uuppb,
& north_uppb,hei_uppb,store_slope,store_ord,store_offset,
& store_quant,geo_coord,Filler ,RImage
close(IU)
return
100 format(A13,I4,I4,4(I2),A22,I3,I3,A3,A4,A6,A6,A8,A14,A1,10000(A1))
end

Integer Function GetValue(I,J,RImage,IXMAX)


integer I,J,IXMAX
character*1 RImage(0:57599)
c x and y must be in the interval 1..240
GetValue = ichar(RImage((J-1)*IXMAX+(I-1)))
End

41
Appendix A-D

C.2 MATLAB code for reading P00 Files (500x500 meter)


%Variables:
bins = 240 % Number of pixels
P00=zeros(240,240);

fid=fopen([directory_name,fileName],'r');

if fid~=-1
% Read Header
spare = char(fread(fid,14 , 'uchar'))';
delta = char(fread(fid, 3 , 'uchar'))';
date = char(fread(fid,8 , 'uchar'))';
time = char(fread(fid,4 , 'uchar'))';
name = char(fread(fid,28 , 'uchar'))';
rotation = char(fread(fid,7 , 'uchar'))';
div = char(fread(fid,35 , 'uchar'))';
% Read Data
data = (fread(fid, 57600, 'uint8'))';
data(1)=0; % the first value is always 255 – must be reset
% The data string is next cut into segments – one for each
azimuth
n=1;
for i=1:bins;
P00(i,1:bins)=data(n:n+bins-1);
n=n+bins;
end
end
fclose(fid);

This code example is only valid for data from the 1525 or 1721 Furuno model. The dataformat
for the City-LAWR is not supported in this manual

42
Appendix A-D

C.3 MATLAB code for reading L00 Files


%Variables:
text_length=502; % gives the length of this record in the binary file
data_length=517; % gives the length of this record in the binary file
(8001/16)+16
scans=zeros(361,501);
bins=500;
RadarScans=360;
extra=16 % There is 500 bins but the data record is 517 long (0 based,
madlab is 1 based)

fid=fopen([directory_name,fileName],'r');

if fid~=-1
type='int16'
spare = char(fread(fid, 3, type))';
date = char(fread(fid, 8, type))';
time = (char(fread(fid, 4,type)))';
text = char(fread(fid, text_length, type))';
data = (fread(fid, (data_length*RadarScans), type))';
% creation of matrix with one scanline pr row
n=1;
for i=1:RadarScans; %
scans(i,1:bins+1)=data(n:n+bins);
scans(i,bins+1)= scans(i,bins); % Last value is extreme - is
replaced with previous n=n+(bins+1)+extra; %
end
scans(RadarScans+1,:)=scans(1,1:bins+1); % in order to draw it
fclose(fid)
end

This code example is only valid for data from the 1525 or 1721 Furuno model. The dataformat
for the City-LAWR is not supported in this manual

43
Appendix A-D

C.4 Makefile for compiling LAWR image reader (P00)


##################################################################
## DHI 2010 ##
## Makefile for compiling LAWR image reader ##
##################################################################

CC=g++
CFLAGS=-c -Wall
LDFLAGS=
SOURCES=readP00.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=readP00

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $@

.cpp.o:
$(CC) $(CFLAGS) $< -o $@

44
Appendix A-D

C.5 C++ code for reading LAWR (P00) in Linux


//////////////////////////////////////////////////////////////////
// DHI 2010 //
// C++ code made in Linux //
// Demonstration of reading LAWR images //
//////////////////////////////////////////////////////////////////

#include <stdio.h>

int main()
{
size_t result;
char spare[14];
char delta[3];
char date[8];
char time[4];
char name[28];
char rotation[7];
char div[35];
unsigned char rawdata[57600];
const char fname[] = "HVID1300.P00";
FILE *fp = fopen(fname,"r");

printf("Program to read and print radar files\n");


if(fp==NULL) perror("Read error");
else {
printf("File opens OK\n");
printf("Filesize is: %d",result);

// Read and prints 'spare' in header


fseek(fp,0,SEEK_SET);
fread(&spare,1,14,fp);
printf("\nSpare:");
for(int i=0;i<14;i++) printf("%c",spare[i]);

// Read and prints 'delta' in header


fseek(fp,14,SEEK_SET);
fread(&delta,1,3,fp);
printf("\nDelta:");
for(int i=0;i<3;i++) printf("%c",delta[i]);

// Read and prints 'date' in header


fseek(fp,17,SEEK_SET);
fread(&date,1,8,fp);
printf("\nDate:");
for(int i=0;i<8;i++) printf("%c",date[i]);

45
Appendix A-D

fseek(fp,25,SEEK_SET);
fread(&time,1,4,fp);
printf("\nTime:");
for(int i=0;i<4;i++) printf("%c",time[i]);

// Read and prints 'name' in header


fseek(fp,29,SEEK_SET);
fread(&name,1,28,fp);
printf("\nName:");
for(int i=0;i<28;i++) printf("%c",name[i]);

fseek(fp,57,SEEK_SET);
fread(&rotation,1,7,fp);
printf("\nRotation:");
for(int i=0;i<7;i++) printf("%c",rotation[i]);

// Read and prints 'div' in header


fseek(fp,64,SEEK_SET);
fread(&div,1,35,fp);
printf("\nDiv:");
for(int i=0;i<35;i++) printf("%c",div[i]);

// Read and prints 'data' in binary data


fseek(fp,99,SEEK_SET);
fread(&rawdata,1,57600,fp);
printf("\nRawdata:");
for(int i=0;i<57600;i++) printf("%u",rawdata[i]);

fclose(fp);
}
return 0;
}

APPENDIX D. DESIGN BACKGROUND


This appendix provides the background information that leads to
the current version of the system.
The following system analysis is on a FURUNO model 1525. The
radar constant gives the radar hardware influence on the
measurements. According to /3/ it is given as:

3 Pt  G 2      h Pt  G 2      h
C  a
1024 ln 2 2  L 2  L

Where:
a: -13.6 dB
Pt: 25 kW 74.0 dBm

46
Appendix A-D

G2 30 dB 60.0 dB
θ: 0.95° 0.016581 rad -17.8 dB
φ: 20° 0,349066 rad -4.6 dB
h=c∙t pulse: 1.2 μs 25.6 dB
λ Freq. 9410 MHz 29.9 dB
1/L 2.5 dB
Total 151.0 dBm

The minimum detectable signal is given by the thermal noise of


the receiving system. This is given by the following equation:

S
S min  k  T0  B  Fn 
n

Where:
k: Boltzman constant, 1.38054 Ws/K
T0 is 290 K, k∙T0 = 4 ∙ 10-21 W/Hz
Fn receiver noise figure = 6 dB
B: Bandwidth = 3 MHz
S/N: signal to noise ratio for detection = 2 dB

Smin is then -101.2 dBm.

If the integration is performed on video level, the minimum


detectable signal will be lower. The integration gain will equal
app. n0.7, where n is the number of pulses in the integration. For
integration of 120 pulses, the gain is 14.6. Smin is then -115.8 dBm

Then the total attenuation at a distance of 25 km, where 50% of the


distance is clouds and 10% is precipitation is then 49.59 dB. The
received signal is then -75.8 dBm (to be compared with Smin).

With a sample frequency (f) of 20 MHz and the speed of light (c)
the spatial resolution of each sample can be estimated as follows:

1 1
20 10 6 s
spatial resolution  f   7.5 m
1 2 2
c 299 792 458 m / s

47
Notes:

10 NOTES:

48

You might also like