Loading...
Searching...
No Matches
Cartesian conversions and composites

Rack can also create radar image composites, sometimes called mosaics. In weather services, composites are often preferred to single-radar products. This section lists related commands and examples. A list of all the related command is Compositing and Cartesian products. Motion vectors are a separate topic, discussed in Composites of motion fields .

Mapping data from polar to Cartesian coordinates

A single-radar Cartesian image is created simply with --cCreate (abbr. -c ) as follows:

rack volume.h5 --cCreate -o cartesian.h5
A single-radar Cartesian image produced directly with --cCreate.

By default, the first data in the input volume – /dataset1/data1 – is used. This can be changed with --select , which has several options:

Parameter Default Unit
path [/]dataset[/data<j>//quality<j>]
quantity DBZH:VRAD:RHOHV:...
elangle -90,90 min[:max]
count 4095 uint32
order DATA:MIN ["DATA","ELANGLE","TIME"]:["MIN","MAX"]
prf ANY ["ANY","SINGLE","DOUBLE"]
timespan 0,0 range from nominal time [seconds]

The following command loops through for quantities and displays them as an image panel:

rack --outputPrefix $PWD/out/ \
--forEach i=DBZH,VRADH,ZDR,RHOHV \
--script '--select quantity=${i} -c -P -o cartesian-${i}.png' \
volume.h5 \
-o quantities-panel.svg
A panel of radar quantities.

The following command generates Pseudo Cappi images on predefined altitudes :

rack --outputPrefix $PWD/out/ \
--forEach i=600,1000,1200,2000 \
--script '--select prf=SINGLE,quantity=DBZH --pCappi ${i} -c -P -o cartesian-cappi-${i}.png' \
volume.h5 \
-o cappi-panel.svg
A panel of pseudo CAPPI at several altitudes.

For more details on using --forEach and --script commands, see Scripts .

Further, if a polar product has been computed, its (main) output quantity is automatically used but can be likewise overridden with --select .

The default settings of Cartesian transformation are collected below as command line options.

Option Parameters Default
--cProj EPSG code, proj string, or "AEQD" "AEQD" (Azimuthal Equidistant centered at the radar)
--cBBox xLL,yLL,xUR,yUR Matched to the radar range
--cSize width,height "500,500"
--cMethod compositing method "MAXIMUM"
--select path,quantity,... "path=dataset1/data1"

In Rack , any single-radar Cartesian image is technically a "single-radar composite".

Compositing

Internally, a composite is implemented as a separate memory array that supports continuous accumulation of data. That means that arbitrarily many input volumes can be added.

rack \
--cProj '5120' \
--cSize '1024,1280' \
--cBBox '-1100000,350000,948000,2910000' \
data/volume-fikor.h5 --select quantity=DBZH --cAdd \
data/volume-fikan.h5 --select quantity=DBZH --cAdd \
data/volume-fivih.h5 --select quantity=DBZH --cAdd \
...
...
...
--cExtract DATA,WEIGHT \
-o out/composite-test.h5

The first --cAdd command initialises the composite with current geographical settings. As they are not given explicitly in this example, the composite applies AEQD projection centered around the first input (from fikor , Korpo radar).

Note
For clarity, the applied --select command is repeated in the above example. It would be sufficient to put it before the first --cAdd command only – the selector is internally stored as a composite input selector for subsequent inputs.

Instead of repeating arguments on the command line, it is handy to use --script to define a routine repeated for each input. (More details on Scripts page.)

rack \
--cProj '5120' \
--cSize '1024,1280' \
--cBBox '-1100000,350000,948000,2910000' \
--script '--pCappi 600 --cAdd' \
data/*.h5 \
--cExtract DATA,WEIGHT \
-o out/composite-nordic.h5
Appending several radars in a Cartesian image.

Likewise, if file paths are long, their shared parts can be set with --inputPrefix and --outputPrefix . The previous command can be hence reformulated as follows, with an extended set of output files:

rack \
--script '--select quantity=DBZH --cAdd' \
volume-fikor.h5 \
volume-fikan.h5 \
volume-fivih.h5 \
--cExtract DATA,WEIGHT \
--outputPrefix out/ \
-o composite-simple.h5 \
-o composite-simple.tif \
--palette default -o composite-simple.png \
-o composite-simple.txt
Note
Subcommand --cCreate producing a single radar Cartesian image is actually a shorthand of –cAdd –cExtract 'DATA,WEIGHT' .

An example of a command that generates a composite image of Pseudo CAPPI product of 12 radars:

A radar composite image – Finnish (FMI) radars, Pseudo CAPPI 600m, weighted-average compositing method: main product (left) and quality field (right).

Experimental. The above command line can be generated – and optionally executed – using Python utility rack.composite . The equivalent command line is not remarkably shorter, but now the order of the options is insignificant:

python3 -m rack.composite \
--BBOX -208000.0,6390000.0,1072000.0,7926000.0 \
--PROJ 3067 \
--SIZE 640,768 \
--METHOD WAVG,1,8 \
202609261800_radar.polar.fianj.h5 \
202609261800_radar.polar.fikan.h5 \
202609261800_radar.polar.fikau.h5 \
202609261800_radar.polar.fikes.h5 \
202609261800_radar.polar.fikor.h5 \
202609261800_radar.polar.fikuo.h5 \
202609261800_radar.polar.filuo.h5 \
202609261800_radar.polar.finur.h5 \
202609261800_radar.polar.fipet.h5 \
202609261800_radar.polar.fiuta.h5 \
202609261800_radar.polar.fivih.h5 \
202609261800_radar.polar.fivim.h5 \
--INDIR data/ \
--OUTFILE out/composite-fi.h5 \
--PPROD pCappi,500 \
--QUANTITY DBZH \
--FORMATS svg \
--svgOutputs DATA,WEIGHT \
--svgRelativePaths \
--svgStyle '.IMAGE_BORDER=stroke:gray;width:1px' \
--map out/map-composite-fi.png \
--log_level INFO --print ' \\n ' # or --exec
Note
In above examples, the input files can be given equivalently using shell wildcards, with a single plain argument like: data/20*.fi*.h5 . That also makes option --inputPrefix or --INDIR (for Python) unneeded.

The above command lines can be generated also inside a Python program, as follows.

endcode

Option Parameters Description
--cBBox llLon,llLat,urLon,urLat Bounding box of the Cartesian product.
--cSize width,height Set size of the compositing array. Does not allocate memory.
--cMethod method Method in accumulating values on a composite.
--select path,quantity,elangle,count,order,prf,timespan Data selector for the next computation

See also