Class: plot

plot


new plot(data, products, options)

Plot level 2 data

Parameters:
Name Type Description
data Level2Data

*Output from the nexrad-level-2-data library

products string | Array.<string>

Individual strings as shown in supported products to specify the products to be plotted.

options object

Plotting options

Properties
Name Type Argument Default Description
size number <optional>
3600

1 to 3600. 1 to 3600. Size of the x and y axis in pixels. The image must be square so only a single integer is needed.

cropTo number <optional>
3600

1 to 3600. After scaling and downsampling as described above crop the resulting plot to the size specified. Internally, the image is actually drawn at the cropped size to save on processing time.

background string <optional>
#000000

Background color of the image. This can be transparent by using #RGBA notation. See ctx.fillStyle for more information.

lineWidth number <optional>
2

The raster image is created by drawing several arcs at the locations and colors specified in the data file. When scaling down you may get a better looking image by adjusting this value to something large than the default.

palettize boolean | object <optional>

After drawing the image convert the image from RGBA to a palettized image. When true the same palette as the product is used. Additional options are described in palettizing. This can significantly reduce the size of the resulting image with minimal loss of clarity.

elevations undefined | number | Array.<number> <optional>

The specific elevations to plot. If undefined (default) all available elevations will be plotted. If an integer is provided a single elevation will be plotted with all the selected products. If an array of integers are provided each products in each elevation will be plotted. Note that when a product and elevation combination do not exist the returned object will have false in the missing location. This is common where elevation 1 will have reflectivity data and elevation 2 (altough at the same angle as elevation 1) will contain velocity data.

usePreferredWaveforms boolean <optional>
true

Waveform types of 1, 2, 3, 4 and 5 are produced by the radar. Type 1 is typically exclusive to reflectivity, Type 2 is typically exclusive to velocity however it also produces reflectivity data. Types 3, 4 and 5 all produce both velocity and reflectivity. When set to true type 1 waveforms will not plot velocity data, and type 2 waveforms will not plot reflectivity data. If you must see all information set this to false.

Returns:

Plotted canvases in the order they are requested by the input options.elevations

Type
Array.<PlottedCanvases>