Skip to content

Commit

Permalink
ENH: added voltype to all products parameters when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfidan committed Sep 30, 2024
1 parent c437e00 commit c8b5128
Show file tree
Hide file tree
Showing 7 changed files with 277 additions and 16 deletions.
104 changes: 102 additions & 2 deletions src/pyrad_proc/pyrad/prod/process_grid_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,17 @@ def generate_grid_products(dataset, prdcfg):
generates grid products. Accepted product types:
'CROSS_SECTION': Plots a cross-section of gridded data
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
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:
voltype: name of the pyrad variable to use, it must be available
in the dataset
step: float or None
the data quantization step. If none it will be obtained
from the Py-ART configuration file
Expand All @@ -180,13 +184,17 @@ def generate_grid_products(dataset, prdcfg):
'LATITUDE_SLICE': Plots a cross-section of gridded data over a
constant latitude.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
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:
voltype: name of the pyrad variable to use, it must be available
in the dataset
lon, lat: floats
The starting point of the cross-section. The ending point
is defined by the parameters in 'xsecImageConfig' in the
Expand All @@ -201,6 +209,8 @@ def generate_grid_products(dataset, prdcfg):
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:
voltype: name of the pyrad variable to use, it must be available
in the dataset
file_type: str
The type of file used to save the data. Can be 'nc' or
'h5'. Default 'nc'
Expand All @@ -221,23 +231,31 @@ def generate_grid_products(dataset, prdcfg):
'STATS': Computes statistics over the whole images and stores them in
a file.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
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:
voltype: name of the pyrad variable to use, it must be available
in the dataset
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:
voltype: name of the pyrad variable to use, it must be available
in the dataset
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:
voltype: name of the pyrad variable to use, it must be available
in the dataset
level: int
The altitude level to plot. The rest of the parameters are
defined by the parameters in 'ppiImageConfig' and
Expand All @@ -255,6 +273,8 @@ def generate_grid_products(dataset, prdcfg):
'SURFACE_CONTOUR_OVERPLOT':
Plots a surface image of gridded data with a contour overplotted.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
level: int
The altitude level to plot. The rest of the parameters are
defined by the parameters in 'ppiImageConfig' and
Expand All @@ -272,6 +292,8 @@ def generate_grid_products(dataset, prdcfg):
'SURFACE_OVERPLOT':
Plots on the same surface two images, one on top of the other.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
level: int
The altitude level to plot. The rest of the parameters are
defined by the parameters in 'ppiImageConfig' and
Expand All @@ -283,9 +305,11 @@ def generate_grid_products(dataset, prdcfg):
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
Plots horizontal wind vectors obtained from a DDA analysis on a 2D map.
The pyDDA package is required
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
level: int
The altitude level to plot. The rest of the parameters are
defined by the parameters in 'ppiImageConfig' and
Expand Down Expand Up @@ -317,6 +341,82 @@ def generate_grid_products(dataset, prdcfg):
linewidth: float
Linewidths for streamlines.
(only used for streamline plots)
'DDA_LONGITUDE_SLICE':
Plots horizontal wind vectors obtained from a DDA analysis on a vertical transect
along a given longitude
The pyDDA package is required
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
level: int
The longitude level to plot. The rest of the parameters are
defined by the parameters in 'xsecImageConfig' 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)
'DDA_LATITUDE_SLICE':
Plots horizontal wind vectors obtained from a DDA analysis on a vertical transect
along a given latitude
The pyDDA package is required
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
level: int
The latitude level to plot. The rest of the parameters are
defined by the parameters in 'xsecImageConfig' 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
Expand Down
33 changes: 23 additions & 10 deletions src/pyrad_proc/pyrad/prod/process_intercomp_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,50 @@ def generate_intercomp_products(dataset, prdcfg):
intercomparison in a file and plots the time series of the
statistics.
User defined parameters:
'add_date_in_fname': Bool
voltype: name of the pyrad variable to use, it must be available
in the dataset
add_date_in_fname: Bool
If true adds the year in the csv file containing the
statistics. Default False
'sort_by_date': Bool
sort_by_date: Bool
If true sorts the statistics by date when reading the
csv file containing the statistics. Default False
'rewrite': Bool
step: float
The quantization step of the data. If none it will be
computed using the Py-ART config file. Default None
rewrite: Bool
If true rewrites the csv file containing the statistics.
Default False
'npoints_min': int
npoints_min: int
The minimum number of points to consider the statistics
valid and therefore use the data point in the plotting.
Default 0
'corr_min': float
corr_min: float
The minimum correlation to consider the statistics
valid and therefore use the data point in the plotting.
Default 0.
'PLOT_SCATTER_INTERCOMP': Plots a density plot with the points of
radar 1 versus the points of radar 2
User defined parameters:
'step': float
voltype: name of the pyrad variable to use, it must be available
in the dataset
step: float
The quantization step of the data. If none it will be
computed using the Py-ART config file. Default None
'scatter_type': str
scatter_type: str
Type of scatter plot. Can be a plot for each radar volume
('instant') or at the end of the processing period
('cumulative'). Default is 'cumulative'
(instant) or at the end of the processing period
(cumulative). Default is cumulative
'WRITE_INTERCOMP': Writes the instantaneously intercompared data
(gate positions, values, etc.) in a csv file.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
'WRITE_INTERCOMP_TIME_AVG': Writes the time-averaged intercompared
data (gate positions, values, etc.) in a csv file.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
Parameters
----------
Expand Down Expand Up @@ -411,7 +424,7 @@ def generate_intercomp_products(dataset, prdcfg):
def generate_colocated_gates_products(dataset, prdcfg):
"""
Generates colocated gates products. Accepted product types:
'WRITE_COLOCATED_GATES': Writes the position of the co-located gates
WRITE_COLOCATED_GATES: Writes the position of the co-located gates
in a csv file
All the products of the 'VOL' dataset group
Expand Down
10 changes: 10 additions & 0 deletions src/pyrad_proc/pyrad/prod/process_monitoring_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def generate_monitoring_products(dataset, prdcfg):
in the Y-axis. The reference values and the user defined quantiles
are also plot on the same figure
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
anglenr: int
The elevation angle number to plot
quantiles: list of floats
Expand All @@ -59,6 +61,8 @@ def generate_monitoring_products(dataset, prdcfg):
'CUMUL_VOL_TS': Plots time series of the average of instantaneous
quantiles stored in a csv file.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
quantiles: list of 3 floats
the quantiles to compute. Default 25., 50., 75.
ref_value: float
Expand Down Expand Up @@ -106,6 +110,8 @@ def generate_monitoring_products(dataset, prdcfg):
'PPI_HISTOGRAM': Plots a histogram of data at a particular
elevation angle.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
anglenr: int
The elevation angle number to plot
'SAVEVOL': Saves the monitoring data in a C/F radar file. The data
Expand All @@ -114,12 +120,16 @@ def generate_monitoring_products(dataset, prdcfg):
'VOL_HISTOGRAM': Plots a histogram of data collected from all the
radar volume.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
write_data: bool
If true the resultant histogram is also saved in a csv
file. Default True.
'VOL_TS': Computes statistics of the gathered data and writes them in
a csv file and plots a time series of those statistics.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
quantiles: list of 3 floats
the quantiles to compute. Default 25., 50., 75.
ref_value: float
Expand Down
13 changes: 13 additions & 0 deletions src/pyrad_proc/pyrad/prod/process_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def generate_occurrence_products(dataset, prdcfg):
with clutter that has a frequency of occurrence above a certain
threshold.
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
quant_min: float
Minimum frequency of occurrence in percentage to keep the
gate as valid. Default 95.
Expand Down Expand Up @@ -365,11 +367,19 @@ def generate_sun_hits_products(dataset, prdcfg):
'PLOT_SUN_HITS': Plots in a sun-radar azimuth difference-sun-radar
elevation difference grid the values of all sun hits obtained
during the processing period
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
'PLOT_SUN_RETRIEVAL': Plots in a sun-radar azimuth difference-sun-
radar elevation difference grid the retrieved sun pattern
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
'PLOT_SUN_RETRIEVAL_TS': Plots time series of the retrieved sun
pattern parameters
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
dpi: int
The pixel density of the plot. Default 72
add_date_in_fname: Bool
Expand Down Expand Up @@ -1089,6 +1099,9 @@ def generate_vpr_products(dataset, prdcfg):
in a text file
'WRITE_VPR_INFO': Writes a dictionary containing relevant parameters
of the VPR profile retrieval into a text file
User defined parameters:
voltype: name of the pyrad variable to use, it must be available
in the dataset
All the products of the 'VOL' dataset group
Parameters
Expand Down
Loading

0 comments on commit c8b5128

Please sign in to comment.