RADCART2

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE

NAME

radcart2 −− interpolate radar data to a Cartesian coordinate system, with adjustments for earth’s curvature.

SYNOPSIS

radcart2 x0 dx xkm y0 dy ykm z0 dz zkm xradar yradar zradar lat0 [svx svy [reftime]]

DESCRIPTION

Radcart2 reads a Candis file on the standard input consisting of a volume of radar data in range−ray format. A Candis file is written to the standard output with these data interpolated to a rectangular Cartesian grid. Corrections are made for the earth’s curvature. Positions are adjusted for storm propagation to a standard time (the time of the first ray) if the storm velocity components, svx and svy, are given on the command line. If not entered, default values are 0 and 0. Interpolation of the ray to the Cartesian grid is made after corrections for the storm velocity and the curvature of the earth are made. The actual interpolation is made taking the position of each gate (x,y,z) and distributing the values to all eight corners of the box by a weighting system based upon how close the gate is to each corner.

The first 9 arguments define the grid. X0, y0, and z0 define the lower southwest corner of the grid in kilometers relative to an origin common to all radars in the setup. X is east, y is north, and z is up. Dx, dy, and dz define the grid interval in kilometers. Xkm, ykm, and zkm define the size of the domain in kilometers. The number of grid points in the x dimension is calculated from nx = xkm/dx + 1.5, with similar calculations in the y and z directions. The position of the radar relative to the origin of the coordinate system is specified in kilometers by the next three arguments, xradar, yradar, and zradar. The final non-optional argument is lat0 which is the latitude of the origin.

The optional arguments svx and svy define the assumed propagation speed of the observed storm. The values of svx or svy should be entered in m/s. All ray data points are advected to their nominal position at the start of the volume scan using svx and svy. If the optional reftime argument is specified, the advection is to the specified reference time (in kiloseconds after midnight) rather than to the beginning of the volume scan. These arguments have two purposes. First, they allow for correction of the time smearing due to advection of the storm during the period of the volume scan. Second, if reftime is specified, all volumes can be advected back to a common time so that the coordinate system has in effect undergone a Galilean transformation to the frame of the moving storm.

The input file must meet certain requirements. The usual way of creating it is to first convert a Universal Format radar tape to Candis format using rtape and raduf. Raduffix may have to be used to fix problems with the Universal Format tapes. All variable slices are then concatenated into a single variable slice using cdfcat with the sequence variable raycnt. Finally, certain fields that don’t change value with raycnt should be reduced in dimension by applying cdfuniq. Certain assumptions are made about the names of input fields. These are easily changed by editing the source file before compilation. The assumed names are all located in defines near the beginning of the program.

The output static slice contains the three index fields x, y, and z. All zero dimensional fields are simply transferred, while all one dimensional fields with range as the dimension dimension are interpolated to the Cartesian grid. All other fields are dropped. The x,y,z locations of the radar are included in the variable slice with names ‘‘xradar’’, ‘‘yradar’’, and ‘‘zradar’’.

EXAMPLE

Raduf expects that a file has been read in by rtape. Raduffix will take a binary file and put in the necessary header information that raduf expects from an rtape read. If the file was read in by rtape, raduffix will check the byte size information, and fix it if necessary. There is output of the form fprintf(stderr,"") if a record size is changed, hence this output can be put into a file (out3 in this example) as shown.

kestrel%(raduffix ufcp31949_20jul | raduf > ufcp31949_20jul.cdf) >&out3

The file ufcp31949_20jul.cdf is now a common data format file ready to go into radcart2. The following is an example shell script that will invoke radcart2:

#!/bin/sh # # hcart #

x0=10.

dx=1.

xkm=61.

y0=-20.

dy=1.

ykm=51.

z0=0

dz=.5

zkm=6.

lat=19.7218

xloc=10.56

yloc=-13.96

zloc=0.021

radcart2 azim elev raycnt range $x0 $dx $xkm $y0 $dy $ykm $z0

$dz $zkm $xloc $yloc $zloc $lat mon min sec <ufcp31949_20jul.cdf)

> ufcp31949_20jul.cart #

In the example the range of the x grid starts at 10 and goes for 61 km giving a grid size of 71 km with 1 km increments giving you 61 grid spaces. For the z direction, it starts at 0 and goes for 6 km in .5 km increments, hence having 13 grid spaces.