Skip to content

Commit

Permalink
DOC: Added optional for optional parameters and removed other parameters
Browse files Browse the repository at this point in the history
sub header.
  • Loading branch information
zssherman committed May 7, 2019
1 parent ffcd07e commit c499a2f
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 164 deletions.
2 changes: 1 addition & 1 deletion pyart/retrieve/advection.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def grid_displacement_pc(grid1, grid2, field, level, return_value='pixels'):
Returns
-------
displacement : two-tuple
Calculated displacement in units of y and x. Value returned in
Calculated displacement in units of y and x. Value returned in
integers if pixels, otherwise floats.
"""
Expand Down
37 changes: 14 additions & 23 deletions pyart/retrieve/echo_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,30 @@ def steiner_conv_strat(grid, dx=None, dy=None, intense=42.0,
----------
grid : Grid
Grid containing reflectivity field to partition.
Other Parameters
----------------
dx, dy : float
dx, dy : float, optional
The x- and y-dimension resolutions in meters, respectively. If None
the resolution is determined from the first two axes values.
intense : float
intense : float, optional
The intensity value in dBZ. Grid points with a reflectivity
value greater or equal to the intensity are automatically
flagged as convective. See reference for more information.
work_level : float
work_level : float, optional
The working level (separation altitude) in meters. This is the height
at which the partitioning will be done, and should minimize bright band
contamination. See reference for more information.
peak_relation : 'default' or 'sgp'
peak_relation : 'default' or 'sgp', optional
The peakedness relation. See reference for more information.
area_relation : 'small', 'medium', 'large', or 'sgp'
area_relation : 'small', 'medium', 'large', or 'sgp', optional
The convective area relation. See reference for more information.
bkg_rad : float
bkg_rad : float, optional
The background radius in meters. See reference for more information.
use_intense : bool
use_intense : bool, optional
True to use the intensity criteria.
fill_value : float
fill_value : float, optional
Missing value used to signify bad data points. A value of None
will use the default fill value as defined in the Py-ART
configuration file.
refl_field : str
refl_field : str, optional
Field in grid to use as the reflectivity during partitioning. None
will use the default reflectivity field name from the Py-ART
configuration file.
Expand Down Expand Up @@ -137,22 +134,19 @@ def hydroclass_semisupervised(radar, mass_centers=None,
----------
radar : radar
Radar object.
Other Parameters
----------------
mass_centers : ndarray 2D
mass_centers : ndarray 2D, optional
The centroids for each variable and hydrometeor class in (nclasses,
nvariables).
weights : ndarray 1D
weights : ndarray 1D, optional
The weight given to each variable.
refl_field, zdr_field, rhv_field, kdp_field, temp_field : str
refl_field, zdr_field, rhv_field, kdp_field, temp_field : str, optional
Inputs. Field names within the radar object which represent the
horizonal reflectivity, the differential reflectivity, the copolar
correlation coefficient, the specific differential phase and the
temperature field. A value of None for any of these parameters will
use the default field name as defined in the Py-ART configuration
file.
hydro_field : str
hydro_field : str, optional
Output. Field name which represents the hydrometeor class field.
A value of None will use the default field name as defined in the
Py-ART configuration file.
Expand Down Expand Up @@ -297,10 +291,7 @@ def _assign_to_class(zh, zdr, kdp, rhohv, relh, mass_centers,
Variables used for assigment normalized to [-1, 1] values.
mass_centers : matrix
Centroids normalized to [-1, 1] values.
Other Parameters
----------------
weights : array
weights : array, optional
The weight given to each variable.
Returns
Expand Down
20 changes: 7 additions & 13 deletions pyart/retrieve/gate_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,13 @@ def map_profile_to_gates(profile, heights, radar, toa=None,
Monotonically increasing heights in meters with same shape as profile.
radar : Radar
Radar to map to.
Other Parameters
----------------
toa : float
toa : float, optional
Top of atmosphere, where to use profile up to. If None check for
mask and use lowest element, if no mask uses whole profile.
height_field : str
height_field : str, optional
Name to use for height field metadata. None will use the default field
name from the Py-ART configuration file.
profile_field : str
profile_field : str, optional
Name to use for interpolate profile field metadata. None will use the
default field name from the Py-ART configuration file.
Expand All @@ -61,7 +58,7 @@ def map_profile_to_gates(profile, heights, radar, toa=None,
_, _, z = antenna_to_cartesian(rg / 1000.0, azg, eleg)

# Check that z is not a MaskedArray
if type(z) is np.ma.core.MaskedArray:
if isinstance(z, np.ma.MaskedArray):
z = z.filled(np.NaN)

# find toa is not provided
Expand Down Expand Up @@ -108,14 +105,11 @@ def fetch_radar_time_profile(sonde_dset, radar, time_key='time',
Interpolate sonde Dataset.
radar : Radar
Radar object from which the nearest profile will be found.
Optional Parameters
-------------------
time_key : string
time_key : string, optional
Key to find a CF startard time variable.
height_key : string
height_key : string, optional
Key to find profile height data.
nvars : list
nvars : list, optional
NetCDF variable to generated profiles for. If None (the default) all
variables with dimension of time, height will be found in ncvars.
Expand Down
97 changes: 38 additions & 59 deletions pyart/retrieve/qpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ def est_rain_rate_zpoly(radar, refl_field=None, rr_field=None):
----------
radar : Radar
Radar object.
Other Parameters
----------------
refl_field : str
refl_field : str, optional
Name of the reflectivity field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
Returns
Expand Down Expand Up @@ -83,14 +80,11 @@ def est_rain_rate_z(radar, alpha=0.0376, beta=0.6112, refl_field=None,
----------
radar : Radar
Radar object.
Other Parameters
----------------
alpha, beta : floats
alpha, beta : floats, optional
Factor (alpha) and exponent (beta) of the power law.
refl_field : str
refl_field : str, optional
Name of the reflectivity field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
Returns
Expand Down Expand Up @@ -125,15 +119,12 @@ def est_rain_rate_kdp(radar, alpha=None, beta=None, kdp_field=None,
----------
radar : Radar
Radar object.
Other Parameters
----------------
alpha, beta : floats
alpha, beta : floats, optional
Factor (alpha) and exponent (beta) of the power law. If not set the
factors are going to be determined according to the radar frequency.
kdp_field : str
kdp_field : str, optional
Name of the specific differential phase field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
Returns
Expand Down Expand Up @@ -180,15 +171,12 @@ def est_rain_rate_a(radar, alpha=None, beta=None, a_field=None,
----------
radar : Radar
Radar object.
Other Parameters
----------------
alpha, beta : floats
alpha, beta : floats, optional
Factor (alpha) and exponent (beta) of the power law. If not set the
factors are going to be determined according to the radar frequency.
a_field : str
a_field : str, optional
Name of the specific attenuation field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
Returns
Expand Down Expand Up @@ -249,28 +237,25 @@ def est_rain_rate_zkdp(radar, alphaz=0.0376, betaz=0.6112, alphakdp=None,
----------
radar : Radar
Radar object.
Other Parameters
----------------
alphaz, betaz : floats
alphaz, betaz : floats, optional
Factor (alpha) and exponent (beta) of the z-r power law.
alphakdp, betakdp : floats
alphakdp, betakdp : floats, optional
Factor (alpha) and exponent (beta) of the kdp-r power law.
If not set the factors are going to be determined according
to the radar frequency.
refl_field : str
refl_field : str, optional
Name of the reflectivity field to use.
kdp_field : str
kdp_field : str, optional
Name of the specific differential phase field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
master_field : str
master_field : str, optional
Name of the field that is going to act as master. Has to be
either refl_field or kdp_field. Default is refl_field.
thresh : float
thresh : float, optional
Value of the threshold that determines when to use the slave
field.
thresh_max : Bool
thresh_max : Bool, optional
If true the master field is used up to the thresh value maximum.
Otherwise the master field is not used below thresh value.
Expand Down Expand Up @@ -339,27 +324,24 @@ def est_rain_rate_za(radar, alphaz=0.0376, betaz=0.6112, alphaa=None,
----------
radar : Radar
Radar object
Other Parameters
----------------
alphaz, betaz : floats
alphaz, betaz : floats, optional
Factor (alpha) and exponent (beta) of the z-r power law.
alphaa,betaa : floats
alphaa,betaa : floats, optional
Factor (alpha) and exponent (beta) of the a-r power law. If not set
the factors are going to be determined according to the radar frequency.
refl_field : str
refl_field : str, optional
Name of the reflectivity field to use.
a_field : str
a_field : str, optional
Name of the specific attenuation field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
master_field : str
master_field : str, optional
Name of the field that is going to act as master. Has to be
either refl_field or kdp_field. Default is refl_field.
thresh : float
thresh : float, optional
Value of the threshold that determines when to use the slave
field.
thresh_max : Bool
thresh_max : Bool, optional
If true the master field is used up to the thresh value maximum.
Otherwise the master field is not used below thresh value.
Expand Down Expand Up @@ -430,34 +412,31 @@ def est_rain_rate_hydro(radar, alphazr=0.0376, betazr=0.6112, alphazs=0.1,
----------
radar : Radar
Radar object.
Other Parameters
----------------
alphazr, betazr : floats
alphazr, betazr : floats, optional
Factor (alpha) and exponent (beta) of the z-r power law for rain.
alphazs, betazs : floats
alphazs, betazs : floats, optional
Factor (alpha) and exponent (beta) of the z-s power law for snow.
alphaa, betaa : floats
alphaa, betaa : floats, optional
Factor (alpha) and exponent (beta) of the a-r power law.
If not set the factors are going to be determined according
to the radar frequency.
mp_factor : float
mp_factor : float, optional
Factor applied to z-r relation in the melting layer.
refl_field : str
refl_field : str, optional
Name of the reflectivity field to use.
a_field : str
a_field : str, optional
Name of the specific attenuation field to use.
hydro_field : str
hydro_field : str, optional
Name of the hydrometeor classification field to use.
rr_field : str
rr_field : str, optional
Name of the rainfall rate field.
master_field : str
master_field : str, optional
Name of the field that is going to act as master. Has to be
either refl_field or kdp_field. Default is refl_field.
thresh : float
thresh : float, optional
Value of the threshold that determines when to use the slave
field.
thresh_max : Bool
thresh_max : Bool, optional
If true the master field is used up to the thresh value maximum.
Otherwise the master field is not used below thresh value.
Expand Down
Loading

0 comments on commit c499a2f

Please sign in to comment.