pyrad.prod.generate_grid_products#

pyrad.prod.generate_grid_products(dataset, prdcfg)[source]#
generates grid products. Accepted product types:
‘CROSS_SECTION’: Plots a cross-section of gridded data
User defined parameters:
coord1, coord2: dict

The two lat-lon coordinates marking the limits. They have the keywords ‘lat’ and ‘lon’ [degree]. The altitude limits are defined by the parameters in ‘xsecImageConfig’ in the ‘loc’ configuration file

‘HISTOGRAM’: Computes a histogram of the radar volum data
User defined parameters:
step: float or None

the data quantization step. If none it will be obtained from the Py-ART configuration file

vmin, vmax: float or None

The minimum and maximum values. If None they will be obtained from the Py-ART configuration file

mask_val: float or None

A value to mask.

write_data: Bool

If true the histogram data is written in a csv file

‘LATITUDE_SLICE’: Plots a cross-section of gridded data over a

constant latitude. User defined parameters:

lon, lat: floats

The starting point of the cross-section. The ending point is defined by the parameters in ‘xsecImageConfig’ in the ‘loc’ configuration file

‘LONGITUDE_SLICE’: Plots a cross-ection of gridded data over a

constant longitude. User defined parameters:

lon, lat: floats

The starting point of the cross-section. The ending point is defined by the parameters in ‘xsecImageConfig’ in the ‘loc’ configuration file

‘SAVEALL’: Saves a gridded data object including all or a list of

user-defined fields in a netcdf file User defined parameters:

datatypes: list of str or None

The list of data types to save. If it is None, all fields in the radar object will be saved

‘SAVEALL_GRID’Same as before but can be used in a mixed GRID/VOL

dataset, as there is no ambiguity with SAVEALL for VOL datasets

‘SAVEVOL’: Saves on field of a gridded data object in a netcdf file.
User defined parameters:
file_type: str

The type of file used to save the data. Can be ‘nc’ or ‘h5’. Default ‘nc’

physical: Bool

If True the data will be saved in physical units (floats). Otherwise it will be quantized and saved as binary. Default True

compression: str

For ODIM file formats, the type of compression. Can be any of the allowed compression types for hdf5 files. Default gzip

compression_opts: any

The compression options allowed by the hdf5. Depends on the type of compression. Default 6 (The gzip compression level).

‘SAVEVOL_GRID’Same as before but can be used in a mixed GRID/VOL

dataset, as there is no ambiguity with SAVEVOL for VOL datasets

‘STATS’: Computes statistics over the whole images and stores them in

a file. User defined parameters:

stat: str

The statistic used. Can be mean, median, min, max

‘SURFACE_RAW’: Plots a surface image of gridded data without

projecting it into a map User defined parameters:

level: int

The altitude level to plot. The rest of the parameters are defined by the parameters in ‘ppiImageConfig’ and ‘ppiMapImageConfig’ in the ‘loc’ configuration file

‘SURFACE_IMAGE’: Plots a surface image of gridded data.
User defined parameters:
level: int

The altitude level to plot. The rest of the parameters are defined by the parameters in ‘ppiImageConfig’ and ‘ppiMapImageConfig’ in the ‘loc’ configuration file

‘SURFACE_CONTOUR’: Plots a surface image of contour gridded data.
User defined parameters:
level: int

The altitude level to plot. The rest of the parameters are defined by the parameters in ‘ppiImageConfig’ and ‘ppiMapImageConfig’ in the ‘loc’ configuration file

contour_valuesfloat array or None

The contour values. If None the values are taken from the ‘boundaries’ keyword in the field description in the Py-ART config file. If ‘boundaries’ is not set the countours are 10 values linearly distributed from vmin to vmax

linewidthsfloat

width of the contour lines

colorscolor string or sequence of colors

The contour colours

‘SURFACE_CONTOUR_OVERPLOT’:

Plots a surface image of gridded data with a contour overplotted. User defined parameters:

level: int

The altitude level to plot. The rest of the parameters are defined by the parameters in ‘ppiImageConfig’ and ‘ppiMapImageConfig’ in the ‘loc’ configuration file

contour_valuesfloat array or None

The contour values. If None the values are taken from the ‘boundaries’ keyword in the field description in the Py-ART config file. If ‘boundaries’ is not set the countours are 10 values linearly distributed from vmin to vmax

linewidthsfloat

width of the contour lines

colorscolor string or sequence of colors

The contour colours

‘SURFACE_OVERPLOT’:

Plots on the same surface two images, one on top of the other. User defined parameters:

level: int

The altitude level to plot. The rest of the parameters are defined by the parameters in ‘ppiImageConfig’ and ‘ppiMapImageConfig’ in the ‘loc’ configuration file

contour_valuesfloat array or None

The contour values. If None the values are taken from the ‘boundaries’ keyword in the field description in the Py-ART config file. If ‘boundaries’ is not set the countours are 10 values linearly distributed from vmin to vmax

‘DDA_MAP’:

Plots wind vectors obtained from a DDA analysis. The pyDDA package is required User defined parameters:

level: int

The altitude level to plot. The rest of the parameters are defined by the parameters in ‘ppiImageConfig’ and ‘ppiMapImageConfig’ in the ‘loc’ configuration file

display_type: str

Display method for the wind vectors, can be either ‘streamline’, ‘quiver’ or ‘barbs’

bg_ref_rad: int

Which radar to use as reference to display the background voltype.

u_vel_contours: list of int

The contours to use for plotting contours of u. Set to None to not display such contours.

v_vel_contours: list of int

The contours to use for plotting contours of v. Set to None to not display such contours.

w_vel_contours: list of int

The contours to use for plotting contours of w. Set to None to not display such contours.

vector_spacing_km: float

Spacing in km between wind vectors in x and y axis (only used for barbs and quiver plots)

quiver_len: float

Length to use for the quiver key in m/s. (only used for quiver plots)

streamline_arrowsize: float

Factor scale arrow size for streamlines. (only used for streamline plots)

linewidth: float

Linewidths for streamlines. (only used for streamline plots)

Parameters:
  • dataset (grid) – grid object

  • prdcfg (dictionary of dictionaries) – product configuration dictionary of dictionaries

Returns:

None or name of generated files