pyart.util#
Description
Miscellaneous utility functions.
The location and names of these functions within Py-ART may change between versions without depreciation, use with caution.
Circular Statistics#
|
Compute the mean of a distribution of angles in radians. |
|
Compute the standard deviation of a distribution of angles in radians. |
|
Compute the mean of a distribution of angles in degrees. |
|
Compute the standard deviation of a distribution of angles in degrees. |
|
Compute the mean of a distribution within an interval. |
|
Compute the standard deviation of a distribution within an interval. |
|
Compute the element by element mean of two sets of angles. |
|
Compute the element by element mean of two sets of angles in degrees. |
|
Computes the mean or the median along one of the axis (ray or range) |
Datetime Utilities#
|
Return a datetime for the first ray in a Radar. |
|
Return an array of datetimes for the rays in a Radar. |
|
Return a datetime for the first time in a netCDF Dataset. |
|
Return an array of datetimes for the times in a netCDF Dataset. |
|
Return a datetime for the volume start in a Grid. |
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
Column Section#
|
Calculation of inital bearing alongitudeg a great-circle arc Known as Forward Azimuth Angle. |
|
Given the location (in latitude,longitude) of a target, return the rays that correspond to radar column above the target. |
|
Given the location (in latitude, longitude) of a target, extract the radar column above that point for further analysis. |
|
Calculated of the great circle distance between radar and target |
Cross Section#
|
Extract cross sections from a PPI volume along one or more azimuth angles. :Parameters: * radar (Radar) -- Radar volume containing PPI sweeps from which azimuthal cross sections will be extracted. * target_azimuth (list) -- Azimuthal angles in degrees where cross sections will be taken. * az_tol (float, optional) -- Azimuth angle tolerance in degrees. If none the nearest angle is used. If valid only angles within the tolerance distance are considered. |
|
Extract cross sections from an RHI volume along one or more elevation angles. :Parameters: * radar (Radar) -- Radar volume containing RHI sweeps from which azimuthal cross sections will be extracted. * target_elevations (list) -- Elevation angles in degrees where cross sections will be taken. * el_tol (float, optional) -- Elevation angle tolerance in degrees. If none the nearest angle is used. If valid only angles within the tolerance distance are considered. |
|
Gets RHI target elevations :Parameters: radar (Radar object) -- radar object |
|
Flags radar gates of radar1 colocated with radar2 :Parameters: * radar1 (Radar) -- radar object that is going to be flagged * radar2 (Radar) -- radar object * h_tol (float) -- tolerance in altitude [m] * latlon_tol (float) -- tolerance in latitude/longitude [deg] * coloc_gates_field (string) -- Name of the field to retrieve the data |
|
Flags radar gates of radar1 co-located with radar2. Uses nearest neighbour calculation with cKDTree :Parameters: * radar1 (Radar) -- radar object that is going to be flagged * radar2 (Radar) -- radar object * distance_upper_bound (float) -- upper bound of the distance between neighbours (m) * coloc_gates_field (string) -- Name of the field to retrieve the data. |
|
Flags region of radar1 that is intersecting with radar2 and complies with criteria regarding visibility, altitude, range, elevation angle and azimuth angle :Parameters: * radar1 (Radar) -- radar object that is going to be flagged * radar2 (Radar) -- radar object checked for intersecting region * h_tol (float) -- tolerance in altitude [m] * latlon_tol (float) -- latitude and longitude tolerance [decimal deg] * vol_d_tol (float) -- pulse volume diameter tolerance [m] * vismin (float) -- minimum visibility [percentage] * hmin, hmax (floats) -- min and max altitude [m MSL] * rmin, rmax (floats) -- min and max range from radar [m] * elmin, elmax (floats) -- min and max elevation angle [deg] * azmin, azmax (floats) -- min and max azimuth angle [deg] |
Noise estimation#
|
Estimate noise parameters of a Doppler spectrum. |
|
Estimate noise parameters of a ray |
|
Get the point clutter threshold (PCT) |
|
Get the threshold for maximum local variance of noise [dB] |
|
Get the threshold for steps 3 and 6 of ivic |
|
Get the point clutter threshold (PCT) of Ivic from a look up table. |
|
Get the threshold for steps 3 and 6 of ivic from a look up table The thresholds are computed for between 1 and 200 pulses. |
|
Get maximum variance of noise of Ivic from a look up table. |
|
Get the size of the flat region window length as a function of the number of pulses. |
Radar Utilities#
|
Determine if a Radar appears to be a vertical pointing scan. |
|
Convert an existing Radar object to represent a vertical pointing scan. |
|
Combine two radar instances into one. |
|
Combine two spectra instances into one. |
|
Cuts the radar object into new dimensions |
|
Cuts the radar spectra object into new dimensions |
|
obtain a Radar object from a RadarSpectra object |
|
Interpolates the spectra so that it has a uniform grid |
|
Find the neighbouring gates within +-delta_azi and +-delta_rng |
|
Computes the azimuthal average |
|
Is used to guarantee that a masked array can be broadcasted without loosing the mask |
|
This function will split a field based on thresholds from another field. |
|
Determine the number of sweeps using elevation data (PPI scans) or azimuth data (RHI scans) and update the input radar object |
Simulated Velocity#
|
Create simulated radial velocities from a profile of horizontal winds. |
Signal Mathematics#
|
Compute field texture along ray using a user specified window size. |
|
create a rolling window object for application of functions eg: result=np.ma.std(array, 11), 1) |
|
Determine a texture field using an 11pt stdev texarray=texture(pyradarobj, field). |
|
Compute the angular texture of an image. |
|
Compute the local standard deviation of a gridded field |
|
Computes the Nash-Sutcliff model efficiency coefficient between observed and modeled profiles |
|
Computes the Pearson correlation coefficient between two arrays |
|
Computes the mean square error between two arrays |
Functions
|
Compute the mean of a distribution of angles in radians. |
|
Compute the mean of a distribution of angles in degrees. |
|
Compute the standard deviation of a distribution of angles in radians. |
|
Compute the standard deviation of a distribution of angles in degrees. |
|
Compute the angular texture of an image. |
|
Flags radar gates of radar1 colocated with radar2 :Parameters: * radar1 (Radar) -- radar object that is going to be flagged * radar2 (Radar) -- radar object * h_tol (float) -- tolerance in altitude [m] * latlon_tol (float) -- tolerance in latitude/longitude [deg] * coloc_gates_field (string) -- Name of the field to retrieve the data |
|
Flags radar gates of radar1 co-located with radar2. Uses nearest neighbour calculation with cKDTree :Parameters: * radar1 (Radar) -- radar object that is going to be flagged * radar2 (Radar) -- radar object * distance_upper_bound (float) -- upper bound of the distance between neighbours (m) * coloc_gates_field (string) -- Name of the field to retrieve the data. |
|
Computes the azimuthal average |
|
Computes the Pearson correlation coefficient between two arrays |
|
Computes the mean or the median along one of the axis (ray or range) |
|
Computes the mean square error between two arrays |
|
Computes the Nash-Sutcliff model efficiency coefficient between observed and modeled profiles |
|
Extract cross sections from a PPI volume along one or more azimuth angles. :Parameters: * radar (Radar) -- Radar volume containing PPI sweeps from which azimuthal cross sections will be extracted. * target_azimuth (list) -- Azimuthal angles in degrees where cross sections will be taken. * az_tol (float, optional) -- Azimuth angle tolerance in degrees. If none the nearest angle is used. If valid only angles within the tolerance distance are considered. |
|
Extract cross sections from an RHI volume along one or more elevation angles. :Parameters: * radar (Radar) -- Radar volume containing RHI sweeps from which azimuthal cross sections will be extracted. * target_elevations (list) -- Elevation angles in degrees where cross sections will be taken. * el_tol (float, optional) -- Elevation angle tolerance in degrees. If none the nearest angle is used. If valid only angles within the tolerance distance are considered. |
|
Return a datetime for the first time in a netCDF Dataset. |
|
Return a datetime for the volume start in a Grid. |
|
Return a datetime for the first ray in a Radar. |
|
Return an array of datetimes for the times in a netCDF Dataset. |
|
Return an array of datetimes for the rays in a Radar. |
|
Determine the number of sweeps using elevation data (PPI scans) or azimuth data (RHI scans) and update the input radar object |
|
Estimate noise parameters of a Doppler spectrum. |
|
Estimate noise parameters of a ray |
|
Find the neighbouring gates within +-delta_azi and +-delta_rng |
|
Calculation of inital bearing alongitudeg a great-circle arc Known as Forward Azimuth Angle. |
|
Given the location (in latitude,longitude) of a target, return the rays that correspond to radar column above the target. |
|
Given the location (in latitude, longitude) of a target, extract the radar column above that point for further analysis. |
|
Get the threshold for maximum local variance of noise [dB] |
|
Get the point clutter threshold (PCT) |
|
Get the threshold for steps 3 and 6 of ivic |
|
Gets RHI target elevations :Parameters: radar (Radar object) -- radar object |
|
Compute the local standard deviation of a gridded field |
|
This function will split a field based on thresholds from another field. |
|
Interpolates the spectra so that it has a uniform grid |
|
Flags region of radar1 that is intersecting with radar2 and complies with criteria regarding visibility, altitude, range, elevation angle and azimuth angle :Parameters: * radar1 (Radar) -- radar object that is going to be flagged * radar2 (Radar) -- radar object checked for intersecting region * h_tol (float) -- tolerance in altitude [m] * latlon_tol (float) -- latitude and longitude tolerance [decimal deg] * vol_d_tol (float) -- pulse volume diameter tolerance [m] * vismin (float) -- minimum visibility [percentage] * hmin, hmax (floats) -- min and max altitude [m MSL] * rmin, rmax (floats) -- min and max range from radar [m] * elmin, elmax (floats) -- min and max elevation angle [deg] * azmin, azmax (floats) -- min and max azimuth angle [deg] |
|
Compute the mean of a distribution within an interval. |
|
Compute the standard deviation of a distribution within an interval. |
|
Determine if a Radar appears to be a vertical pointing scan. |
|
Get maximum variance of noise of Ivic from a look up table. |
|
Get the size of the flat region window length as a function of the number of pulses. |
|
Get the point clutter threshold (PCT) of Ivic from a look up table. |
|
Get the threshold for steps 3 and 6 of ivic from a look up table The thresholds are computed for between 1 and 200 pulses. |
|
Combine two radar instances into one. |
|
Combine two spectra instances into one. |
|
Is used to guarantee that a masked array can be broadcasted without loosing the mask |
|
Compute the element by element mean of two sets of angles. |
|
Compute the element by element mean of two sets of angles in degrees. |
|
obtain a Radar object from a RadarSpectra object |
|
create a rolling window object for application of functions eg: result=np.ma.std(array, 11), 1) |
|
Create simulated radial velocities from a profile of horizontal winds. |
|
Calculated of the great circle distance between radar and target |
|
Cuts the radar object into new dimensions |
|
Cuts the radar spectra object into new dimensions |
|
Determine a texture field using an 11pt stdev texarray=texture(pyradarobj, field). |
|
Compute field texture along ray using a user specified window size. |
|
Convert an existing Radar object to represent a vertical pointing scan. |